Files
Groene AIandClaude Opus 4.8 33a3f81f13 Make build profile hook a no-op when no profile data is produced
Address review on #107117.

prepare-time-trace.sh collects binary sizes with `find ... | xargs wc -c`.
On a build with no readable objects (cross-arch / non-Linux) GNU xargs runs
`wc -c` once with no arguments and writes a bare `0` row into
binary_sizes.txt. That row does not match the binary_sizes FORMAT Regexp, so
insert_build_size_data still failed and the post-hook exited 1 - the exact
case this PR set out to fix. The earlier "skip absent or empty artifact"
guard did not help because the file was non-empty.

Fix at the producer: use `xargs -r` on the size and symbol collection so an
empty input set leaves the artifact empty instead of emitting a junk row.
With that, an empty artifact reliably means "no such profile data for this
build", and the hook can: no-op for builds that produce no data, upload for
builds that do, and fail loudly on any genuine processing or upload error
(it never swallows one).

Regression tests now run the real producer against an empty build dir and
assert binary_sizes.txt is empty, model the present-but-empty producer output
for the cross-arch case instead of an absent file, and cover that an upload
error propagates.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-11 09:41:01 +00:00
..