tauri
tauri copied to clipboard
[feat][v2] add cli option to switch to +stable compiler
Describe the problem
It occurred to a colleague of mine that npm run tauri build
uses a default rust compiler. Would it be possible to have an option to add a flag to build with +stable
compiler? Since most devs run nightly, it's a bit cumbersome to switch to stable each time when running a build script, people tend to forget and half of our script that prebuilds other binaries simply runs compilation with cargo +stable
, but we have no control over tauri build.
Describe the solution you'd like
Maybe a --stable
option to enforce compilation with stable rust
Alternatives considered
Doing rustup default toolchain switcheroo but it's a bit tricky as it changes it system wide.
Currently trying a --runner
option with a proxy script towards cargo +stable
:
#!/bin/bash
cargo +stable $@
Update: the script above breaks on Git Bash/Windows with: Error failed to build app: %1 is not a valid Win32 application. (os error 193)
Additional context
No response
Maybe when building for production, you must use the stable
channel by default. And only if --nightly
is passed, then use nightly. Or maybe add --default-channel
to use the current implementation of using the default channel.
You can override it using the environment variable RUSTUP_TOOLCHAIN
see https://rust-lang.github.io/rustup/overrides.html