Open wooden-worm opened 3 months ago
I think all Rust based options would go here: https://github.com/trunk-rs/trunk/blob/d61478448bd093449708b63dcb3e7baf286a191c/src/pipelines/rust/mod.rs
Extracted by https://github.com/trunk-rs/trunk/blob/d61478448bd093449708b63dcb3e7baf286a191c/src/pipelines/rust/mod.rs#L123 from the link
element for rust
.
I think having the ability to request the default would be good. But it might also be good to have the ability to just specify that target. Maybe that can be combined with a magic value (like target=*
) to fall back to the default (vs trunk's default of wasm32).
Having a target
config option sounds good to me. I think we can just have the default value of wasm32-unknown-unknown
, which works as it does now. Adding support for others could come later. Until then, having a none
option would also unblock other targets?
Might be tricky to have a default value and None
at the same time. That's why I had the idea of *
(or some other magic string).
Problem
Trunk is currently hard coded to build for
wasm32-unknown-unknown
, making it hard to work with other wasm targets (wasm64
,wasi
targets)Solution
A simple way to unblock other wasm targets is to provide an option to disable the default
wasm32
build. I think adefault_build = true
entry inTrunk.toml
would suffice. If the option is explicitly set tofalse
, we just don't add the defaultwasm32
build here https://github.com/trunk-rs/trunk/blob/d61478448bd093449708b63dcb3e7baf286a191c/src/pipelines/html.rs#L150See this discussion for more context.
If this is the right approach I can work on a PR.