tauri
tauri copied to clipboard
[bug] bundle builder should not use conditional compilation to determine target platform
Describe the bug
When attempting to cross-compile from Linux to Windows, I am encountering errors about lacking the GTK "appindicator". Looking at the code in tooling/cli/src/build.rs, it is clear that the platform-specific bundling decisions are mode when tauri cli gets built, not during the target app build. The causes incorrent bundling decisions to be made with host and target platforms differ.
Reproduction
Follow the guide on cross-compiling Tauri from linux to windows, and notice that tauri.windows.conf.json does not get used during build. If you happen to not have any appindicator installed for linux, you will also see a tauri crash.
Expected behavior
No response
Full tauri info output
WARNING: Only one package manager should be used, but found npm and yarn.
Please remove unused package manager lock files, will use npm for now!
[✘] Environment
- OS: Debian 12.0.0 X64
✘ webkit2gtk-4.0: not installed
Visit https://tauri.app/v1/guides/getting-started/prerequisites to learn more about tauri prerequisites
✘ rsvg2: not installed
Visit https://tauri.app/v1/guides/getting-started/prerequisites to learn more about tauri prerequisites
✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
✔ cargo: 1.77.2 (e52e36006 2024-03-26)
✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
- node: 18.19.0
- yarn: 1.22.22
- npm: 9.2.0
[-] Packages
- tauri [RUST]: 1.6.2
- tauri-build [RUST]: 1.5.1
- wry [RUST]: 0.24.8
- tao [RUST]: 0.16.9
- tauri-cli [RUST]: 1.5.12
- @tauri-apps/api [NPM]: 1.5.3 (outdated, latest: 1.5.4)
- @tauri-apps/cli [NPM]: 1.5.12
[-] App
- build-type: build
- CSP: unset
- distDir: ../dist/spa
- devPath: http://127.0.0.1:9000/
- framework: Vue.js (Quasar)
- bundler: Vite
Stack trace
No response
Additional context
No response