ci: cache rustc with sccache on compile-heavy jobs - #71
Closed
rominf wants to merge 1 commit into
Closed
Conversation
The build dominates CI time: on Windows the workspace build is ~560s, far more than the ~150s test step, and a full cache hit from rust-cache does not help it. rust-cache restores the registry and dependency artifacts but deliberately does not cache workspace crates, so all 15 crates and their targets recompile from scratch every run. Add sccache as a RUSTC_WRAPPER on build-and-test, windows-build-and-test, and clippy, backed by the GitHub Actions cache. sccache keys each rustc invocation on its source, dependencies, and flags, so unchanged crates are restored instead of recompiled across runs and branches. It layers on top of rust-cache (registry/deps) rather than replacing it; CARGO_INCREMENTAL is already 0, which sccache requires. A `sccache --show-stats` step reports the hit rate. Coverage is left out (instrumented builds). The action is pinned to a commit SHA. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Member
|
Superseded by #125, rebuilt from current The replacement preserves the original sccache intent while retaining current affected-crate CI, merge-queue checks, signing gates, and E2E/reporting workflows. It remains draft until GitHub Actions provides a cold/warm cache comparison and hit-rate evidence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI time is dominated by compilation, not tests. On the Windows job the workspace build is ~560s versus ~150s for the test step, and it pays that even on a full cache hit:
rust-cacherestores the registry and dependency artifacts but deliberately does not cache workspace crates, so all 15 crates and their targets recompile from scratch every run.Change
Add
sccacheas aRUSTC_WRAPPERon the compile-heavy jobs (build-and-test,windows-build-and-test,clippy), backed by the GitHub Actions cache. sccache keys eachrustcinvocation on its source, dependencies, and flags, so unchanged crates are restored instead of recompiled across runs and branches. It layers on top ofrust-cache(which still handles the registry/deps) rather than replacing it.CARGO_INCREMENTAL=0is already set, which sccache requires. Coverage is left out (instrumented builds). The action is pinned to a commit SHA.A
sccache --show-statsstep reports the hit rate so the effect is visible in the logs.Status: draft — measuring
This is an experiment to validate the win before merging. sccache helps on the second run (the first populates the cache), and the GitHub Actions cache backend has real limits (10 GB/repo shared with rust-cache, per-request chattiness). I'll post the cold-vs-warm build-time delta and hit rate from two runs, then mark ready only if the numbers justify it.
This is independent of the affected-test-selection work (#70).