Open F8RZD opened 1 month ago
Sorry for the late response. I seem to have overlooked this one.
Right now, as far as I remember, you can't add flags like this.
However, you can add a rust-toolchain.toml
, to choose the nightly (or other) toolchain explicitly. And you should be able to use .cargo/config
(rustflags
) to specify additional arguments.
So it should all be provided by standard Rust tooling.
I could really use an option in Trunk to pass arbitrary flags to cargo.
My use case is the same as @F8RZD, except I need to not supply those flags when building my project for non-web platforms.
The only way I've been able to find to do this is by having a separate Cargo config file .config/web.toml
and to pass --config .config/web.toml
to every Cargo command. Cargo does not provide any way to statically configure whether the build-std
feature should be used depending on the target.
I would be happy with any of the following implementations in Trunk:
trunk serve --cargo-flags "--config .config/web.toml"
TRUNK_CARGO_FLAGS="--config .config/web.toml" trunk serve
[build]
cargo_flags = ["--config .config/web.toml"]
<link rel="rust">
attribute:
<link data-trunk rel="rust" data-cargo-flags="--config .config/web.toml"
does trunk support adding nightly flags to rustc and cargo ?
I'm specifically interested in
build_std
andpanic_immediate_abort
. combination of these two practically removes all panic related boiler plate and strings reducing the binary size drastically which is an essential need in wasm.does trunk support passing those arguments?