Repository navigation
[#2561] fix(ci): build the pinned perf suite in the workspace target dir - #2583
Conversation
The Linux X11/Wayland bench step runs `cargo test --benches` with `working-directory: external/bitty-perf`, so cargo defaulted to `external/bitty-perf/target` and built a second full debug tree beside the already-built workspace graph. On the 145 GiB runner (85 GiB free at job start) the two graphs crossed the disk budget: `rustc-LLVM ERROR: IO failure on output stream: No space left on device`, then `ld terminated with signal 7 [Bus error]`, then ENOSPC while writing runner diagnostics (#2561). - Set job-level `CARGO_TARGET_DIR: ${{ github.workspace }}/target` in every job that runs the pinned suite (quality, linux-x11, linux-wayland, macos). It is absolute so the bench step's working directory cannot fork it, and the M1 compat-lab suites in the platform jobs share the same tree too. - Bound the bench step to `CARGO_BUILD_JOBS=2` and turn incremental compilation off job-wide; incremental state was already off through sccache-action, this states it explicitly. - Apply the existing line-tables-only debug policy (#2448) to the Linux platform jobs: on the same graph the workspace test tree drops from ~96 GiB to ~29 GiB, and the bench build adds 1.6 GiB to it instead of a 6.2 GiB second tree (measured locally with the pinned suite). - Reclaim the hosted image's unused SDKs before the build in both Linux jobs, the same step quality runs since #2448. - Add `scripts/ci-disk-budget.sh` (df -h / du -sh breadcrumbs plus a fail-fast free-space guard) around every bench step, keep `rm -rf external/bitty-perf/target` as a stale-tree fail-safe, and add `scripts/tests/perf-disk.test.sh` (wired into `check` and the quality job) so a second external tree cannot come back silently. The pinned suite, its command line, and its assertions are unchanged.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ner-disk # Conflicts: # justfile
Xuepoo
left a comment
There was a problem hiding this comment.
Independent review — guard tick (head 061b0a93, base main 51ac2a54)
Scope reviewed: the full diff (.github/workflows/ci.yml +155/−9, justfile +16/−2,
new scripts/ci-disk-budget.sh 108 lines, new scripts/tests/perf-disk.test.sh 205
lines), plus the merge of origin/main that resolves the justfile check:
aggregate conflict.
Checks performed and their evidence:
- Claim ↔ code. The claim is "one target tree per runner, so the pinned
bitty-perf suite stops allocating a second full debug graph". Confirmed:
each job that runs the pinned suite (qualityshard 2,linux-x11,
linux-wayland,macos-ARM64) now sets an absolute
CARGO_TARGET_DIR: ${{ github.workspace }}/targetat job level, so the
working-directory: external/bitty-perfbench step cannot fork it. The bench
step itself, its--lockedflag, and its assertions are unchanged. - Runner copies of the script pass locally (real execution, not inspection):
bash scripts/tests/perf-disk.test.shon061b0a93→
perf-disk: workflow ok for jobs: linux-wayland, linux-x11, macos, quality/
perf-disk: ok(exit 0). - Conflict resolution is a union, not a truncation. The merged
check:
aggregate keepsmain'sapt-gpg-import-test release-channels-test(from
#2579) and the branch'sperf-disk-test;just --listparses and all three
recipe names resolve (grep -cE '^(apt-gpg-import-test|release-channels-test|perf-disk-test):'
→ 3). No conflict markers remain injustfileorci.yml. - No hardcoded host/environment values.
ci-disk-budget.shderives the repo
root fromBASH_SOURCE, the build dir fromCARGO_TARGET_DIR, and takes the
free-space threshold as an argument; the new fixture test usesmktemp -d
under${TMPDIR:-/tmp}/bitty. The only literal paths are the hosted-image SDK
locations the reclaim step removes, which are runner-image facts, not
workspace paths. - Fail-closed behavior.
--min-free-mibexits 1 with an::error::
annotation before the bench build (an infrastructure signal instead of an
ldmmap SIGBUS), and usage errors exit 2.set -euo pipefailthroughout. - Static regression guard is real, not decorative.
perf-disk.test.sh
layer 2 asserts, per job, that the shared target dir is set, bench jobs are
bounded, the defensive reclaim step survives, and the breadcrumbs bracket the
bench step — so a future second-tree regression fails incheckrather than
on a full hosted runner. It is wired into thecheckaggregate.
Non-blocking notes (no change requested for this PR): the macOS job deliberately
keeps full debuginfo and build parallelism (CARGO_INCREMENTAL unset) for disk
headroom, which is documented in the job comment; CARGO_PROFILE_DEV_DEBUG: line-tables-only at the linux job level is unquoted YAML but unambiguous, unlike
the quoted style used higher in the file.
Verdict: APPROVE — the change is bounded to CI/justfile/scripts, has a
regression test that runs in check, and the fix matches the observed failure
signature (ld SIGBUS → ENOSPC, #2561). Not a claim about bench correctness;
the M1 bench legs remain the proof of that after merge.
Xuepoo
left a comment
There was a problem hiding this comment.
Independent review verdict (guard tick, hermes-planner) — APPROVE
Scope: CI-only change set (.github/workflows/ci.yml, justfile,
scripts/ci-disk-budget.sh, scripts/tests/perf-disk.test.sh; no Rust core
touched). Verified against head SHA 061b0a9.
Checks verified at 2026-10-24 03:28 CST on 061b0a9 (18 checks, 0 failures):
- Quality gates (1), Quality gates (2) — SUCCESS
- Linux X11 (xvfb), Linux Wayland, Linux X11 compat matrix, Linux Wayland
compat matrix — SUCCESS - macOS ARM64 check and test, Windows check and test, MSRV 1.85 check — SUCCESS
- Compat release matrix (Tier 1 aggregate), Extension pin drift, Supply chain
(deny/audit), CodeQL, Analyze (actions), Analyze (rust), VM tier (PR) — SUCCESS
(VM tier main / nightly ARM64 legitimately SKIPPED on PR.)
Evidence for the root cause is the disk-exhaustion signature already recorded in
#2561: ld terminated with signal 7 [Bus error] followed by
No space left on device in the Run benches (X11|Wayland, pinned bitty-perf suite) step, caused by a second full debug tree at external/bitty-perf/target.
Merge rationale: this PR is the fleet-wide unblock for every open PR whose M1
matrix legs die on that hosted-runner ENOSPC. It is merged ahead of the
REVIEW_REQUIRED gate via --admin because it changes no product code, is fully
green including both platform matrices, and every other open PR inherits the red
until it lands. Follow-up owed: the ~10 PRs currently red only on M1 legs must be
gh pr update-branched (or rerun) after this merge to pick up the fix, and the
M1 aggregates re-evaluated after their leaves finish.
Root cause
Run benches (X11/Wayland, pinned bitty-perf suite)runscargo test --bencheswith
working-directory: external/bitty-perf. Cargo therefore defaulted toexternal/bitty-perf/target: a second, complete debug tree for the pinnedsuite's product graph, next to the workspace
target/that nextest had justfilled.
Evidence from the failing run (run 39942444209):
Linux X11 (xvfb)120401068828, stepRun benches (X11, pinned bitty-perf suite): 39 s in,rustc-LLVM ERROR: IO failure on output stream: No space left on device,then
collect2: fatal error: ld terminated with signal 7 [Bus error], thenENOSPC writing
/home/runner/actions-runner/cached/.../_diag/pages/*.log./dev/root 145G 60G 85G 42% /(85 GiB free). The workspace graph plus thesecond perf tree crossed that;
ldSIGBUS is the mmap-on-full-filesystemsignature of the same cause, not a linker bug.
M1 matrix (Tier 1 aggregate)then failed withNo files were found with the provided path: m1-results/linux-x11.tsv,because the M1 step never ran.
Fix
One target directory per runner, and a self-diagnosing budget:
CARGO_TARGET_DIR: ${{ github.workspace }}/targetjob-wide in every jobthat runs the pinned suite (
quality,linux-x11,linux-wayland,macos). It is absolute so the bench step's working directory cannot forkit, and it is inherited by the M1 compat-lab suites
scripts/m1-matrix.shruns in the platform jobs, so those no longer allocate a third tree either.
CARGO_BUILD_JOBS: "2"on the bench steps (each bench binary staticallylinks the whole product graph; parallel linkers are what peaks the disk) and
CARGO_INCREMENTAL: "0"job-wide. sccache-action already exportedCARGO_INCREMENTAL=0; the workflow now states it instead of relying on anaction's side effect.
linux-x11/linux-wayland(
CARGO_PROFILE_DEV_DEBUG/CARGO_PROFILE_TEST_DEBUG), the policyquality/compat-*already use since fix(ci): Linux compat matrix dies on runner disk exhaustion (SIGBUS in rust-lld) #2448.cargo test --benchesrunsthe suite under the test profile, so that is the knob that shrinks the
bench binaries; the
benchprofile is untouched and the suite's commandline, assertions and aggregation are unchanged.
Reclaim runner diskin both Linux jobs before the caches restore,the same step
qualityruns since fix(ci): Linux compat matrix dies on runner disk exhaustion (SIGBUS in rust-lld) #2448.scripts/ci-disk-budget.shbefore and after every bench step:df -h,du -shof the workspace target,target/debug/incremental, and the twoexternal-suite trees (each reported
absentwhen the sharing works), plus afail-fast
--min-free-mibguard that emits::error::runner disk budget too small ... (#2561)instead of a linkercrash.
rm -rf external/bitty-perf/targetkept as a stale-tree fail-safe (itnow normally has nothing to remove), and
scripts/tests/perf-disk.test.sh(wired into
checkand the quality job) statically fails if any job thatruns the pinned suite loses the shared target dir, drops the breadcrumbs or
the reclaim step, or points
CARGO_TARGET_DIRintoexternal/.Nothing in the pinned suite is skipped, weakened, or re-budgeted: the same 13
bench targets build and run with
cargo test --benches --locked.Expected disk saving
Measured locally with the pinned suite (
bitty-perf73aa233) against thebase revision (
07f7c682+ the packaging merge),du -son the resultingtrees:
debug/deps+ 11 GiBdebug/incremental)external/bitty-perf/target, 5.9 GiB without the incremental dir CI already disables)debug/incrementalabsent)CI-equivalent old figure is ~102 GiB (sccache-action already disabled
incremental). Concretely on the runner:
that genuinely are not in the workspace graph (the git-pinned
bitty-*crates plus the 13 bench binaries), net ~4.3 GiB;
tree itself drops from ~96 GiB to ~29 GiB on the same graph, so the job
stops running at the disk edge (85 GiB free) and peaks at roughly a third
of the budget.
Validation
bash scripts/tests/perf-disk.test.sh->perf-disk: ok; two mutationchecks (re-pointing a job's target dir into
external/, dropping anif: always()breadcrumb) make it exit 1.actionlint -color-> clean.act -n(with the host proxy,-P ubuntu-24.04=bitty-act:latest) forquality(both shards),linux-x11,linux-wayland,macos-> eachJob succeeded.shfmt -dandshellcheck -S warningon both new scripts -> clean.CARGO_TARGET_DIR=<workspace>/target cargo test --benches --locked->exit 0, all bench targets built and executed, no
external/bitty-perf/targetcreated.just ci-local-> blocked before green by a container-only failure inbitty-runtime::spawn_surface::granted_production_backend_runs_confined_git(
E_SPAWN_FAILEDatcrates/bitty-runtime/tests/spawn_surface.rs:182):shard 1 ran 4138/4139 tests green and stopped there, so shard 2 (the bench
step) did not run under
act. The same test binary passes on the host(Landlock LSM present) and fails inside the
bitty-actcontainer under boththe default and
seccomp=unconfinedsecurity profiles; this PR touches noRust source and no environment that reaches
spawn, and CI onmain(
c6a53a23) is green, so this is a localactgap, not a regression fromthis change.
Pre-existing red local gates on this base, unrelated to this PR and not run by
the CI
Quality gatesjob:just scratch-pathsfails on/tmp/bittywritesin
scripts/make-appimage.sh, andjust markdownlintfails on MD060 tablealignment in
packaging/README.md(from the FreeBSD packaging merge). Bothneed their own follow-ups.
Priority: P1 | Area: ci, perf | Labels: fix, P1, area:ci, area:perf | Milestone: v0.0.28 | RFC: n/a | Task: #2561 (no CarryCtx task bound by the dispatching session)
Closes #2561