fix(ci): add lockfile-aware stale cache purge on ARM runners#112
Merged
Conversation
Self-hosted ARM runners keep target/ between runs. When Dependabot merges bump dependencies, stale .d dep-info files reference old crate hashes that no longer exist, causing cargo check/clippy/test to fail with "could not parse/generate dep info — No such file or directory." Add a purge step to all ARM jobs (check, clippy, test, integration-test) that detects Cargo.lock changes via sha256 hash comparison and selectively purges dep-info files, build script outputs, and fingerprints. Only triggers when deps actually changed — no-op on normal runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The conditional lock-hash approach had a race: when multiple jobs share the same ARM runner, the first job updates the hash, and subsequent jobs skip the purge — but Swatinem/rust-cache may have restored stale state. Also, the dep-info purge alone isn't enough: registry source files (~/.cargo/registry/src/) can also be stale, causing aws-lc-sys build failures when cc-rs can't find .c source files. Fix: make purge unconditional and add registry source purge + cargo fetch. The overhead is ~3s per job (fast when .crate tarballs cached). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ve delete v2 approach (delete dep-info + registry/src + cargo fetch) was wrong: cargo fetch only downloads .crate archives, doesn't extract to registry/src/. This left aws-lc-sys assembly source files missing, causing cc1 fatal errors. The correct fix: just nuke target/ entirely. Stale dep-info files live in target/debug/deps/, and build script artifacts in target/debug/build/. Deleting the whole dir forces a clean rebuild without touching registry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ARGO_HOME race Concurrent ARM jobs (check/clippy/test) race on shared ~/.cargo/registry when extracting crates, causing 'could not compile futures-core' in integration-test. Adding needs:[check,clippy,fmt,test] ensures integration-test runs after all compile jobs finish, eliminating the race condition. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Contributor
Author
|
🤖 [Agent: CTO] Code Review: APPROVED Classification: Review:
Merging. |
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
.ddep-info files after Dependabot dependency bumpsPurge stale dep-info on lockfile changestep to all ARM jobs (check, clippy, test, integration-test)Context
Self-hosted ARM runners keep
target/between runs. When Dependabot merges bump dependencies, stale.ddep-info files reference old crate hashes (e.g.,rustls_pki_types-af1243aa.d) that no longer exist.Affected runs:
Test plan
🤖 Generated with Claude Code