From d2c51e3c5925493c2573d47102ed65d1e4b9409a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Tue, 10 Mar 2020 10:44:56 +0100 Subject: [PATCH] Make sure to always run `wasm-builder` for the `HOST` architecture (#5199) --- substrate/utils/wasm-builder-runner/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/substrate/utils/wasm-builder-runner/src/lib.rs b/substrate/utils/wasm-builder-runner/src/lib.rs index 6366c1ce37..0e4b1421f8 100644 --- a/substrate/utils/wasm-builder-runner/src/lib.rs +++ b/substrate/utils/wasm-builder-runner/src/lib.rs @@ -428,6 +428,10 @@ fn run_project(project_folder: &Path) { cmd.arg("--release"); } + // Make sure we always run the `wasm-builder` project for the `HOST` architecture. + let host_triple = env::var("HOST").expect("`HOST` is always set when executing `build.rs`."); + cmd.arg(&format!("--target={}", host_triple)); + // Unset the `CARGO_TARGET_DIR` to prevent a cargo deadlock (cargo locks a target dir exclusive). // The runner project is created in `CARGO_TARGET_DIR` and executing it will create a sub target // directory inside of `CARGO_TARGET_DIR`.