ci(cppcheck): analyse one pinned configuration instead of up to twelve - #654
Merged
Merged
Conversation
The advisory static-analysis job has taken 40-50 minutes on nearly every
run. The cause is cppcheck's configuration enumeration: given no -D, it
analyses each file once per combination of the #ifdef branches it finds
(platform, DEBUG, endianness, fuzzing), up to 12, and most files hit that
cap ("Too many #ifdef configurations").
CPPCHECK_DEFS pins the gcc / x86-64 / Linux debug configuration CI
compiles. Measured with cppcheck 2.13.0 (the version the runner installs):
format.c 449 s -> 57 s, eval.c 568 s -> 78 s, pivot.c 325 s -> 42 s, and
the whole tree at -j 4 in 632 s, exit 0. Findings are unchanged: the
single-file cross-TU warning in eval.c still reports with the pin.
Unlike the CI half of #649, this keeps what made the job worth running:
the whole tree (no changed-files-only pass, no skipped translation units)
and --error-exitcode=1, so a finding still fails the advisory job. What
the pin gives up is analysis of the Windows/macOS/WASM #ifdef branches,
which were only ever sampled within the 12-configuration cap anyway.
The job also gets a 30-minute timeout so a regression in analysis time
cannot hold a runner for hours.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CI half of #649, redone as its own change as asked in that review, and fixed at the root rather than by narrowing what gets checked.
Problem
The advisory
static-analysisjob has taken 40–50 minutes on nearly every run for the last two days. The cause is cppcheck's configuration enumeration. Given no-D, it analyses each file once per combination of the#ifdefbranches it finds (platform,DEBUG, endianness, fuzzing), up to 12. Most files hit that cap:Too many #ifdef configurations - cppcheck only checks 12 configurations.Fix
CPPCHECK_DEFS(Makefile) pins the one configuration CI compiles: gcc, x86-64, Linux, debug. Each file is analysed once.timeout-minutes: 30on the job, so a regression in analysis time can't hold a runner for hours.Measured with cppcheck 2.13.0, the version the runner installs:
src/lang/format.csrc/lang/eval.csrc/ops/pivot.c-j 4Findings are unchanged: the single-file cross-TU warning in
eval.cstill reports with the pin.Compared with #649's version
This keeps what makes the job worth running:
group.c,query.candagg_engine.care no longer skipped;--error-exitcode=1: a finding still fails the job, which stays advisory viacontinue-on-error.What the pin gives up is analysing the Windows/macOS/WASM
#ifdefbranches. Those were only ever sampled within the 12-configuration cap anyway.