{
 "number": 36252,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36252",
 "title": "ci, iwyu: skip subtrees in compilation database",
 "author": "ryanofsky",
 "author_association": "MEMBER",
 "created_at": "2026-09-14T15:45:51Z",
 "updated_at": "2026-09-15T01:29:08Z",
 "age_days": 3,
 "draft": false,
 "labels": [],
 "milestone": null,
 "base": "master",
 "head_sha": "01e3eca2d8ee755eed4488a44093759f0eddcb34",
 "head_ref": "pr/iwyusub",
 "head_repo": "ryanofsky/bitcoin",
 "head_history": [],
 "additions": 11,
 "deletions": 0,
 "changed_files": 1,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": [
    {
     "number": 31349,
     "title": "ci: detect outbound internet traffic generated while running tests",
     "author": "vasild"
    }
   ]
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "hebasto"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-09-14T17:06:50Z",
  "last_reviewer_activity": "2026-09-14T15:57:38Z",
  "last_reviewer": "hebasto",
  "author_silent_days": 2,
  "waiting_on_author_days": 0,
  "days_since_update": 2
 },
 "refs": {
  "mentioned": [
   35361,
   35418,
   35523,
   36112
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 36112,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2026-09-01",
    "title": "ci: Exclude subtrees from iwyu"
   },
   {
    "number": 35361,
    "type": "issue",
    "state": "closed",
    "merged": false,
    "merged_at": null,
    "title": "ci: spurious output / errors in IWYU job"
   },
   {
    "number": 35418,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2026-06-12",
    "title": "build: exclude mptest target from compile commands"
   },
   {
    "number": 35523,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2026-06-13",
    "title": "Revert \\\"build: exclude mptest target from compile commands\\\""
   }
  ],
  "conflicts": [
   31349
  ]
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "**Problem:** The IWYU CI job analyzes `src/ipc/libmultiprocess/` even though its results are thrown away. 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. The suggestions also disagree with what libmultiprocess's own IWYU CI reports (it runs with `-Xiwyu --error` and passes), because the two jobs use different IWYU versions and mapping files. libmultiprocess is the only subtree in this situation; leveldb, crc32c, minisketch and secp256k1 are already excluded from `compile_commands.json` with `EXPORT_COMPILE_COMMANDS OFF`. #35361 asked for subtrees not to be linted at all.\n\n**Solution:** Filter `SHARED_EXCLUDED_SUBTREES` (from `test/lint/lint_ignore_dirs.py`) out of `compile_commands.json` at the start of the IWYU section of `ci/test/03_test_script.sh`, so subtree sources are neither analyzed nor edited. This is done in the CI script rather than in cmake so that only IWYU is affected: clang-tidy keeps running on libmultiprocess, and no list of subtree targets has to be maintained in `cmake/libmultiprocess.cmake` (that approach broke `-DBUILD_TESTS=OFF` in #35418 and was reverted in #35523). One-file change to the CI script.\n\n**Testing note:** You can confirm this works by checking at IWYU CI logs and confirming that output like `/home/runner/work/_temp/src/ipc/libmultiprocess/src/mp/gen.cpp should add these lines:` no longer appears.",
 "commits": [
  {
   "sha": "01e3eca2d8ee755eed4488a44093759f0eddcb34",
   "date": "2026-09-14T15:20:08Z",
   "message": "ci, iwyu: skip subtrees in compilation database\n\nDrop SHARED_EXCLUDED_SUBTREES from compile_commands.json before running IWYU,\nso subtree sources are no longer analyzed. Previously the non-enforced IWYU\npass still analyzed src/ipc/libmultiprocess/, the only subtree not already\nexcluded from the compilation database with EXPORT_COMPILE_COMMANDS OFF, and\nits suggestions were reverted by the git restore added in #36112 without\nanyone acting on them.\n\nFiltering in the CI script rather than in cmake keeps clang-tidy running on\nthe subtree and avoids maintaining a list of subtree targets in\ncmake/libmultiprocess.cmake, which broke -DBUILD_TESTS=OFF in #35418.\n\nFollows up on #35361, which asked not to run linters over subtrees.\n\nCo-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>"
  }
 ],
 "timeline": [
  {
   "t": "2026-09-14T15:57:38Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "Why not https://github.com/bitcoin/bitcoin/pull/35418#pullrequestreview-4428862711?"
  },
  {
   "t": "2026-09-14T17:06:50Z",
   "kind": "comment",
   "who": "ryanofsky",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nI think excluding all subtrees from IWYU is better than individually setting in CMAKE_EXPORT_COMPILE_COMMANDS inside individual subtrees because:\n\n- It directly addresses the fact that IWYU's instability makes it inappropriate to run on subtrees. IWYU's output changes depending on compiler version, standard libary version, IWYU version, and local mappings so it's not realistic to expect subtrees will be able to pass IWYU checks in bitcoin core, and there's not much reason to care if they do, since benefits of IWYU are faster compile times and more consistent code style, not anything safety related.\n\n- This approach works for all subtrees, instead of requiring every individual subtree to hardcode cmake options.\n\n- This approach only disables IWYU, and does not disable all other tools or checks that use the compilation database. I don't think that turning off clang-tidy, bitcoin-tidy, and other tools for all subtrees is a good idea just to prevent IWYU noise, when IWYU noise can be prevented by just running it on the right files."
  }
 ],
 "labels_log": [],
 "state_log": [],
 "text_chars": 3463,
 "text_tokens_estimate": 865,
 "changed_paths": [
  "ci/test/03_test_script.sh"
 ],
 "files": [
  {
   "path": "ci/test/03_test_script.sh",
   "add": 11,
   "del": 0
  }
 ],
 "test_lines": 11,
 "git": {
  "head": "01e3eca2d8ee755eed4488a44093759f0eddcb34",
  "head_matches_backup": true,
  "base": "a09a81ebfce360a45484e2d0e4e8e889f5d5d214",
  "commits": [
   {
    "sha": "01e3eca2d8",
    "subject": "ci, iwyu: skip subtrees in compilation database",
    "files": 1,
    "add": 11,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "2d717789d52698a2",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}