Priority: P0
Depends on: #11127 (PR #11128)
Related: #9509
Motivation
The current workflow dynamically creates a 12-package matrix, then runs four stable clippy/build modes and a separate MSRV build for each package. It creates up to 24 large Rust caches and executes through four-job waves. PR #11128 already consolidates these matrix cache keys via a shared key; this issue removes most of the cells themselves.
Cargo-hack's workspace mode invokes Cargo separately for each package, so it preserves the matrix's important feature-unification isolation. The initial analysis's replacement proposal (gist) did not preserve the full command surface:
- current stable coverage has four modes, not three;
- clippy runs in every mode;
- no-default and all-feature checks use all targets;
- the MSRV matrix uses all features and all targets;
cargo build provides final code generation and linking that check/clippy do not;
- a workspace unit-test build does not replace isolated no-default/all-feature package builds.
The latency-oriented compromise is to keep isolated type/lint coverage on PRs and move isolated final-link coverage to an alerted weekly lane.
Proposed change
Stable PR job
Replace the dynamic stable matrix with one warm-target-directory job that runs these commands sequentially:
cargo hack clippy --workspace -- -D warnings
cargo hack clippy --workspace --no-default-features --all-targets -- -D warnings
cargo hack clippy --workspace --all-targets -- -D warnings
cargo hack clippy --workspace --all-features --all-targets -- -D warnings
Do not add --each-feature or feature powersets; those are stricter than existing policy and belong in a separate proposal.
MSRV PR jobs
Use two jobs because the workspace libraries and binary intentionally have different MSRVs:
# Rust 1.88
cargo hack check --workspace --exclude zebrad --all-features --all-targets
# Rust 1.91
cargo hack check --package zebrad --all-features --all-targets
Disable MSRV cache writes on PRs under #11127 (PR #11128). If measurement shows the separate MSRV caches are too large for their benefit, use cache: false rather than evicting the stable/main cache.
Weekly final-link lane
Run the equivalent four cargo hack build modes weekly, plus the two all-feature/all-target MSRV builds, with failure issue open/update/close-on-recovery behavior. This preserves the link/codegen coverage removed from PRs without keeping it on the merge path.
Remove overlap deliberately
Produce an old-to-new coverage table for:
test-crates.yml stable matrix;
test-crates.yml MSRV matrix;
lint.yml crate-checks;
lint.yml workspace clippy jobs;
lint.yml check-cargo-lock;
- the new weekly link lane.
Delete lint.yml's existing cargo hack check --workspace job only after the table shows its guarantee is present in the new stable job. Do not conflate workspace-wide default-release clippy with per-package default-feature clippy.
Acceptance criteria
Part of the Improve CI program (#11196)
Drafted with Claude Code from the comparative analysis and the reviewed plan; independently reviewed and corrected with OpenAI Codex. Maintainers remain responsible for validating measurements and approving coverage tradeoffs.
Priority: P0
Depends on: #11127 (PR #11128)
Related: #9509
Motivation
The current workflow dynamically creates a 12-package matrix, then runs four stable clippy/build modes and a separate MSRV build for each package. It creates up to 24 large Rust caches and executes through four-job waves. PR #11128 already consolidates these matrix cache keys via a shared key; this issue removes most of the cells themselves.
Cargo-hack's workspace mode invokes Cargo separately for each package, so it preserves the matrix's important feature-unification isolation. The initial analysis's replacement proposal (gist) did not preserve the full command surface:
cargo buildprovides final code generation and linking thatcheck/clippy do not;The latency-oriented compromise is to keep isolated type/lint coverage on PRs and move isolated final-link coverage to an alerted weekly lane.
Proposed change
Stable PR job
Replace the dynamic stable matrix with one warm-target-directory job that runs these commands sequentially:
Do not add
--each-featureor feature powersets; those are stricter than existing policy and belong in a separate proposal.MSRV PR jobs
Use two jobs because the workspace libraries and binary intentionally have different MSRVs:
Disable MSRV cache writes on PRs under #11127 (PR #11128). If measurement shows the separate MSRV caches are too large for their benefit, use
cache: falserather than evicting the stable/main cache.Weekly final-link lane
Run the equivalent four
cargo hack buildmodes weekly, plus the two all-feature/all-target MSRV builds, with failure issue open/update/close-on-recovery behavior. This preserves the link/codegen coverage removed from PRs without keeping it on the merge path.Remove overlap deliberately
Produce an old-to-new coverage table for:
test-crates.ymlstable matrix;test-crates.ymlMSRV matrix;lint.ymlcrate-checks;lint.ymlworkspace clippy jobs;lint.ymlcheck-cargo-lock;Delete
lint.yml's existingcargo hack check --workspacejob only after the table shows its guarantee is present in the new stable job. Do not conflate workspace-wide default-release clippy with per-package default-feature clippy.Acceptance criteria
zebrad, both with all features and all targets.Part of the Improve CI program (#11196)
Drafted with Claude Code from the comparative analysis and the reviewed plan; independently reviewed and corrected with OpenAI Codex. Maintainers remain responsible for validating measurements and approving coverage tradeoffs.