Remove substrate-wasm-builder

By defining our own build script, we gain complete clarity and control over how
the WASM is built. This also removes the need to patch the upstream due to it
allowing pollution of the environment variables from the host.

Notable appreciation is given to
https://github.com/rust-lang/rust/issues/145491 for identifying an issue
encountered here, with the associated PR clarifying the necessary flags for the
linker to fix this.
This commit is contained in:
Luke Parker
2025-12-04 20:07:52 -05:00
parent 36ac9c56a4
commit b791256648
7 changed files with 104 additions and 90 deletions

View File

@@ -20,5 +20,9 @@ mod std_runtime_api;
pub use std_runtime_api::RuntimeApi;
// If this isn't WASM, regardless of what it is, we include the WASM blob from the build script
#[cfg(not(target_family = "wasm"))]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
#[cfg(all(not(target_family = "wasm"), debug_assertions))]
pub const WASM: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/target/wasm32v1-none/debug/serai_runtime.wasm"));
#[cfg(all(not(target_family = "wasm"), not(debug_assertions)))]
pub const WASM: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/target/wasm32v1-none/release/serai_runtime.wasm"));