Skip to content

ci(desktop): bump rust-cache prefix so release-ci deps actually cache - #53

Merged
brettchien merged 2 commits into
mainfrom
ci/rust-cache-prefix-release-ci
Aug 14, 2026
Merged

ci(desktop): bump rust-cache prefix so release-ci deps actually cache#53
brettchien merged 2 commits into
mainfrom
ci/rust-cache-prefix-release-ci

Conversation

@brettchien

@brettchien brettchien commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The problem

#51 added a release-ci profile to cut the sidecar build from ~23m, but it never actually got faster — its own bundle-macos run took 19m51s on the sidecar step (Cache hit ... full match: true yet a full cold compile), and the post-merge run on main is doing the same right now.

Root cause

Swatinem/rust-cache keys the cache on Cargo.lock (+ rustc + cargo config), not on Cargo.toml's [profile.*] sections. Verified empirically: a pre-#51 run (no release-ci in Cargo.toml) and #51's run share the identical key v0-rust-bundle-macos-Darwin-arm64-f9b08cb2-282619ef. So every run:

  1. Gets a full match: true against the old v0 cache — which only holds deps compiled under target/.../release/, never release-ci/.
  2. cargo build --profile release-ci writes to a fresh release-ci/ dir → recompiles the whole aws-sdk / aws-lc-sys / ring tree cold (~20m) every run.
  3. Because the key matched, the post step logs Cache up-to-date and saves nothing. GitHub cache keys are immutable, so the release-ci deps are never persisted — the fast path can never arrive.

The fix

prefix-key: "v1-rust"
key: ${{ hashFiles('Cargo.toml') }}

Chosen over a hand-rolled actions/cache on the sidecar binary because that needs a manual invalidation key — and oab-mcp depends on the workspace crate studio-cp, so a naive hashFiles('crates/oab-mcp/**') key would ship a stale sidecar when studio-cp changes. Letting cargo decide keeps correctness.

Verification

  • This PR's bundle-macos run: sidecar step is the first-ever v1 build → expect ~20m (cold, expected) and a cache save at the end (post step should NOT say "Cache up-to-date").
  • Next push to main after this merges should restore the v1 cache and drop the sidecar step to minutes.

🤖 Generated with Claude Code

brettchien and others added 2 commits August 14, 2026 18:47
#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>
@brettchien
brettchien merged commit 75d040e into main Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant