#How to have wasm32-unknown-unknown and x86_64-unknown-linux-musl both available in a Rust project?

5 messages · Page 1 of 1 (latest)

wild cedar
#

I am trying to build a Rust frontend/backend monorepo and deploy it to Railway. I use yew for the front-end and axum for the back-end. However, building the web-assembly for the frontend fails, because wasm32-unknown-unknown target is not available. So I tried adding a rust-toolchain.toml file and declaring both targets. But that causes musl and musl-dev not to be included in nixPkgs, which causes the backend build to fail. I also tried removing the rust-toolchain.toml and declaring the rust toolchain overrides under "setup" or "phases.setup" in my railway.toml, but that key seems to be ignored. Any help would be appreciated!

hidden currentBOT
#

Project ID: d917b9da-1097-4511-9d45-103ec687b97a

wild cedar
#

d917b9da-1097-4511-9d45-103ec687b97a

hidden currentBOT
#

Try putting rustup target add wasm32-unknown-unknown somewhere in the project, and then build the project with cargo build --release --target x86_64-unknown-linux-musl.

wild cedar
#

Thanks, I'll try adding to to my buildCommand and see whether that helps.