tauri: Failing to build Mac universal

Describe the bug

When I try to build a Tauri app for Mac OS Universal, I get a bunch of Rust errors in these shapes.

image

Reproduction

tauri build --target universal-apple-darwin

Expected behavior

The command will produce a successful build.

Platform and versions

> coiner@0.0.1 tauri
> tauri "info"


Operating System - Mac OS, version 12.0.1 X64

Node.js environment
  Node.js - 16.14.0
  @tauri-apps/cli - 1.0.0-rc.5 (outdated, latest: 1.0.0-rc.7)
  @tauri-apps/api - 1.0.0-rc.1 (outdated, latest: 1.0.0-rc.2)

Global packages
  npm - 8.3.1
  pnpm - 6.27.0
  yarn - Not installed

Rust environment
  rustup - 1.24.3
  rustc - 1.59.0
  cargo - 1.59.0
  toolchain - stable-aarch64-apple-darwin 

App directory structure
/dist
/node_modules
/src-tauri
/.git
/src

App
  tauri - 1.0.0-rc.3
  tauri-build - 1.0.0-rc.3
  tao - 0.6.3
  wry - 0.13.3
  build-type - bundle
  CSP - unset
  distDir - ../dist
  devPath - http://localhost:3000/

Stack trace

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (12 by maintainers)

Most upvoted comments

@ttfkam to tell npm to correctly forward arguments to the tauri cli you need to prepend an extra -- like so: npm run tauri build -- --target universal-apple-darwin

Success! Updating to -rc.5 was the last missing piece. Universal binary built and running now. Thank you. 👍

We did see some issues but nothing conclusive yet, we need to investigate it further.

Nice!

With that resolved i’m gonna close this issue since the OP doesn’t respond and it looked like an issue with the missing target (feel free to comment here again and we will re-open it)

Yep @FabianLars, that almost fixed the build issue. Thank you. FYI: someone might want to update the command I basically copy-pasted from the Tauri docs. I think my CLI goof may be a common mistake worth documenting proactively. https://tauri.studio/docs/distribution/macos#binary-targets