-
-
Notifications
You must be signed in to change notification settings - Fork 759
feat(ci): use full match only to find self-hosted build caches #10724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
986b81d
to
2932b47
Compare
CodSpeed Performance ReportMerging #10724 will not alter performanceComparing 🎉 Hooray!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the self-hosted Cargo cache behavior to only use full-match restores and bumps the cache version.
- Upgrades
rust-cache
action to v0.0.2 - Increments
prefix-key
toRCache-L-3
- Enables a new
fullmatch-only
option in the cache step
Comments suppressed due to low confidence (4)
.github/actions/rustup/cargo/action.yml:25
- [nitpick] Consider using a semantically versioned tag (e.g.,
v0.0.2
) instead of a raw commit SHA to make future upgrades clearer and easier to track.
uses: stormslowly/rust-cache@8269079380bc35105b3ed8b0f1f7c9557c6dec93 # v0.0.2
.github/actions/rustup/cargo/action.yml:31
- [nitpick] YAML supports unquoted booleans—consider removing the quotes around
true
so it’s parsed as a native boolean.
fullmatch-only: "true"
.github/actions/rustup/cargo/action.yml:28
- Update any relevant documentation (e.g., README or changelog) to reflect the new
RCache-L-3
prefix-key and thefullmatch-only
option.
prefix-key: "RCache-L-3"
.github/actions/rustup/cargo/action.yml:31
- Add or update tests to cover the
fullmatch-only
behavior in the cache restore logic to prevent future regressions.
fullmatch-only: "true"
Summary
I found that we have encoutered many large cache files in self hosted buildings.
Example:
3G sized Cache wastes time to restor and save in CI.
How does the large Cache file Come
The Cargo Cache restore is ussing full match then restore key match two steps.
Cache-rustool-k1-cargo-toml-key2
Cache-rustool-k1-cargo-toml-key9
, but the full match key related cache doesn't exist; so this build will try to find cache with its restore key which isCache-rustool-k1-
, if any cache key starts with that, it hits.2.1 So build A uses cache
Cache-rustool-k1-cargo-toml-key2
restores to local, and then generate its cache files and mixed with orginal cache file, then zip and save the new cache with keyCache-rustool-k1-cargo-toml-key9
. And its size is inflated.if step 2 repeats serveral time, the cache will be very large , eg 3G.
How to fix
In self hosted build, we only support full match cache; if no full match find, just build without cache then generate the new cache.
Related links
Checklist