Skip to content

ci(desktop): build the oab-mcp sidecar with a fast profile (~23min → minutes) - #51

Merged
brettchien merged 1 commit into
mainfrom
ci/speed-macos-sidecar-build
Aug 14, 2026
Merged

ci(desktop): build the oab-mcp sidecar with a fast profile (~23min → minutes)#51
brettchien merged 1 commit into
mainfrom
ci/speed-macos-sidecar-build

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

The finding

Timing a real bundle-macos run (per-step):

step time
checkout + node + web skin + toolchain ~15s
rust-cache restore 63s
Build oab-mcp sidecar (arm64) 23m 09s ← the whole cost
Install Tauri CLI 3s
Bundle (.app + .dmg) 81s

23 of ~26 min is one step: cargo build --release -p oab-mcp — release-optimizing the aws-config / aws-sdk-* / aws-lc-sys / ring tree for aarch64. The root Cargo.toml had no profile overrides, so default release (opt-level 3, codegen-units 16) makes LLVM optimization of the aws-sdk codegen dominate. Notably tauri build (compiling studio-desktop, also aws-sdk-heavy) was only 81s — cache-hit — so this is specific to the sidecar's release compile.

The fix

oab-mcp is an I/O-bound MCP server (AWS API calls, no hot loops) — full release optimization buys nothing. Add a release-ci profile and build the sidecar with it:

[profile.release-ci]
inherits = "release"
opt-level = 1        # sidecar is I/O-bound; no hot loops
codegen-units = 256  # max parallelism
lto = false
debug = false
strip = true

The aws-sdk tree now compiles in minutes instead of ~23; the shipped sidecar is marginally larger/slower but functionally identical. The app (tauri build) still uses the full release profile.

Verification

  • cargo build --profile release-ci -p acp-tunnel builds and lands in target/release-ci/ (profile is valid; cross-target path target/aarch64-apple-darwin/release-ci/ matches the updated cp).
  • This PR's own bundle-macos run will show the new sidecar-build time.

Possible follow-up (not in this PR)

oab-mcp doesn't depend on acp-tunnel, so most PRs (all chat work) don't change the sidecar at all — a targeted actions/cache on the built sidecar binary keyed by crates/oab-mcp/** + Cargo.lock could skip the build entirely on unrelated PRs. Left out here to keep this change low-risk; happy to add if wanted.

🤖 Generated with Claude Code

… minutes)

Timing a bundle-macos run showed 23 of ~26 minutes is a single step:
'cargo build --release -p oab-mcp' — release-optimizing the aws-config /
aws-sdk / aws-lc-sys / ring tree for aarch64. The root Cargo.toml had no
profile overrides (default release: opt-level 3, codegen-units 16), so
LLVM optimization of the aws-sdk codegen dominates. oab-mcp is an
I/O-bound MCP server (AWS API calls, no hot loops), so full release opt
buys nothing.

Add a release-ci profile (inherits release; opt-level 1, codegen-units
256, no lto) and build the sidecar with it. The aws-sdk tree now
compiles in minutes; the shipped sidecar is marginally larger/slower but
functionally identical. The app itself (tauri build) still uses the full
release profile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@brettchien
brettchien merged commit 1a00d31 into main Aug 14, 2026
2 checks passed
brettchien pushed a commit that referenced this pull request Aug 14, 2026
…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 added a commit that referenced this pull request Aug 14, 2026
…#53)

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

#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>

* ci(desktop): fold Cargo.toml into rust-cache key so profile edits self-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>

---------

Co-authored-by: brettchien <brett@openab.dev>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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