#36252 ci, iwyu: skip subtrees in compilation database

ReviewabilityReviewsAgreementSize
#36252 ryanofsky ci, iwyu: skip subtrees in compilation databaseWaiting on author2Strong0 + 11 tests
  • Prevent CI from running include linter checks on excluded subtree files
  • Eliminate discarded linter suggestions and reduce CI log noise
  • Ready for review
  • Nothing known that would invalidate a review now
  • Strong support with suggestions for alternative approaches
  • Support for smaller CI logs and a slight speedup (maflcko)
  • Support because it prevents an IWYU crash on subtree code (David-Uka)
  • Suggested using the tool exclude option instead (hebasto)
  • Suggested moving the runner logic to a dedicated Python script (maflcko)
  • 0 lines added or modified outside tests
  • 11 lines added or modified in tests
  • 0 lines removed in total
  • 1 files, 1 commits
Build and CI#47 of 56
P3 · cleanup
  • P3 because it is a minor CI cleanup that only affects subtree linting
  • Eliminates discarded linter output for 14 files and slightly speeds up CI
  • Avoids potential linter crashes on subtree code without changing build outputs
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Filters excluded subtree paths out of the compilation database before running Include What You Use (IWYU) in CI. This prevents IWYU from analyzing source files in subtrees like libmultiprocess and generating suggestions that are immediately discarded.

Problem: The non-enforced IWYU CI pass analyzes 14 source files in src/ipc/libmultiprocess/, generating suggestions that conflict with upstream libmultiprocess CI checks and are immediately reverted via git restore.

Evidence of importance:

  • PR description: 'Every run prints IWYU suggestions for 14 libmultiprocess files in the non-enforced pass, applies them, and then reverts them with the git restore from #36112.'
  • Linked issue #35361 requested excluding subtrees from linter runs.

Reviewability

Paused · Waiting on author

Open objections from hebasto, maflcko with no author reply for 24 days; review would repeat what has been asked.

Waiting on (from the thread read):

  • author: response to suggestions on using vanilla python or iwyu_tool.py --exclude 2026-09-25
  • author: response to suggestions to use iwyu_tool.py --exclude or switch to a python runner 2026-09-25

Agreement

Strong

substantive support, no open objection (maflcko, David-Uka, BrandonOdiwuor)

Thread notes: Added hebasto's answered question about cmake subtree exclusion and maflcko's suggestion about replacing inline python/jq with a standalone script. Added BrandonOdiwuor's Concept ACK. / Added hebasto's initial question and ryanofsky's answer, maflcko's suggestion about a standalone Python script, and BrandonOdiwuor's Concept ACK.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
hebasto (member)question, approachWhy not handle subtree exclusion via cmake as proposed in #35418?answered · author explained why CI-level filtering is preferable to individual cmake target overridesansweredyes2026-09-14: 'Why not https://github.com/bitcoin/bitcoin/pull/35418#pullrequestreview-4428862711?'
Status from: 2026-09-14: ryanofsky: 'I think excluding all subtrees from IWYU is better than individually setting in CMAKE_EXPORT_COMPILE_COMMANDS inside individual subtrees'
maflcko (member)suggestion, approachMove the IWYU runner logic to a dedicated Python script and drop jq dependencyopenansweredno2026-09-17: 'All of those python3 -c '...' inside bash are fine, but seem a bit hacky. At some point we can use vanilla Python and drop the jq dep.'
hebasto (member)suggestion, approachUse the --exclude option of iwyu_tool.py instead of modifying compile_commands.jsonopenansweredno2026-09-25: 'FWIW, we can use the `--exclude` option of the `iwyu_tool.py` tool'

Support:

  • maflcko (member) (ACK, 2026-09-17) [read: ci/test/03_test_script.sh]: minimal speed-up and minimally smaller ci log output
  • David-Uka (contributor) (ACK, 2026-09-23) [read: ci/test/03_test_script.sh, compile_commands.json]: drops libmultiprocess sources preventing an IWYU crash on UsingShadowDecl while keeping git restore for subtree headers
  • hebasto (member) (ACK, 2026-09-25): (no reason given) [not substantive]
  • BrandonOdiwuor (contributor) (Concept ACK, 2026-10-08) [tested: compile_commands.json]: filtering SHARED_EXCLUDED_SUBTREES out of compile_commands.json before IWYU

Participants:

  • hebasto (member, support, 3 statements 2026-09-14 to 2026-09-25): ACKed; suggested using iwyu_tool.py's --exclude option
  • maflcko (member, support, 2 statements 2026-09-17 to 2026-09-17): ACKed; suggested replacing bash/jq/python inline commands with a dedicated python script
  • David-Uka (contributor, support, 1 statements 2026-09-23 to 2026-09-23): ACKed noting it prevents LLVM 23 IWYU crash on UsingShadowDecl
  • BrandonOdiwuor (contributor, support, 1 statements 2026-10-08 to 2026-10-08): Concept ACKed; supported maflcko's python script suggestion

Files

11 lines under test/bench/ci.

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

Card

The short text the ranking pass compares across PRs.

Filters excluded subtree sources out of compile_commands.json before running Include What You Use (IWYU) in CI. Currently, the non-enforced IWYU pass analyzes src/ipc/libmultiprocess/, producing warnings and suggested edits that conflict with upstream libmultiprocess CI and are reverted immediately after each run. Dropping subtree entries from the compilation database prevents wasted analysis and eliminates noisy CI output.

Data

dossier JSON · extract JSON · model ledger, generated 2026-10-09T01:19, confidence high, input hash 0ec278e2145a7525
thread read through 2026-10-08 (8 statements), head 01e3eca2d8
labels: none

Categories

Build and CI

P3 · cleanup

Filters excluded subtree paths to eliminate unnecessary IWYU analysis and log noise in CI. The non-enforced IWYU CI pass analyzed 14 source files in src/ipc/libmultiprocess/ only to discard the suggestions via git restore, and contributor review notes this avoids potential IWYU tool crashes on subtree code.

Membership: Changes ci/test/03_test_script.sh to filter excluded subtree paths from the compilation database before running IWYU.

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