mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
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:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user