How to compile for native and wasm without erasing build artifacts?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Cargo

    The Rust package manager

  • I've encountered this before when trying to compile for different targets. I found https://github.com/rust-lang/cargo/issues/9239 which seems relevant. In my case a workaround was to pass --target explicitly when compiling for the host.

  • bus_spotting

  • I'm using a workspace: https://github.com/dabreegster/bus_spotting/blob/main/Cargo.toml But one crate (ui) can be built either for native or wasm. The tip in the other thread solved the issue -- the problem was needing to explicitly set a cargo build target.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts