Describe the bug
Running cargo tauri dev -- -- --myoption causes tauri to pass --no-default-features to my application. That means cargo build doesn't get that flag, and it means my application crashes because clap isn't expecting the --no-default-features flag in my application.
This seems to be due to this code:
|
options.args.push("--no-default-features".into()); |
After that line the rest of the function splits up args into args and run_args by looking for --. Since --no-default-features is pushed onto args beforehand, it will incorrectly end up in run_args.
Likely the code that pushes --no-default-features should either use an insert to put the flag at the beginning of args, or the push needs to occur after run_args has been split off.
Reproduction
No response
Expected behavior
No response
Platform and versions
Environment
› OS: Mac OS 12.6.0 X64
› Node.js: 18.10.0
› npm: 8.19.2
› pnpm: Not installed!
› yarn: Not installed!
› rustup: 1.25.1
› rustc: 1.64.0
› cargo: 1.64.0
› Rust toolchain: stable-aarch64-apple-darwin
Packages
› @tauri-apps/cli [NPM]: 1.1.1
› @tauri-apps/api [NPM]: 1.1.0
› tauri [RUST]: 1.1.1,
› tauri-build [RUST]: 1.1.1,
› tao [RUST]: 0.14.0,
› wry [RUST]: 0.21.1,
App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
› framework: React
App directory structure
├─ dist
├─ node_modules
├─ public
├─ src-tauri
├─ .vscode
└─ src
Stack trace
No response
Additional context
No response
Describe the bug
Running
cargo tauri dev -- -- --myoptioncauses tauri to pass--no-default-featuresto my application. That meanscargo builddoesn't get that flag, and it means my application crashes becauseclapisn't expecting the--no-default-featuresflag in my application.This seems to be due to this code:
tauri/tooling/cli/src/interface/rust.rs
Line 303 in 4036e15
After that line the rest of the function splits up
argsintoargsandrun_argsby looking for--. Since--no-default-featuresispushed ontoargsbeforehand, it will incorrectly end up inrun_args.Likely the code that pushes
--no-default-featuresshould either use an insert to put the flag at the beginning ofargs, or the push needs to occur afterrun_argshas been split off.Reproduction
No response
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response