Repository navigation
ci: share Rust caches across runner images - #3520
Merged
kevinjqliu merged 2 commits intoOct 26, 2026
Merged
kevinjqliu merged 2 commits into
kevinjqliu merged 2 commits 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
blackmwk
approved these changes
Oct 26, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 26, 2026
Contributor
Author
|
rejected by merge queue due to teh asf-allowlist-check, |
kevinjqliu
enabled auto-merge
October 26, 2026 17:41
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
What changed in this PR
Updates the composite CI action to improve rust-cache hit rates by avoiding cache key divergence caused by runner-preinstalled stable toolchain versions.
Changes:
- Uninstalls the
stabletoolchain when usingrust-toolchain.tomlso caches are keyed only by the toolchain the repo actually uses. - Adds inline rationale explaining why
stableis removed (runner image variance and cache key splitting).
| File | Description |
|---|---|
| .github/actions/setup-builder/action.yml | Removes stable toolchain to keep rust-cache keys consistent across runner images. |
Review effort: Lite
Comment on lines
44
to
+46
| rustup component add rustfmt clippy | ||
| # Unused, and its version varies by runner image, which splits rust-cache keys. | ||
| rustup toolchain uninstall stable |
Copilot stopped reviewing on behalf of
kevinjqliu due to an error
October 26, 2026 18:11
kevinjqliu
deleted the
kevinjqliu-public-api-check-without-cargo-install
branch
October 26, 2026 18:33
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.