Repository navigation
Build coverage-docker's binary once per leg - #1261
Conversation
Each coverage-docker leg compiled the whole dependency graph twice: a `cargo build --bin socket-patch` under `cargo llvm-cov show-env` into target/, then `cargo llvm-cov --no-report` into target/llvm-cov-target/. The first build (~2.7 min per leg, 10 legs per run) was also wasted: `cargo llvm-cov report` outside show-env reads only target/llvm-cov-target/*.profraw and objects under that directory, so neither the target/debug binary nor the in-container profraws written to target/ reached the lcov. Mount the socket-patch that the test step's own build produces for the integration tests and write the container's profraws into target/llvm-cov-target, so the in-container code paths merge into the per-ecosystem lcov. Fixes #1199. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NwbTSymWm3Yuq2kZW9Eagi
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4e07334. Configure here.
|
Labeled Ready for review by the burn-down agent.
Generated by Claude Code |
Final review brief (
|
Fixes #1199
Problem
Each of the 10
coverage-dockerlegs (npm, pypi, gem, cargo, golang, maven, composer, nuget, deno, sbt) compiled the dependency graph twice (#1199, profiler sample over 55 merge_group, 15 PR and 6 push runs):Build instrumented socket-patch binary:cargo build --bin socket-patchundercargo llvm-cov show-envintotarget/. It took 2.4–2.9 min per leg, 2.7 min p50.Run <eco> Docker e2e test with coverage:cargo llvm-cov --no-reportrebuilt everything intotarget/llvm-cov-target/(~2m50s), and then the tests ran in seconds.That is ~22.5 / 18.3 / 25 job-min per merge_group / PR / push run, about 8–10k Linux job-min/day.
The first build was also wasted. In cargo-llvm-cov 0.8.7,
reportoutside show-env sets its target dir totarget/llvm-cov-target(src/cargo.rs). It merges only<that dir>/*.profraw(src/report.rsmerge_profraw) and walks only that dir for objects (object_files). So neithertarget/debug/socket-patchnor the in-container profraws, which landed intarget/, reached the per-ecosystem lcov.Change
.github/workflows/ci.yml,coverage-dockerjob only:Build instrumented socket-patch binarystep.SOCKET_PATCH_COV_BINnow points attarget/llvm-cov-target/debug/socket-patch. This is the instrumented binary that the test step's owncargo llvm-covbuilds; cargo builds a package's bins before it runs that package's integration tests. It uses the same RUSTFLAGS and features (docker-e2e) as the test binaries.SOCKET_PATCH_COV_PROFRAW_DIRnow points attarget/llvm-cov-target, socargo llvm-cov reportmerges the in-container profraws.The binary is still built on the ubuntu-22.04 host, so the glibc constraint described in the job comment still holds.
Expected saving
coverage-docker (sbt), which is usually whatcoverage-mergewaits on in the merge queue. Expect ~1 min off merge-queue p50; Windowstestand Gradle e2e also bound that path.Measured result
This PR's run is 37918223729. The baseline is PR run 37914251835, from just before.
That is −27.7 Linux job-min per CI run (−40%). The sbt leg, which
coverage-mergeusually waits on, got 2.1 min shorter. All 10 legs passed. Merge-queue effects show only after merge; the profiler will verify them.The coverage now reaches the lcov. I compared per-ecosystem lcov artifact sizes against main's push run 37910917261 at this PR's base commit:
Where each test runs
Nothing moves. Every docker e2e suite and filter still runs in
coverage-dockeron every PR, merge_group and push, ande2e-dockerstill runs nightly.ci-okandclippyare unchanged, andci-okstill needscoverage-dockerandcoverage-merge.Risk
docker run -v <missing path>would fail loudly, not silently. The integration tests already rely onCARGO_BIN_EXE_socket-patch, which guarantees the build.Validation: YAML parses;
actionlintandzizmor --offlineoutput onci.ymlis identical before and after (all findings are pre-existing).Note: open PRs #1251, #1247 and #1009 also edit
ci.yml, but only in hunks far fromcoverage-docker(lines ~1127 and ~1375).🤖 Generated with Claude Code
https://claude.ai/code/session_01NwbTSymWm3Yuq2kZW9Eagi
Generated by Claude Code
Note
Low Risk
CI workflow-only change; failure modes are loud (missing mount path or unchanged test behavior via CARGO_BIN_EXE_socket-patch).
Overview
Removes the redundant ~2.7 min per-leg
cargo build --bin socket-patchundercargo llvm-cov show-envin thecoverage-dockerjob. That build wrote totarget/butcargo llvm-cov reportonly merges profraws and objects fromtarget/llvm-cov-target/, so the extra compile was wasted CI time and did not improve lcov.Coverage hooks now point
SOCKET_PATCH_COV_BINandSOCKET_PATCH_COV_PROFRAW_DIRattarget/llvm-cov-target, matching the instrumented binary and in-container profraws produced when the existingcargo llvm-cov --no-reportstep runs docker e2e tests (cargo builds package bins before integration tests). Expected savings are on the order of ~22–27 job-minutes per CI run across the ten ecosystem matrix legs, with docker paths more likely to appear in merged coverage.Reviewed by Cursor Bugbot for commit 4e07334. Configure here.
Generated by Claude Code