From 3e4301152f05495e029a2251f4e67c5500a948bf Mon Sep 17 00:00:00 2001 From: brettchien Date: Fri, 14 Aug 2026 17:22:45 +0800 Subject: [PATCH] ci(desktop): build the oab-mcp sidecar with a fast profile (~23min -> minutes) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/desktop.yml | 7 +++++-- Cargo.toml | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index e9b0766..54b1ba9 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -52,10 +52,13 @@ jobs: . -> target src-tauri -> target - name: Build oab-mcp sidecar (arm64) + # release-ci profile (root Cargo.toml): opt-level 1 + codegen-units 256, + # so the aws-sdk/aws-lc-sys tree compiles in minutes, not ~23. The sidecar + # is I/O-bound (AWS API calls), so it doesn't need full release opt. run: | - cargo build --release -p oab-mcp --target aarch64-apple-darwin + cargo build --profile release-ci -p oab-mcp --target aarch64-apple-darwin mkdir -p src-tauri/binaries - cp target/aarch64-apple-darwin/release/oab-mcp \ + cp target/aarch64-apple-darwin/release-ci/oab-mcp \ src-tauri/binaries/oab-mcp-aarch64-apple-darwin - name: Install Tauri CLI run: npm install -g @tauri-apps/cli@^2 diff --git a/Cargo.toml b/Cargo.toml index b7cf83d..89e2578 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,16 @@ [workspace] members = ["crates/agent-lifecycle", "crates/oabctl", "crates/studio-cp", "crates/oab-mcp", "crates/acp-tunnel"] resolver = "2" + +# Fast profile for the CI-built `oab-mcp` sidecar (desktop.yml). The sidecar is an +# MCP server that shells out to AWS — it is I/O-bound with no hot loops, so it does +# not need full `release` optimization. Dropping to opt-level 1 + max codegen-units +# turns a ~23-min release compile of the aws-sdk/aws-lc-sys tree into a few minutes; +# the shipped binary is a touch larger/slower but functionally identical. +[profile.release-ci] +inherits = "release" +opt-level = 1 +codegen-units = 256 +lto = false +debug = false +strip = true