You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tauri build fails to detect that my src-tauri directory was part of a Cargo workspace. I realized the reason that function didn't work for me is because I use a glob to identify my workspace members, and Tauri CLI checks for exact matches. Directory structure that reproduces issue:
$ cargo tauri info
Operating System - Mac OS, version 11.5.2 X64
Node.js environment
Node.js - 16.9.1
@tauri-apps/cli - 1.0.0-beta.10
Global packages
npm - 7.21.1
yarn - Not installed
Rust environment
rustc - 1.56.0-nightly
cargo - 1.55.0-nightly
Additional context
I was pretty curious, since there seems to be workspace-specific code in interface/rust.rs#get_target_dir. I'm able to workaround this issue by explicitly setting CARGO_TARGET_DIR. My 2 cents is that Tauri should call cargo metadata directly, which would ensure that it uses the same resolution mechanism as Cargo itself. I think that approach would also resolve #2515, since you could also use the error message that Cargo uses for the same problem. My reproduction repo has a few more example project layouts and their cargo metadata output: https://github.com/kofigumbs/src-tauri-workspace.
Stack Trace
N/A
The text was updated successfully, but these errors were encountered:
Describe the bug
tauri build
fails to detect that mysrc-tauri
directory was part of a Cargo workspace. I realized the reason that function didn't work for me is because I use a glob to identify my workspace members, and Tauri CLI checks for exact matches. Directory structure that reproduces issue:To Reproduce
cd a-workspace
cargo tauri build
Expected behavior
Tauri's target directory detection should always match that of
cargo metadata
:Screenshots
N/A
Platform and Versions (required):
Additional context
I was pretty curious, since there seems to be workspace-specific code in interface/rust.rs#get_target_dir. I'm able to workaround this issue by explicitly setting
CARGO_TARGET_DIR
. My 2 cents is that Tauri should callcargo metadata
directly, which would ensure that it uses the same resolution mechanism as Cargo itself. I think that approach would also resolve #2515, since you could also use the error message that Cargo uses for the same problem. My reproduction repo has a few more example project layouts and theircargo metadata
output: https://github.com/kofigumbs/src-tauri-workspace.Stack Trace
N/A
The text was updated successfully, but these errors were encountered: