From 246a52f5c108dc0ec01960d63bc8ac3055585476 Mon Sep 17 00:00:00 2001 From: brettchien Date: Fri, 14 Aug 2026 18:47:36 +0800 Subject: [PATCH 1/2] ci(desktop): bump rust-cache prefix so release-ci deps actually cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #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 --- .github/workflows/desktop.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 54b1ba9..9301abc 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -48,6 +48,19 @@ jobs: targets: aarch64-apple-darwin - uses: Swatinem/rust-cache@v2 with: + # prefix-key is bumped to v1 to force a fresh cache slot. rust-cache's + # key hashes Cargo.lock (+ rustc + cargo config) but NOT the + # [profile.*] sections of Cargo.toml, so adding `release-ci` in #51 did + # not change the key. Every run kept getting a "full match" against the + # pre-existing v0 cache — which only held deps built under `release/`, + # never `release-ci/`. So `cargo build --profile release-ci` recompiled + # the whole aws-sdk/aws-lc-sys tree cold (~20m) every time, and the post + # step reported "Cache up-to-date" and saved nothing (GitHub keys are + # immutable). Bumping the prefix mints a new key: the first run misses, + # does the cold build, and actually SAVES the release-ci deps. After + # that, unrelated PRs restore those deps and cargo's own fingerprinting + # recompiles only oab-mcp itself — minutes, as intended in #51. + prefix-key: "v1-rust" workspaces: | . -> target src-tauri -> target From c45c8c42271a791c9367ef66b202a5a486f60329 Mon Sep 17 00:00:00 2001 From: brettchien Date: Fri, 14 Aug 2026 18:51:44 +0800 Subject: [PATCH 2/2] ci(desktop): fold Cargo.toml into rust-cache key so profile edits self-heal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/desktop.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 9301abc..8a70765 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -48,19 +48,21 @@ jobs: targets: aarch64-apple-darwin - uses: Swatinem/rust-cache@v2 with: - # prefix-key is bumped to v1 to force a fresh cache slot. rust-cache's - # key hashes Cargo.lock (+ rustc + cargo config) but NOT the - # [profile.*] sections of Cargo.toml, so adding `release-ci` in #51 did - # not change the key. Every run kept getting a "full match" against the - # pre-existing v0 cache — which only held deps built under `release/`, - # never `release-ci/`. So `cargo build --profile release-ci` recompiled - # the whole aws-sdk/aws-lc-sys tree cold (~20m) every time, and the post - # step reported "Cache up-to-date" and saved nothing (GitHub keys are - # immutable). Bumping the prefix mints a new key: the first run misses, - # does the cold build, and actually SAVES the release-ci deps. After - # that, unrelated PRs restore those deps and cargo's own fingerprinting - # recompiles only oab-mcp itself — minutes, as intended in #51. + # rust-cache's key hashes Cargo.lock (+ rustc + cargo config) but NOT + # the [profile.*] sections of Cargo.toml. So adding `release-ci` in #51 + # did not change the key: every run got a "full match" against the old + # v0 cache — which only held deps built under `release/`, never + # `release-ci/`. `cargo build --profile release-ci` therefore recompiled + # the whole aws-sdk/aws-lc-sys tree cold (~20m) every run, and since the + # key matched, the post step said "Cache up-to-date" and saved nothing + # (GitHub keys are immutable) — so the release-ci deps never persisted. + # + # prefix-key bump = one-time reset off the poisoned v0 cache. + # key: hashFiles('Cargo.toml') folds the profile-defining manifest into + # the cache key, so any future profile edit auto-mints a fresh key and + # self-heals — no need to remember to bump prefix-key by hand again. prefix-key: "v1-rust" + key: ${{ hashFiles('Cargo.toml') }} workspaces: | . -> target src-tauri -> target