#36252 ci, iwyu: skip subtrees in compilation database

full analysis

https://github.com/bitcoin/bitcoin/pull/36252 · ryanofsky · +11/-0 in 1 files, 1 commits · labels: none

Goal

  • Stop Include What You Use CI checks from analyzing excluded subtree directories
  • Avoid misleading warnings in CI logs and save runner time on third-party code

This pull request updates `ci/test/03_test_script.sh` to filter out shared excluded subtree directories (defined in `test/lint/lint_ignore_dirs.py`) from `compile_commands.json` before running Include What You Use (IWYU). This prevents IWYU from analyzing subtree source files like `libmultiprocess` while keeping `compile_commands.json` intact for tools like `clang-tidy`.

Problem: The IWYU CI job currently analyzes `src/ipc/libmultiprocess/`, generating warnings and suggested header edits that are discarded via `git restore`. This clutters CI job logs with misleading warnings and wastes CI runner time on third-party code maintained upstream.

Category: Build and CI (#42 of 55)

P3 · cleanup

  • P3 because it reduces CI log noise and redundant processing on subtrees
  • Routine CI cleanup that does not fix a broken build or flaky test

P3 because it reduces CI log noise and redundant processing on subtrees. The author notes that '#35361 asked for subtrees not to be linted at all' and that IWYU suggestions for libmultiprocess disagree with upstream and are discarded anyway. It does not fix a broken build or flaky test, making it a routine CI maintenance cleanup.

Membership: Modifies `ci/test/03_test_script.sh` to adjust CI compilation database handling for IWYU.

Factors: security/stability 0, bug 1, performance 1, user value 0, leverage 0

Reviewability: Ready

  • Ready to review
  • Small 11-line CI script update with passing CI

The PR is an 11-line CI shell script addition with passing CI and no pending changes.

Author status: active

Resolved concerns:

  • hebasto asked why subtrees are not excluded via CMAKE_EXPORT_COMPILE_COMMANDS in CMake; ryanofsky clarified that filtering in CI avoids breaking clang-tidy for subtrees and prevents build breakages with -DBUILD_TESTS=OFF.

Agreement: Neutral

  • Neutral sentiment with no reviews or approvals yet
  • Asked why subtrees are not excluded via CMake instead of CI (hebasto)
  • Author explained CI filtering avoids breaking other tools like clang-tidy

Neutral; hebasto asked about a CMake-level alternative and ryanofsky provided a detailed rationale.

hebasto inquired about using CMake-level exclusion as attempted in #35418, to which the author explained the advantages of filtering at the CI step. No other reviews or ACKs have been posted yet.

  • hebasto asked: 'Why not https://github.com/bitcoin/bitcoin/pull/35418#pullrequestreview-4428862711?'
  • ryanofsky answered explaining that CI filtering avoids breaking other tools like clang-tidy and doesn't require modifying CMake subtree options.

Review verdicts (DrahtBot): 0

Files

11 lines under test/bench/ci.

  • ci/test/03_test_script.sh +11/-0

Card

This PR strips subtree source files from compile_commands.json specifically during the IWYU step in ci/test/03_test_script.sh. It prevents IWYU from generating spurious header modification recommendations on upstream subtrees like libmultiprocess that get discarded at the end of the run. The change is small, self-contained, and follows up on issue #35361. hebasto inquired about doing the filtering in CMake instead, which the author answered with several practical reasons for doing it in the CI runner script.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:59, confidence high, input hash 2d717789d52698a2