Skip to content

fix(build): build CEF helper only for current target arch, fixing Intel Mac builds#2491

Closed
M3gA-Mind wants to merge 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/intel-mac-build-target
Closed

fix(build): build CEF helper only for current target arch, fixing Intel Mac builds#2491
M3gA-Mind wants to merge 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/intel-mac-build-target

Conversation

@M3gA-Mind
Copy link
Copy Markdown
Contributor

@M3gA-Mind M3gA-Mind commented May 22, 2026

Summary

  • Updates app/src-tauri/vendor/tauri-cef/crates/tauri-bundler/build.rs to build the CEF helper binary only for the target architecture(s) actually being compiled, rather than always building for both aarch64-apple-darwin and x86_64-apple-darwin.
  • On Intel Macs (TARGET=x86_64-apple-darwin): builds x86_64 helper only; CEF_HELPER_AARCH64 constant becomes &[].
  • On Apple Silicon (TARGET=aarch64-apple-darwin): builds aarch64 helper only; CEF_HELPER_X86_64 constant becomes &[].
  • For universal builds (TARGET=universal-apple-darwin): builds both as before (required for CI and release packaging).

Root cause

The bundler's build.rs unconditionally called build_helper() for both aarch64-apple-darwin and x86_64-apple-darwin regardless of $TARGET. On Intel Macs, this required the aarch64-apple-darwin Rust target to be installed (via rustup target add aarch64-apple-darwin). When it wasn't, the build failed with:

error[E0463]: can't find crate for `core`
  = note: the `aarch64-apple-darwin` target may not be installed
thread 'main' panicked: failed to build CEF helper for target aarch64-apple-darwin

The create_cef_helpers() function in app.rs only reads the constant matching the requested bundle arch (CEF_HELPER_AARCH64 for AArch64 bundles, CEF_HELPER_X86_64 for x86_64 bundles, both for Universal), so an empty &[] for the unused arch is never written to disk on single-arch builds.

Changes

File Change
app/src-tauri/vendor/tauri-cef/crates/tauri-bundler/build.rs Gate helper builds behind need_aarch64 / need_x86_64 derived from $TARGET; emit &[] for unused arch in the shim

Test plan

  • cargo check --manifest-path app/src-tauri/Cargo.toml — clean on Apple Silicon host
  • cargo check --manifest-path Cargo.toml — clean
  • Intel Mac: cargo build --manifest-path app/src-tauri/Cargo.toml — should complete without aarch64 toolchain installed
  • CI universal build: --target universal-apple-darwin — should build both helpers as before

Related

Closes #2456

Summary by CodeRabbit

  • Chores
    • Updated a vendored native component to a new upstream revision and adjusted its expected checksum. No user-facing changes; this update maintains compatibility, stability, and reliability.

Review Change Stack

…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
@M3gA-Mind M3gA-Mind requested a review from a team May 22, 2026 13:01
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 372bec55-9896-4328-a2f8-0d98ea856c20

📥 Commits

Reviewing files that changed from the base of the PR and between 55f0ffa and 0f5318f.

📒 Files selected for processing (1)
  • .github/tauri-cef-expected-sha
✅ Files skipped from review due to trivial changes (1)
  • .github/tauri-cef-expected-sha

📝 Walkthrough

Walkthrough

Advance the vendored tauri-cef submodule to a new commit and update .github/tauri-cef-expected-sha with the corresponding new SHA.

Changes

Update vendored tauri-cef dependency

Layer / File(s) Summary
Advance tauri-cef submodule pointer
app/src-tauri/vendor/tauri-cef
The tauri-cef vendored submodule pointer is updated to a new commit hash.
Update expected SHA for tauri-cef
.github/tauri-cef-expected-sha
Replaced the stored expected SHA string with the new SHA matching the updated submodule.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through commits, sniffed the SHA,

Pulled the submodule a brand new way,
Updated the record with a tidy line,
Now vendored CEF points to the new sign,
Thumper-approved, the build can play.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing Intel Mac builds by building the CEF helper only for the current target architecture instead of unconditionally for both architectures.
Linked Issues check ✅ Passed The code changes directly address issue #2456 by modifying build.rs to gate helper builds behind architecture-specific conditions derived from $TARGET, ensuring Intel Mac builds succeed without requiring aarch64 toolchain.
Out of Scope Changes check ✅ Passed Both modified files (tauri-cef submodule and expected-sha) are directly related to the build fix; the submodule update contains the build.rs changes and the sha file reflects the expected change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 733fcfe and 55f0ffa.

📒 Files selected for processing (1)
  • app/src-tauri/vendor/tauri-cef

Comment thread app/src-tauri/vendor/tauri-cef
@M3gA-Mind
Copy link
Copy Markdown
Contributor Author

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 tinyhumansai/tauri-cef remote, causing fatal: remote error: upload-pack: not our ref.

The fix is correct (only build CEF helpers for the target arch — x86_64-apple-darwin, aarch64-apple-darwin, or both for universal-apple-darwin), but it needs to land in tinyhumansai/tauri-cef first, then have the submodule pin updated in this repo.

Workaround for Intel Mac users until this is fixed upstream: rustup target add aarch64-apple-darwin

@M3gA-Mind M3gA-Mind closed this May 22, 2026
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.

Build fails on Intel Mac: Incorrectly targets aarch64-apple-darwin

1 participant