Repository navigation
ci: share Rust caches across runner images - #3520
Open
kevinjqliu wants to merge 1 commit into
Open
kevinjqliu wants to merge 1 commit into
kevinjqliu wants to merge 1 commit into
Conversation
rust-cache hashes every installed toolchain into its key. Runner images roll out with different preinstalled stable versions (1.99.0 vs 1.99.1), which splits each job's cache into two keys that miss each other and duplicate ~2.8GB of cache storage. Jobs using rust-toolchain.toml never use stable, so setup-builder removes it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kevinjqliu
marked this pull request as ready for review
October 24, 2026 04:25
kevinjqliu
requested review from
CTTY and
blackmwk
and
a balanced review from Copilot
and removed request for
Copilot
October 24, 2026 04:25
Contributor
Author
|
this should improve cache hits and make ci faster |
Copilot stopped reviewing on behalf of
kevinjqliu due to an error
October 24, 2026 04:26
This branch has not been deployed
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.
Which issue does this PR close?
What changes are included in this PR?
rust-cachehashes every installed toolchain into its cache key, including the runner's preinstalled stable. We build with the nightly inrust-toolchain.tomland never use stable. But runner images roll out with different stable versions (1.99.0 vs 1.99.1 this week, on Linux, macOS and Windows), so each job ends up with 2 cache keys that can't restore from each other.What that looks like over ~45 recent runs per workflow:
buildmissed 4/4, Windows bindings 7/10,check-public-api64% vs 37%.check-public-apithat's ~6 min vs ~1 min.Remove stable in
setup-builderwhen it usesrust-toolchain.toml. Jobs that passrust-version(audit, MSRV, publish, Python release) are unchanged.rust-toolchain.tomlis still part of the key, so a nightly bump still invalidates the cache.Apache Iggy does the same in its setup action.
Are these changes tested?
CI only.
actionlintandzizmor --offlineshow no new findings. Checked locally thatrustup toolchain uninstall stableexits 0 when stable is the default toolchain and when it's not installed. The hit rate only shows after this lands onmainand the caches are re-saved.AI Disclosure
Prepared with Copilot, including pulling the cache hit/miss numbers from run logs. Worth a look: that nothing in these jobs calls
cargo +stableor relies on stable being installed.