Skip to content
  • Koute's avatar
    Build the standard library crates when building the runtimes (#2217) · 2610450a
    Koute authored
    Our executor currently only supports the WASM MVP feature set, however
    nowadays when compiling WASM the Rust compiler has more features enabled
    by default.
    
    We do set the `-C target-cpu=mvp` flag to make sure that *our* code gets
    compiled in a way that is compatible with our executor, however this
    doesn't affect Rust's standard library crates (`std`, `core` and
    `alloc`) which are by default precompiled and still can make use of
    these extra features.
    
    So in this PR we force the compiler to also compile the standard library
    crates for us to make sure that they also only use the MVP features.
    
    I've added the `WASM_BUILD_STD` environment variable which can be used
    to disable this behavior if set to `0`.
    
    Unfortunately this *will* slow down the compile times when building
    runtimes, but there isn't much that we can do about that.
    
    Fixes https://github.com/paritytech/polkadot-sdk/issues/1755
    
    
    
    ---------
    
    Co-authored-by: default avatarBastian Köcher <[email protected]>
    2610450a