ci: iwyu task fails when run in a worktree #34428

issue maflcko openend this issue on January 28, 2026
  1. maflcko commented at 11:31 am on January 28, 2026: member

    (I don’t need this, but maybe someone else does?)

    Just wanted to note that the iwyu task is known to not work in a worktree. It fails with:

     0...
     1IWYU edited 0 files on your behalf.
     2
     3+ git diff -U0
     4+ ./contrib/devtools/clang-format-diff.py -binary=clang-format-21 -p1 -i -v
     5fatal: not a git repository: /home/runner/work/bitcoin-core-with-ci/bitcoin-core-with-ci/.git/worktrees/ci-matrix-worktree
     6+ git --no-pager diff --exit-code
     7fatal: not a git repository: /home/runner/work/bitcoin-core-with-ci/bitcoin-core-with-ci/.git/worktrees/ci-matrix-worktree
     8+ echo '^^^ ⚠️ Failure generated from IWYU'
     9+ false
    10^^^ ⚠️ Failure generated from IWYU
    11Command '['docker', 'exec', 'ebf1d1ae7dd7efd91962e3363c2859da5fc8a5061655d95b9fd90a2b51929fd1', '/home/runner/work/_temp/ci/test/03_test_script.sh']' returned non-zero exit status 1.
    

    Tested with a hacky diff like:

     0diff --git a/.github/actions/configure-environment/action.yml b/.github/actions/configure-environment/action.yml
     1index e2a26b7184..df2a6aae28 100644
     2--- a/.github/actions/configure-environment/action.yml
     3+++ b/.github/actions/configure-environment/action.yml
     4@@ -19,2 +19,3 @@ runs:
     5       run: |
     6+        cd ../ci-matrix-worktree
     7         echo "DEPENDS_HASH=$(git ls-tree HEAD depends "$FILE_ENV" | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
     8@@ -25,2 +26,3 @@ runs:
     9       run: |
    10+        cd ../ci-matrix-worktree
    11         source $FILE_ENV
    12diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
    13index bbac5e023c..afb51b99e2 100644
    14--- a/.github/workflows/ci.yml
    15+++ b/.github/workflows/ci.yml
    16@@ -626,2 +626,6 @@ jobs:
    17       - *CHECKOUT
    18+      
    19+      - name: Worktree add
    20+        run: |
    21+          git worktree add ../ci-matrix-worktree HEAD
    22 
    23@@ -655,3 +659,5 @@ jobs:
    24       - name: CI script
    25-        run: ./ci/test_run_all.sh
    26+        run: |
    27+          cd ../ci-matrix-worktree  # cd required :(
    28+          ./ci/test_run_all.sh
    29 
    
  2. maflcko added the label Tests on Jan 28, 2026
  3. maflcko added the label CI failed on Jan 28, 2026
  4. ?
    issue_type_added maflcko
  5. AJTECH001 commented at 11:19 pm on January 28, 2026: none
    Hi! I’d like to work on this issue if it’s still available.
  6. maflcko commented at 9:23 am on January 29, 2026: member
    I submitted a fix in #34441, let’s continue discussion and review there.
  7. maflcko closed this on Jan 29, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-02-02 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me