CI: cache Cargo with rust-cache, saved from main only #271
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/274"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by sombraSoft on 2026-11-23T22:16:54Z.
The Cargo cache key holds only the
Cargo.lock/Cargo.tomlhashes, not the rustc version. CI installs floating stable, so after each stable release the restored dependencies no longer match and are rebuilt on every run untilCargo.lockchanges. An exact key hit never saves again, so the cache never catches up. And every PR that changes aCargo.tomlsaves its own ~284 MB cache, which churns the 10 GB repository limit when there are dozens of PRs a day.Part of #265
What is in it
.github/workflows/ci.yml:actions/cache@v4is replaced bySwatinem/rust-cache@v2. It runs after the toolchain step, so its key includes the installed rustc (as well asCargo.lock/Cargo.tomland theCARGO*/RUST*env), and it keeps only dependency artifacts. Withsave-if: ${{ github.ref == 'refs/heads/main' }}, onlymainsaves; PRs restoremain's cache and write none. Floating stable andCARGO_INCREMENTAL=0are unchanged.CI time
mainbuilds the dependencies again and later runs reuse them; today they rebuild on every run untilCargo.lockchanges.Tested
v0-rust-windows-Windows_NT-x64-1ffb72bd-aedbd39eincludes rustc 1.100.0. On the PRsave-ifwas false, and nov0-rust-*cache was written (checked the fork's cache list afterwards). The run was cold because the fork had no cache: Build and test took 2m27s.main(9ab7d76), RTX 3060 Ti (driver 621.24), Ryzen 9 5900X, Windows 11, rustc 1.97.1, debug:scripts/test.ps1→ 651 passed, 0 failed, 40 ignored; SKIPPED: 2 (no wave64). This PR changes only CI config, so the compiled code is the same.Regression run
crates/xcl/srcchange.Not tested
main, and a PR restoringmain's cache: only observable after merge.cargo-Windows-*entries are no longer used; GitHub evicts them after 7 days without access.AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T15:14:13Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:42:45Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:02:44Z.
Triage (#1607) – head
bf06178No open or merged PR makes the same change. #286 bumps the same
actions/cachestep to v6 instead of replacing it, so whichever merges second has to drop or rebase its change of that step; #277 uses the sameSwatinem/rust-cache@v2withsave-ifon main only for its clippy job, consistent with this one.No problems found in the diff; main's
ci.ymlstill usesactions/cache@v4with a key that ignores the rustc version.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Pull request closed