CI: cache Cargo with rust-cache, saved from main only #274
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!274
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@sombraSoft on GitHub · 2026-11-23 22:16 UTC · original
sombraSoft:ci/rust-cache→main· +4 −8 · 1 files · 1 commits · openThe 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
@DavidM1911 on GitHub · 2026-11-25 15:14 UTC · original
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!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.