fix(release): the shipped builder's Rust cache is keyed by Cargo.toml too, so a profile change compiles warm again #2609

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/release-rust-cache-key into main 2026-11-26 15:22:32 +00:00
Owner

Summary

The release jobs' Rust cache for the shipped builder (release-rust-target-…) was keyed only by scripts/renhdrum.py and Cargo.lock. #2597 changed [profile.dist] in Cargo.toml without changing the key. So every nightly since then:

  • restored the entry compiled with the old profile, an exact hit;
  • had cargo compile every crate again, because the profile differs: 14.4 and 13.2–15.2 min in nightly-833 and nightly-834, instead of the warm ~7;
  • saved nothing, because the restore was an exact hit.

Cargo.toml is now in the key and in its restore prefix, in both build workflows. An entry compiled with another profile is never restored, and the first run after a profile change saves a new one. ci.md and tests/test_release_workflow.py follow.

Testing

Tested: tests/test_release_workflow.py passes (through the job queue). Diagnosed from runs 54970 and 55028: both restored …-a44827dc…, the pre-#2597 key, then recompiled libc, serde, syn and the rest.

Still to test: by hand, from the release runs: the first nightly after merge compiles cold once and saves the new entry; the one after compiles warm.

Measurements

Expected: the builder compile drops from about 15 min to the warm ~7 min (or less) per job, from the second nightly after merge.

Risks

None beyond one cold compile. Revert to undo.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (the check this touches)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec

## Summary The release jobs' Rust cache for the shipped builder (`release-rust-target-…`) was keyed only by `scripts/renhdrum.py` and `Cargo.lock`. [#2597](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2597) changed `[profile.dist]` in `Cargo.toml` without changing the key. So every nightly since then: - restored the entry compiled with the old profile, an exact hit; - had cargo compile every crate again, because the profile differs: 14.4 and 13.2–15.2 min in nightly-833 and nightly-834, instead of the warm ~7; - saved nothing, because the restore was an exact hit. `Cargo.toml` is now in the key and in its restore prefix, in both build workflows. An entry compiled with another profile is never restored, and the first run after a profile change saves a new one. `ci.md` and `tests/test_release_workflow.py` follow. ## Testing **Tested:** `tests/test_release_workflow.py` passes (through the job queue). Diagnosed from runs 54970 and 55028: both restored `…-a44827dc…`, the pre-#2597 key, then recompiled `libc`, `serde`, `syn` and the rest. **Still to test:** by hand, from the release runs: the first nightly after merge compiles cold once and saves the new entry; the one after compiles warm. ## Measurements Expected: the builder compile drops from about 15 min to the warm ~7 min (or less) per job, from the second nightly after merge. ## Risks None beyond one cold compile. Revert to undo. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). (the check this touches) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec
fix(release): the shipped builder's Rust cache is keyed by Cargo.toml too, so a profile change compiles warm again
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Successful in 19s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been skipped
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been skipped
CI / Third-party parts and guide screenshots (pull_request) Successful in 31s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 38s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m2s
CI / Website build and checks (pull_request) Successful in 2m33s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 6m43s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Successful in 7m2s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 11m39s
58a5d55f3b
The release-rust-target key was renhdrum.py's and Cargo.lock's hashes: #2597's [profile.dist] change kept the key,
so each nightly since restored the entry compiled with the old profile (an exact hit: nothing saved) and cargo
compiled every crate again (14-15 minutes, nightly-833 and 834). Cargo.toml, where the profiles are, is now in the
key and its restore prefix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec
HumanBean deleted branch fix/release-rust-cache-key 2026-11-26 15:22:32 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2609
No description provided.