ci(desktop): cut macOS sidecar build time (cache binary + unpoison rust-cache + opt-level 0) - #56
Merged
Merged
Conversation
…t-cache, opt-level 0) Measured `bundle-macos` warm run = ~966s in the sidecar step alone, split ~299s in oab-mcp's final codegen + ~600s recompiling the aws-sdk dep tree *under a cache "hit"*. Three fixes: 1. Content-address the built sidecar binary (actions/cache keyed on crates/** + Cargo.lock + Cargo.toml). Rust-unchanged PRs (the common case — most iterations only touch console/** TS) restore the binary and skip the whole `cargo build`: ~966s -> ~0s. 2. Unpoison rust-cache: the v1 target-dir cache kept reporting "Cache up-to-date" while its saved target had already been pruned of the release-ci deps, so every warm run recompiled the aws-sdk tree. Bump prefix-key v2 (one-time reset), cache-all-crates (keep the deps in the saved target), and save-if main-only (PRs restore a clean main-built cache instead of each minting its own half-empty immutable key). 3. release-ci opt-level 1 -> 0: the sidecar is I/O-bound (AWS calls, no hot loops); opt-level is the only remaining codegen lever with lto/debug already off. Trims oab-mcp's ~299s final codegen. Shipped binary is larger/slower but functionally invisible for this tool. 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.
What
Cut macOS
bundle-macosbuild time. Measured warm run: ~966s in the sidecar step alone — ~299s inoab-mcp's final codegen + ~600s recompiling the aws-sdk dep tree under a cache "hit" (post-step kept sayingCache up-to-datewhile saving nothing).Changes
actions/cache, keyed oncrates/** + Cargo.lock + Cargo.toml). Most PR iterations only touchconsole/**TS and never the Rust, yet each still recompiledoab-mcpcold. Rust-unchanged runs now restore the binary and skipcargo buildentirely: ~966s → ~0s. Single small file keyed on its inputs → can't self-poison like a target-dir cache.prefix-key v2(one-time reset off the poisoned v1) +cache-all-crates(keep aws-sdk deps in the saved target) +save-ifmain-only (PRs restore a clean main-built cache instead of each minting its own half-empty immutable key — the standard anti-PR-pollution pattern). Recovers the ~600s dep recompile on Rust-changed PRs.release-ciopt-level 1 → 0: sidecar is I/O-bound (AWS calls, no hot loops); opt-level is the only remaining codegen lever with lto/debug already off. Trimsoab-mcp's ~299s final codegen.Tradeoff to confirm
Change 3 ships a larger / slightly slower
oab-mcpbinary in the.dmg. For an I/O-bound MCP sidecar this is functionally invisible, but it is the shipped artifact — easy to revert change 3 alone (keep 1+2) if you'd rather not touch the shipped opt level.Expected
bundle-macos~25m → ~3–5m (node build + tauri bundle only).Data + rationale from profiling runs
31811778972/31793648113on the desktop workflow.🤖 Generated with Claude Code