ci(desktop): bump rust-cache prefix so release-ci deps actually cache - #53
Merged
Conversation
#51 added a `release-ci` profile but never got the promised speedup: sidecar build still took ~20m on every run, including on main after merge. Root cause: Swatinem/rust-cache keys on Cargo.lock (+ rustc + cargo config), not on Cargo.toml `[profile.*]`. Adding release-ci left the key unchanged, so every run got a "full match" against the old v0 cache — which only held deps compiled under `release/`, never `release-ci/`. `cargo build --profile release-ci` therefore rebuilt the whole aws-sdk/aws-lc-sys/ring tree cold (~20m) each time, and because the key matched, the post step logged "Cache up-to-date" and saved nothing (GitHub cache keys are immutable) — so release-ci deps never persisted. Fix: bump prefix-key v0 -> v1-rust to mint a fresh key. First run misses, does the cold build once, and actually saves the release-ci deps. After that, restores hit and cargo's fingerprinting recompiles only oab-mcp itself (deps unchanged) — the "minutes" #51 was aiming for. No manual invalidation key needed, so no risk of shipping a stale sidecar when a workspace dep like studio-cp changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…f-heal
Follow-up within this PR: the prefix-key bump alone is a one-time manual
reset. Add `key: ${{ hashFiles('Cargo.toml') }}` so the profile-defining
manifest is part of the cache key — any future [profile.*] edit now
auto-mints a fresh key and busts the cache, instead of silently reusing a
stale slot (the exact trap #51 fell into). No need to hand-bump prefix-key
again.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
The problem
#51 added a
release-ciprofile to cut the sidecar build from ~23m, but it never actually got faster — its ownbundle-macosrun took 19m51s on the sidecar step (Cache hit ... full match: trueyet a full cold compile), and the post-merge run onmainis doing the same right now.Root cause
Swatinem/rust-cachekeys the cache onCargo.lock(+ rustc + cargo config), not onCargo.toml's[profile.*]sections. Verified empirically: a pre-#51 run (norelease-ciin Cargo.toml) and #51's run share the identical keyv0-rust-bundle-macos-Darwin-arm64-f9b08cb2-282619ef. So every run:full match: trueagainst the oldv0cache — which only holds deps compiled undertarget/.../release/, neverrelease-ci/.cargo build --profile release-ciwrites to a freshrelease-ci/dir → recompiles the wholeaws-sdk/aws-lc-sys/ringtree cold (~20m) every run.Cache up-to-dateand saves nothing. GitHub cache keys are immutable, so the release-ci deps are never persisted — the fast path can never arrive.The fix
prefix-keybump — one-time reset off the poisonedv0cache. First run (this PR + first main push) misses → one cold build → actually saves the release-ci deps. After that, restores hit and cargo's own fingerprinting recompiles onlyoab-mcpitself → minutes, the goal of ci(desktop): build the oab-mcp sidecar with a fast profile (~23min → minutes) #51.key: hashFiles('Cargo.toml')— folds the profile-defining manifest into the cache key so this is self-healing: any future[profile.*]edit auto-mints a fresh key instead of silently reusing a stale slot (the exact trap ci(desktop): build the oab-mcp sidecar with a fast profile (~23min → minutes) #51 fell into). No need to hand-bumpprefix-keyagain.Chosen over a hand-rolled
actions/cacheon the sidecar binary because that needs a manual invalidation key — andoab-mcpdepends on the workspace cratestudio-cp, so a naivehashFiles('crates/oab-mcp/**')key would ship a stale sidecar whenstudio-cpchanges. Letting cargo decide keeps correctness.Verification
bundle-macosrun: sidecar step is the first-everv1build → expect ~20m (cold, expected) and a cache save at the end (post step should NOT say "Cache up-to-date").mainafter this merges should restore thev1cache and drop the sidecar step to minutes.🤖 Generated with Claude Code