Repository navigation
ci: restore rust-cache's lockfile hash, strip stray toolchains instead - #789
Merged
Merged
Conversation
#785 set add-rust-environment-hash-key: false to stop the runner image's preinstalled toolchains splitting each cache key. That option also drops the lockfile hash, so every key became static (v0-rust-<job>-<os>-<arch>): it hits exactly forever, is never re-saved, and a Cargo.lock or rust-toolchain.toml bump never refreshes it. Keep rust-cache's default hashing and remove the split at its source: a step before each cache uninstalls every toolchain except the rust-toolchain.toml channel, so `rustup toolchain list` shows only the pin. A lockfile bump again makes a new key that falls back to the old cache. ebpf-build keeps its own nightly and is left alone.
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.
Fixes a mistake in #785.
The problem
#785 set
add-rust-environment-hash-key: falseso the runner image's preinstalled toolchains (some images ship Rust 1.99.0 next to our 1.98.1) would stop splitting each cache key. In rust-cache v2.9.2 that option gates both the toolchain hash and the lockfile hash (src/config.tslines 129 and 156). Every key is now static, for examplev0-rust-test-linux-Linux-x64on run 38778998481, so:Cargo.lock, manifest orrust-toolchain.tomlbump never refreshes it, so builds would drift colder with every dependency or toolchain update.#785's description said a toolchain bump still changes the key. That was wrong.
The fix
Keep only the pinned toolchainstep before each cache uninstalls every toolchain except therust-toolchain.tomlchannel, sorustup toolchain listshows only the pin. Tested locally against Windows\routput, the nothing-to-remove case and an extra1.99.0.ebpf-buildis unchanged: it needs its pinned nightly and already used the default hashing.save-ifmain-only and the per-kernelebpf-loadkey from ci: stop rust-cache misses from runner image rollouts #785/ci: shorten the PR critical path #786 stay.Expected
Keys change once more, so the first main run after merge is cold and every later run is warm. A lockfile bump then gets a new key with a fallback to the previous cache.
zizmor --offlineis clean.