Repository navigation
ci: start a fresh dependency cache per profile and month - #12957
Merged
Merged
Conversation
Contributor
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.
Failure
The Rust dependency caches have grown from 1.3–1.5 GB to about 2.9 GB per platform in a day. Before saving, rust-cache keeps target artifacts by crate name only, not by version or build hash (
cleanProfileTargetat the pinned revision). When a key change restores an older cache, the new cache therefore keeps every earlier build of each crate. The two profile changes in #12905 and #12885 each rebuilt every dependency with new hashes.The larger caches slow both ends of each run. Windows setup restores for 123–210 s. When
v1saves a changed key, the WindowsBuild and testsave takes 298–433 s, and lifecycle tests wait for it. Those saves made warm runs take 850–1,095 s instead of about 600 s.Decision
Add two parts to the rust-cache prefix:
.cargo/config.toml: a profile change starts a fresh cache instead of extending the old one.Within a generation, manifest, lockfile, and toolchain-file changes still restore the previous cache and rebuild only what changed. Deleting unused artifacts before saving isn't reliable, because Cargo doesn't touch an artifact that's already fresh, so a job can't tell which files it used.
The new prefix also resets the current oversized caches: the first
v1push after merge builds each platform cold. The old entries expire unused.Validation
actionlintpasses on the workflows, and the composite action parses as YAML with the new step.cargo cipassed: 1,324 workspace tests and all 120 lifecycle tests.fern checkpasses.v1cache entries should return to about 1.3–1.5 GB per platform and stay there within the month.