tauri-apps / tauri

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

[bug] Tauri fails to compile when having RocksDB as a dependency on MacOS #5961

Closed arnau closed 9 months ago

arnau commented 1 year ago

Describe the bug

npm run tauri build fails on MacOS (x86) when rust-rocksdb exists as a dependency (direct or indirect). However, when running cargo build --release beforehand, the build succeeds.

Reproduction

  1. Create new Tauri app using npm create tauri-app
  2. Add RocksDB as a dependency cd src-tauri; cargo add rocksdb
  3. Build the application npm run tauri build

Expected behavior

When running npm run tauri build I expect it to succeed when running on MacOS.

Platform and versions

Environment › OS: Mac OS 12.6.2 X64 › Node.js: 19.3.0 › npm: 9.2.0 › pnpm: Not installed! › yarn: 1.22.19 › rustup: 1.25.1 › rustc: 1.66.0 › cargo: 1.66.0 › Rust toolchain: stable-x86_64-apple-darwin

Packages › @tauri-apps/cli [NPM]: 1.2.2 › @tauri-apps/api [NPM]: 1.2.0 › tauri [RUST]: 1.2.3, › tauri-build [RUST]: 1.2.1, › tao [RUST]: 0.15.8, › wry [RUST]: 0.23.4,

App › build-type: bundle › CSP: unset › distDir: ../dist › devPath: http://localhost:3000/ › framework: SolidJS › bundler: Vite

App directory structure ├─ node_modules ├─ .github ├─ src-tauri ├─ .git └─ src

Stack trace

A full trace can be found here: https://github.com/arnau/pipe/actions/runs/3823820121/jobs/6505393130

Additional context

I encountered this issue when testing Sentio on MacOS. Sentio uses SurrealDB with RocksDB as backend and works fine on Windows and Linux.

After wrestling with the issue for a bit I got a minimal test that reproduces the issue: https://github.com/arnau/pipe

The repo above runs two jobs, one that runs npm run tauri build and another that before doing that runs cargo build --release. The first job fails on MacOS but the second succeeds which makes me think something is happening behind the scenes with npm run tauri build. I can't be certain though, hence me opening this issue, in case someone can shed light to it.

glen0125 commented 1 year ago

I had same problem when I used rocksdb 0.19, try downgrading to rocksdb 0.18

arnau commented 1 year ago

Thanks @glen0125, I can confirm it works when using rocksdb 0.18. This adds up to the inconsistent behaviour observed 🤔

liamwh commented 1 year ago

+1, Also hitting this issue with Tauri and surrealdb

FabianLars commented 1 year ago

Does it help if you set https://tauri.app/v1/api/config/#macconfig.minimumsystemversion to 10.14 or 10.15?

andrewmoore-nz commented 9 months ago

Can confirm... for anyone hitting this issue, changing the minimumSystemVersion, in my case to 12.0 solved the build error I was getting with RocksDB.


"macOS": {
    ...
    "minimumSystemVersion": "12.0"
},