Skip to content

ci(desktop): cut macOS sidecar build time (cache binary + unpoison rust-cache + opt-level 0) - #56

Merged
brettchien merged 1 commit into
mainfrom
ci/osx-build-speedup
Aug 14, 2026
Merged

ci(desktop): cut macOS sidecar build time (cache binary + unpoison rust-cache + opt-level 0)#56
brettchien merged 1 commit into
mainfrom
ci/osx-build-speedup

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

What

Cut macOS bundle-macos build time. Measured warm run: ~966s in the sidecar step alone — ~299s in oab-mcp's final codegen + ~600s recompiling the aws-sdk dep tree under a cache "hit" (post-step kept saying Cache up-to-date while saving nothing).

Changes

  1. Cache the built sidecar binary (actions/cache, keyed on crates/** + Cargo.lock + Cargo.toml). Most PR iterations only touch console/** TS and never the Rust, yet each still recompiled oab-mcp cold. Rust-unchanged runs now restore the binary and skip cargo build entirely: ~966s → ~0s. Single small file keyed on its inputs → can't self-poison like a target-dir cache.
  2. Unpoison rust-cache: prefix-key v2 (one-time reset off the poisoned v1) + cache-all-crates (keep aws-sdk deps in the saved target) + save-if main-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.
  3. release-ci opt-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. Trims oab-mcp's ~299s final codegen.

Tradeoff to confirm

Change 3 ships a larger / slightly slower oab-mcp binary 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

  • TS-only PR: bundle-macos ~25m → ~3–5m (node build + tauri bundle only).
  • Rust-changed PR: sidecar dep段 ~600s → single-digit minutes; oab-mcp codegen trimmed.

Data + rationale from profiling runs 31811778972 / 31793648113 on the desktop workflow.

🤖 Generated with Claude Code

…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>
@brettchien
brettchien merged commit fed0a88 into main Aug 14, 2026
2 checks passed
@brettchien
brettchien deleted the ci/osx-build-speedup branch August 14, 2026 19:24
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