Repository navigation
fork-ci: one cargo invocation per step; Cargo.lock selects only affected packages - #23
Conversation
…ted packages Per-crate loops re-resolved features and rebuilt shared dependencies once per crate, which left a 30-vCPU runner mostly idle. fmt, clippy and nextest now take every selected package in a single invocation, and the clippy JSON stream is split back per crate so the changed-file gate is unchanged. A Cargo.lock-only change no longer rebuilds the whole workspace: the resolve graphs of the base and HEAD locks are compared and only members whose reachable dependency set moved are selected.
|
Blockers (head c86cbfb) Epic lead. Checked as asked:
Two blockers, both of which fail open.
Non-blocking:
|
The lock diff walked packages[].dependencies, which cargo metadata never puts package ids on, so a lock-only bump selected nothing. Walk resolve.nodes[].deps instead, and match declared path deps by name for the --no-deps reverse closure. If a Cargo.lock change still selects nothing, select every member rather than skip the checks. The clippy gate split the JSON per crate and never read the unattributed bucket, which is where every lint from a crate whose package id omits its name (codex-home and five others) landed. Gate the whole stream once, by changed file path.
|
Fixed both blockers at e7817b0. Blocker 1 — the lock diff and reverse closure selected nothing.
Blocker 2 — the clippy gate dropped six crates. Tests: a lock-only serde bump selects |
|
no blockers (head e7817b0) Epic lead. Both blockers from c86cbfb are resolved.
Verified locally: Still as reviewed before: test selection is unchanged (one Non-blocking, for a follow-up: |
What
fork-cirancargo clippy -p,cargo nextest run -pandcargo fmt -ponce per crate, and treated anycodex-rs/Cargo.lockchange as every package. On the 30-vCPU rust-heavy runner that was ~160 serial cargo invocations, each re-resolving features, with the CPU 3–13% busy.Change 1 — one invocation per step
fmt, clippy and nextest now take every selected package as repeated
-pflags in a single invocation. Clippy still emits JSON and the changed-file gate is unchanged: the one JSON stream is split back into per-crate files bypackage_idafterwards.--no-fail-fast, the known-failures filterset, the upstream nextest profile and the workspace-bins build (becausecargo test -pwill not build another package'scargo_bin()) are all kept. Test selection is otherwise unchanged.Change 2 — Cargo.lock selects only what moved
A lock-only change now diffs
cargo metadata --format-version 1resolve graphs between the base lock and HEAD, and selects only workspace members whose reachable dependency set differs. A workspaceCargo.tomlchange still selects everything; a member manifest selects that member plus its workspace reverse-dependencies. Covered by.github/scripts/test_fork_changed_packages.py.Change 3 — CI-scoped build settings (job env only, not Cargo.toml)
CARGO_PROFILE_DEV_DEBUG=line-tables-onlyandCARGO_PROFILE_TEST_DEBUG=line-tables-only— keeps file/line in backtraces, which tests read, and drops variable debuginfo.CARGO_INCREMENTAL=0— CI builds each crate version once.x86_64-unknown-linux-gnualready links with its bundled rust-lld, so-fuse-ld=lldwould switch to a different linker for no gain. Nightly-only options (-Zthreads, cranelift) are skipped.--timingson clippy and nextest, uploaded as thecargo-timingsartifact.Timings
Same runner class (self-hosted
rust-heavy, 30 vCPU) for both.codex-core,codex-tui,codex-app-server)What each change is worth
cargo clippy -p a -p b -p cshares that work. fmt drops for the same reason (39s → 10s).cargo check, which was already a single invocation before this PR: 2m 34s → 1m 41s, about a third off, with no other change to that step. The same settings apply to clippy and the test build, so part of the clippy drop belongs here too, but it cannot be separated from change 1 in this run.Cargo.lock; it saves a future lock-only PR from rebuilding the whole workspace. The pull_request run on this PR (38047945544) selected no packages and finished in 7m 23s, almost all of it the unconditionalcargo check.Head:
c86cbfb2e7c4ebfe11691a77b4b8abcce3f12015.