Skip to content

fix(ci-tooling): force cargo clean when rustc toolchain changed#325

Merged
githubrobbi merged 2 commits into
mainfrom
fix/ci-clean-on-toolchain-change
Jun 1, 2026
Merged

fix(ci-tooling): force cargo clean when rustc toolchain changed#325
githubrobbi merged 2 commits into
mainfrom
fix/ci-clean-on-toolchain-change

Conversation

@githubrobbi
Copy link
Copy Markdown
Collaborator

Summary

Fixes an E0514 build failure in the ship pipeline: step 00-toolchain-ensure can bump the pinned nightly, but 02-clean-artifacts only cleaned on disk-pressure heuristics — so a fresh nightly reused a target dir built by the previous rustc, whose version-specific cross-crate metadata made every build fail with "found crate compiled by a different version of rustc".

Fix

  • Fingerprint the toolchain. context::active_rustc_id captures rustc -vV; the clean step stores it under CARGO_TARGET_DIR/.uffs-ci-rustc-fingerprint and forces cargo clean when the active toolchain differs from the one that built the cache (before any build step), then re-records it.
  • Preserves disk-pressure auto-clean and --clean/--no-clean. --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 function (7 tests).

All 7 decide_clean tests pass; clippy clean; full lint-pre-push green. Rebased onto current main.

🤖 Generated with Claude Code

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).
@githubrobbi githubrobbi enabled auto-merge (squash) June 1, 2026 02:16
@githubrobbi githubrobbi merged commit bb4ac62 into main Jun 1, 2026
27 checks passed
@githubrobbi githubrobbi deleted the fix/ci-clean-on-toolchain-change branch June 1, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant