ci: Allow running CI in worktrees #32767

pull maflcko wants to merge 3 commits into bitcoin:master from maflcko:2506-ci-worktree changing 6 files +10 −12
  1. maflcko commented at 6:31 pm on June 17, 2025: member

    Fixes #30028 (modulo lint and tidy CI).

    The error on current master in a worktree is:

    0$ git worktree add ./main origin/master && cd ./main
    1$ MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_mac_cross.sh" ./ci/test_run_all.sh
    2...
    3+ git config --global ci.base-install-done true
    4fatal: not a git repository: /root/b-c-ci/.git/worktrees/main
    

    So just use a plain file, instead of git. Also, enable pipefail while touching this bash script.

  2. DrahtBot commented at 6:31 pm on June 17, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32767.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK willcl-ark

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Tests on Jun 17, 2025
  4. maflcko force-pushed on Jun 17, 2025
  5. DrahtBot added the label CI failed on Jun 17, 2025
  6. DrahtBot commented at 6:35 pm on June 17, 2025: contributor

    🚧 At least one of the CI tasks failed. Task lint: https://github.com/bitcoin/bitcoin/runs/44283549226 LLM reason (✨ experimental): The CI failure is caused by errors detected during the lint checks, specifically from the shell script lint warning (SC2086) and a spelling mistake flagged by codespell, indicating that the linting step did not pass.

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  7. maflcko marked this as a draft on Jun 17, 2025
  8. maflcko force-pushed on Jun 17, 2025
  9. maflcko marked this as ready for review on Jun 17, 2025
  10. DrahtBot removed the label CI failed on Jun 17, 2025
  11. ci: Clean UID/GID mismatch
    rsync --archive will preserve owner and group, which is then required to
    be handled by adding a git safe.directory workaround.
    
    Remove the need for the workaround by only preserving permissions during
    the recursive rsync copy.
    faf6a04597
  12. ci: Allow running CI in worktrees fa535a6de7
  13. maflcko force-pushed on Jun 18, 2025
  14. maflcko commented at 8:28 am on June 18, 2025: member
    added a commit to remove a workaround while touching the ci scripts
  15. ci: Add missing errexit to lint CI install
    Otherwise, a possible failure is silently ignored.
    
    Also, rename the file, while touching it, to clarify installing is the
    first step.
    fa68dcb207
  16. maflcko commented at 2:29 pm on June 18, 2025: member
    added a commit to fix a silent bug in the lint CI install bash script (unrelated, but found while working on this)
  17. fanquake requested review from willcl-ark on Jun 19, 2025
  18. willcl-ark approved
  19. willcl-ark commented at 9:51 am on June 20, 2025: member

    tACK fa68dcb207c3431ecf1ab6caac588062c06a19c1

    Tested working in a worktree.

    It’s a much simpler change than my own (and I like it for that reason).

    I still don’t see a particularly “clean” way to have the other two jobs work without something more like #31787, as they require the legitimate (i.e. not empty/dummy) .git directory to be mounted in the container.

    But this feels good for now.

  20. maflcko commented at 11:08 am on June 20, 2025: member

    I still don’t see a particularly “clean” way to have the other two jobs work without something more like #31787, as they require the legitimate (i.e. not empty/dummy) .git directory to be mounted in the container.

    I haven’t tried this, but git init ./ && git add ./ may be a easy one-line fix for those, but I can try in a follow-up, if someone wants me to.

    The two other changes/bugfixes here should be independent improvements unrelated to worktrees anyway.

  21. fanquake merged this on Jun 24, 2025
  22. fanquake closed this on Jun 24, 2025

  23. maflcko deleted the branch on Jun 24, 2025

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: 2025-06-30 18:13 UTC

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