#36235 ci, iwyu: fail job on compiler errors instead of silently logging them
https://github.com/bitcoin/bitcoin/pull/36235 · · +12/-0 in 1 files, 1 commits · labels: none
Goal
- Ensure CI fails when include-what-you-use encounters compiler errors
- Prevents missing generated headers and unanalyzed files from silently passing CI checks
Updates the IWYU test runner in CI to inspect output for clang 'fatal error:' occurrences and exit with a failure if found. Previously, non-zero exits from iwyu_tool.py were suppressed by '|| true', allowing missing generated headers to pass silently.
Problem: IWYU cannot analyze source files that fail compilation, but errors such as missing generated headers were silently logged without failing CI, allowing analysis gaps to persist unnoticed.
Category: Build and CI (#15 of 55)
P3 · test coverage
- P3 because compilation errors during IWYU analysis currently pass CI without failing the job
- Prevents gaps in linter test coverage caused by hidden issues such as missing generated headers
Improves CI failure reporting by ensuring compilation failures in IWYU runs cause the job to fail rather than silently passing. As described in the PR, 'iwyu_tool.py's non-zero exit is swallowed by || true', hiding missing header generation. This strengthens CI reliability for linter checks, warranting P3.
Membership: Touches ci/test/03_test_script.sh to change CI execution behavior for the IWYU job.
Factors: security/stability 0, bug 1, performance 0, user value 0, leverage 1
Reviewability: Ready
- Ready to review now
- Small, self-contained change with passing CI
The patch is small, self-contained, and has passing CI with no open questions.
Author status: active
Agreement: Positive
- Concept approval without stated reasons (hebasto)
- No objections or alternative approaches raised
Concept ACK from hebasto with no objections
hebasto provided a Concept ACK and pinged the CI maintainer; no criticisms or alternative approaches have been raised.
- hebasto posted 'Concept ACK. cc @maflcko'
Review verdicts (DrahtBot): 0
- Concept ACK: hebasto
Files
12 lines under test/bench/ci.
- ci/test/03_test_script.sh +12/-0
Card
This PR updates the IWYU CI runner script to detect Clang fatal errors and fail the job rather than silently ignoring them due to piped shell suppression. It resolves an issue where missing generated headers during IWYU passes went undetected in CI. hebasto has Concept ACKed the change. Reviewing the code now is straightforward as it consists of a small, self-contained shell check.