Skip to content

Commit a83b105

Browse files
committed
Auto merge of rust-lang#2685 - Nilstrieb:cargo-miri-wasm, r=RalfJung
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. I'm not sure whether gating this behind the wasm target is a good idea, maybe it makes more sense to always do it just like on windows.
2 parents 9f8df93 + 958d591 commit a83b105

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/tools/miri/cargo-miri/src/phases.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,10 @@ pub fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) {
281281
eprintln!("[cargo-miri rustc] writing run info to `{}`", filename.display());
282282
}
283283
info.store(&filename);
284-
// For Windows, do the same thing again with `.exe` appended to the filename.
284+
// For Windows and WASM, do the same thing again with `.exe`/`.wasm` appended to the filename.
285285
// (Need to do this here as cargo moves that "binary" to a different place before running it.)
286286
info.store(&out_filename("", ".exe"));
287+
info.store(&out_filename("", ".wasm"));
287288
};
288289

289290
let runnable_crate = !info_query && is_runnable_crate();

src/tools/miri/ci.sh

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ case $HOST_TARGET in
103103
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
104104
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple atomic data_race env/var
105105
MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic
106+
MIRI_TEST_TARGET=wasm32-wasi MIRI_NO_STD=1 run_tests_minimal no_std # supports std but miri doesn't support it
106107
MIRI_TEST_TARGET=thumbv7em-none-eabihf MIRI_NO_STD=1 run_tests_minimal no_std # no_std embedded architecture
107108
;;
108109
x86_64-apple-darwin)

0 commit comments

Comments
 (0)