From 66a88c26a88dd5dc94821ad6438a92b8ae18a713 Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Mon, 21 Nov 2022 09:01:26 +0100 Subject: [PATCH] Use `.wasm` extension when building for wasm in cargo-miri WASM uses the `.wasm` file extension for its binaries (just like how windows uses `.exe`), so we need to set that as well. --- cargo-miri/src/phases.rs | 3 ++- ci.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cargo-miri/src/phases.rs b/cargo-miri/src/phases.rs index df36041c75..64b3187305 100644 --- a/cargo-miri/src/phases.rs +++ b/cargo-miri/src/phases.rs @@ -281,9 +281,10 @@ pub fn phase_rustc(mut args: impl Iterator, phase: RustcPhase) { eprintln!("[cargo-miri rustc] writing run info to `{}`", filename.display()); } info.store(&filename); - // For Windows, do the same thing again with `.exe` appended to the filename. + // For Windows and WASM, do the same thing again with `.exe`/`.wasm` appended to the filename. // (Need to do this here as cargo moves that "binary" to a different place before running it.) info.store(&out_filename("", ".exe")); + info.store(&out_filename("", ".wasm")); }; let runnable_crate = !info_query && is_runnable_crate(); diff --git a/ci.sh b/ci.sh index e528be8b03..991463ec86 100755 --- a/ci.sh +++ b/ci.sh @@ -103,6 +103,7 @@ case $HOST_TARGET in MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple atomic data_race env/var MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic + MIRI_TEST_TARGET=wasm32-wasi MIRI_NO_STD=1 run_tests_minimal no_std # supports std but miri doesn't support it MIRI_TEST_TARGET=thumbv7em-none-eabihf MIRI_NO_STD=1 run_tests_minimal no_std # no_std embedded architecture ;; x86_64-apple-darwin)