tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
83.66k stars 2.51k forks source link

[bug] Bundle fails on Apple Accelerate framework #8173

Closed codesoda closed 9 months ago

codesoda commented 11 months ago

Describe the bug

Hi all, I have a Tauri macOS app that uses Apple's Accelerate.framework and CoreML.framework. I've recently upgraded from 1.4 to 1.5, and now the bundler is failing when running xattr -cr myapp.app to clear any attributes on the frameworks. This likely has some relation to the work done for #7690.

Reproduction

Example repo can be found at https://github.com/codesoda/accelerate_bug.

Expected behavior

I would expect that the xattr command succeeds and the app bundle is then code-signed and passed to Apple to be notarized.

Platform and versions

➜  accelerate_test git:(main) yarn tauri info
yarn run v1.22.19
$ tauri info

[✔] Environment
    - OS: Mac OS 12.6.3 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.73.0 (cc66ad468 2023-10-03)
    ✔ cargo: 1.73.0 (9c4383fb5 2023-08-26)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.5.0
    - pnpm: 8.9.2
    - yarn: 1.22.19
    - npm: 9.8.0

[-] Packages
    - tauri [RUST]: 1.5.2
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.4
    - tao [RUST]: 0.16.5
    - @tauri-apps/api [NPM]: 1.5.1
    - @tauri-apps/cli [NPM]: 1.5.6

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite
✨  Done in 6.40s.

Stack trace

Running [tauri_cli] Command `cargo  build --features custom-protocol --release`
   Compiling accelerate_test v0.0.0 (/Users/me/projects/accelerate_test/src-tauri)
    Finished release [optimized] target(s) in 4.22s
    Bundling [tauri_bundler::bundle::macos::app] accelerate_test.app (/Users/me/projects/accelerate_test/src-tauri/target/release/bundle/macos/accelerate_test.app)
     Running [tauri_bundler::bundle::common] Command `xattr  -cr /Users/me/projects/accelerate_test/src-tauri/target/release/bundle/macos/accelerate_test.app`
xattr: No such file: /Users/me/projects/accelerate_test/src-tauri/target/release/bundle/macos/accelerate_test.app/Contents/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/libBigNum.dylib
       Error [tauri_cli_node] failed to bundle project: failed to remove extra attributes from app bundle
error Command failed with exit code 1.

Additional context

No response

pewsheen commented 11 months ago

Just some updates

It looks like two issues need to be solved:

codesoda commented 11 months ago

@pewsheen I previously had no trouble with building, code-signing and notarizing builds with 1.4. I was thinking of making a fake xattr and dropping it into the build path so I can upgrade to Tauri 1.5 before Apple cuts off my use of atool for notarizing.

Might be worth trying xattr -crs as you suggested, or use a find and pipe the results to xattr, e.g. find /path/to/base_directory -type f -exec xattr -c {} \;

hjmallon commented 10 months ago

Are you bundling Accelerate.framework with the app bundle? (/Users/me/projects/accelerate_test/src-tauri/target/release/bundle/macos/accelerate_test.app/Contents/Frameworks/Accelerate.framework). I might be missing something, but why do you have to do that? Isn't that framework included with macOS?

samheutmaker commented 7 months ago

Tip to anyone coming across this: Make sure that your version of xattr supports the -r option. My Python Poetry installation was overriding the system xattr binary on my $PATH. Run which xattr -- it should return /usr/bin/xattr. If it returns something else, remove whatever it is from your $PATH and try again.