Files
Alexey Milovidov cf57088528 Build profile diff: fail-close the profile producer, fix the new-TU threshold
Two issues from the review of `ab3d5dd8fed`.

`prepare-time-trace.sh` was fail-open on partial extraction failures: it ran
without `set -e` / `pipefail`, so a failing `jq` or `nm` inside one
`xargs ... bash -c` child only made that child exit non-zero while the script
kept going and still exited `0`. The hook then uploaded a truncated but
non-empty profile, `_verify_trace_extraction` accepted it, and
`compare_compile_times` reported the missing translation units as new or absent
instead of failing the build. The script now enables `set -e` and
`set -o pipefail` (also inside the `xargs` children, so a failing `jq` in the
middle of a pipeline propagates), and the stages that may legitimately select
nothing - `grep` exiting 1 for a build that compiled nothing, has no objects, or
an object that defines no reportable symbol - guard that single stage with
`|| true`. A build that was a complete compiler-cache hit emits no raw trace
file at all and still passes; a broken one now fails the build loudly
(`xargs` exit 123).

`compare_compile_times` listed translation units without a master baseline from
a hard-wired 30 s while judging their significance at `TU_SIG_SECONDS` = 20 s,
so a new TU costing 20-29.9 s appeared in neither the body, the summary nor the
top-level verdict - exactly the case (a generated file or a heavy new header
introducing several ~25 s TUs) that the no-baseline path exists to surface. The
no-baseline path now uses the section's own two thresholds, like a both-sided
delta: reported from `TU_REPORT_SECONDS`, significant from `TU_SIG_SECONDS`, and
the summary counts only the translation units above the significance bar. The
listing is capped like the tables, with an "and N more" line.

Tests: `test_new_tu_report_threshold_matches_the_significance_threshold`
(a 25 s new TU is listed and significant, a 7 s one is only listed),
`test_producer_fails_when_a_trace_file_cannot_be_parsed`,
`test_producer_fails_when_nm_cannot_read_an_object`, and
`test_producer_accepts_an_object_without_reportable_symbols`. 48 tests pass,
ruff clean.
2026-07-26 10:50:56 +00:00
..