Repository navigation
ci(release): macOS Intel 改为在 Apple Silicon 交叉编译,修复 Rust 缓存路径 - #1148
Merged
Merged
Conversation
…cache path rust-cache pointed at crates/agent-gui/src-tauri/target, but the cargo workspace root is the repo root, so it never restored or saved anything. The macos-15-intel runner compiles about 2x slower than macos-15; build the x86_64 target there instead and assert every bundled Mach-O matches the target architecture. Closes #1147
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.
Linked issue
Closes #1147
Summary
Two fixes to
desktop-release.yml.1. The Rust cache never worked.
Swatinem/rust-cachehadworkspaces: crates/agent-gui/src-tauri, so it cachedcrates/agent-gui/src-tauri/target. The cargo workspace root is the repo root, and artifacts go to./target. Every release logged "No cache found" and compiled from scratch, including reruns of a failed job (for example the notarization 403 retries). All three jobs now use". -> target", and the macOS matrix gets a per-target key so Intel and Apple Silicon don't overwrite each other.2. Intel is cross-compiled on
macos-15(Apple Silicon) instead ofmacos-15-intel. On v2.0.2, Rust compilation took about 16 min on Intel and about 10 min on Apple Silicon. Intel jobs took 23–35 min overall, Apple Silicon 15–21.kbrain.lock.json.prepare-gateway.mjsfromTAURI_ENV_TARGET_TRIPLEwithCGO_ENABLED=0.LiveAgent.app/Contents/MacOSmust report exactly the target architecture (lipo -archs), so a wrong-arch package fails the job instead of shipping.Expected result: Intel drops to the Apple Silicon time, and the release finishes when Windows/Linux do (about 22 min). Reruns of a failed job also reuse the compiled dependencies.
Known limit: GitHub only lets a tag run restore caches from that same tag or the default branch. A new tag therefore still compiles cold the first time. Warming release caches from
mainwould fix that, but it costs macOS minutes and cache quota, so it isn't included here.Change scope
.github/workflows/desktop-release.ymlonlyScreenshots / preview
N/A, CI-only change.
Verification
cargo build --target x86_64-apple-darwinforcrates/agent-gui/src-tauribuilds and links. Output:Mach-O 64-bit executable x86_64.