fix(ci-tooling): force cargo clean when rustc toolchain changed#325
Merged
Conversation
Step 00-toolchain-ensure can bump the pinned nightly, but step 02-clean-artifacts only cleaned on disk-pressure heuristics. A fresh nightly then reused a target dir built by the previous rustc, whose version-specific cross-crate metadata makes every build fail with E0514. The clean step now fingerprints the toolchain: context::active_rustc_id captures 'rustc -vV', stored under CARGO_TARGET_DIR/.uffs-ci-rustc-fingerprint. On each run it forces a cargo clean when the active toolchain differs from the one that built the cache, then re-records the fingerprint. Disk-pressure auto-clean and --clean/--no-clean are preserved; --no-clean downgrades a needed toolchain clean to a warning and keeps the stale fingerprint for next-run re-detection. Clean policy extracted into a pure, unit-tested decide_clean fn (7 tests).
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.
Summary
Fixes an
E0514build failure in the ship pipeline: step00-toolchain-ensurecan bump the pinned nightly, but02-clean-artifactsonly cleaned on disk-pressure heuristics — so a fresh nightly reused atargetdir built by the previousrustc, whose version-specific cross-crate metadata made every build fail with "found crate compiled by a different version of rustc".Fix
context::active_rustc_idcapturesrustc -vV; the clean step stores it underCARGO_TARGET_DIR/.uffs-ci-rustc-fingerprintand forcescargo cleanwhen the active toolchain differs from the one that built the cache (before any build step), then re-records it.--clean/--no-clean.--no-cleandowngrades a needed toolchain-clean to a warning and keeps the stale fingerprint for next-run re-detection.decide_cleanfunction (7 tests).All 7
decide_cleantests pass; clippy clean; fulllint-pre-pushgreen. Rebased onto currentmain.🤖 Generated with Claude Code