fix(build): build CEF helper only for current target arch, fixing Intel Mac builds#2491
fix(build): build CEF helper only for current target arch, fixing Intel Mac builds#2491M3gA-Mind wants to merge 2 commits into
Conversation
…rget The vendored tauri-bundler build.rs was unconditionally building CEF helpers for both aarch64-apple-darwin and x86_64-apple-darwin, requiring the cross-compile toolchain on Intel Macs. Now it builds only the helper for the current TARGET: - x86_64-apple-darwin: x86_64 only, aarch64 slot = &[] - aarch64-apple-darwin: aarch64 only, x86_64 slot = &[] - universal-apple-darwin: both (existing behavior, required for CI) Closes tinyhumansai#2456
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdvance the vendored ChangesUpdate vendored tauri-cef dependency
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src-tauri/vendor/tauri-cef`:
- Line 1: Update the pin file .github/tauri-cef-expected-sha to match the new
submodule commit used in app/src-tauri/vendor/tauri-cef by replacing its
contents with the new SHA a780f61edec7936e76f73834754e9ff8081cb6eb so the
"tauri-cef Pin Guard" CI check passes; ensure the file contains exactly that
hash with no extra whitespace or lines.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9679ab85-1a50-4d63-9ee8-01b52a1fbe85
📒 Files selected for processing (1)
app/src-tauri/vendor/tauri-cef
|
Closing: the fix requires committing to the submodule repository (the build.rs that controls per-arch helper compilation lives in that repo). Our commit only exists locally — CI can't fetch it since it isn't in the upstream The fix is correct (only build CEF helpers for the target arch — Workaround for Intel Mac users until this is fixed upstream: |
Summary
app/src-tauri/vendor/tauri-cef/crates/tauri-bundler/build.rsto build the CEF helper binary only for the target architecture(s) actually being compiled, rather than always building for bothaarch64-apple-darwinandx86_64-apple-darwin.TARGET=x86_64-apple-darwin): builds x86_64 helper only;CEF_HELPER_AARCH64constant becomes&[].TARGET=aarch64-apple-darwin): builds aarch64 helper only;CEF_HELPER_X86_64constant becomes&[].TARGET=universal-apple-darwin): builds both as before (required for CI and release packaging).Root cause
The bundler's
build.rsunconditionally calledbuild_helper()for bothaarch64-apple-darwinandx86_64-apple-darwinregardless of$TARGET. On Intel Macs, this required theaarch64-apple-darwinRust target to be installed (viarustup target add aarch64-apple-darwin). When it wasn't, the build failed with:The
create_cef_helpers()function inapp.rsonly reads the constant matching the requested bundle arch (CEF_HELPER_AARCH64for AArch64 bundles,CEF_HELPER_X86_64for x86_64 bundles, both for Universal), so an empty&[]for the unused arch is never written to disk on single-arch builds.Changes
app/src-tauri/vendor/tauri-cef/crates/tauri-bundler/build.rsneed_aarch64/need_x86_64derived from$TARGET; emit&[]for unused arch in the shimTest plan
cargo check --manifest-path app/src-tauri/Cargo.toml— clean on Apple Silicon hostcargo check --manifest-path Cargo.toml— cleancargo build --manifest-path app/src-tauri/Cargo.toml— should complete without aarch64 toolchain installed--target universal-apple-darwin— should build both helpers as beforeRelated
Closes #2456
Summary by CodeRabbit