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

issue maflcko opened 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:

    ...
    IWYU edited 0 files on your behalf.
    
    + git diff -U0
    + ./contrib/devtools/clang-format-diff.py -binary=clang-format-21 -p1 -i -v
    fatal: not a git repository: /home/runner/work/bitcoin-core-with-ci/bitcoin-core-with-ci/.git/worktrees/ci-matrix-worktree
    + git --no-pager diff --exit-code
    fatal: not a git repository: /home/runner/work/bitcoin-core-with-ci/bitcoin-core-with-ci/.git/worktrees/ci-matrix-worktree
    + echo '^^^ ⚠️ Failure generated from IWYU'
    + false
    ^^^ ⚠️ Failure generated from IWYU
    Command '['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:

    diff --git a/.github/actions/configure-environment/action.yml b/.github/actions/configure-environment/action.yml
    index e2a26b7184..df2a6aae28 100644
    --- a/.github/actions/configure-environment/action.yml
    +++ b/.github/actions/configure-environment/action.yml
    @@ -19,2 +19,3 @@ runs:
           run: |
    +        cd ../ci-matrix-worktree
             echo "DEPENDS_HASH=$(git ls-tree HEAD depends "$FILE_ENV" | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
    @@ -25,2 +26,3 @@ runs:
           run: |
    +        cd ../ci-matrix-worktree
             source $FILE_ENV
    diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
    index bbac5e023c..afb51b99e2 100644
    --- a/.github/workflows/ci.yml
    +++ b/.github/workflows/ci.yml
    @@ -626,2 +626,6 @@ jobs:
           - *CHECKOUT
    +      
    +      - name: Worktree add
    +        run: |
    +          git worktree add ../ci-matrix-worktree HEAD
     
    @@ -655,3 +659,5 @@ jobs:
           - name: CI script
    -        run: ./ci/test_run_all.sh
    +        run: |
    +          cd ../ci-matrix-worktree  # cd required :(
    +          ./ci/test_run_all.sh
     
    
  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

Contributors

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-05-02 06:12 UTC

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