diff --git a/ci/run.sh b/ci/run.sh index ea012b42f9..8c75df6afb 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -82,7 +82,7 @@ cargo_test() { else dir="debug" fi - export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/deps::." + export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/build::." cmd="$cmd --nocapture" ;; esac diff --git a/crates/core_arch/src/wasm32/simd128.rs b/crates/core_arch/src/wasm32/simd128.rs index e1a3754965..b52702f44e 100644 --- a/crates/core_arch/src/wasm32/simd128.rs +++ b/crates/core_arch/src/wasm32/simd128.rs @@ -4323,7 +4323,7 @@ mod tests { let vec = i64x2_load_extend_i32x2(arr.as_ptr()); compare_bytes(vec, i64x2(-1, 1)); let vec = i64x2_load_extend_u32x2(arr.as_ptr() as *const u32); - compare_bytes(vec, i64x2(u32::max_value().into(), 1)); + compare_bytes(vec, i64x2(u32::MAX.into(), 1)); } } diff --git a/crates/core_arch/src/x86/sse2.rs b/crates/core_arch/src/x86/sse2.rs index 5e8fe959c3..66ebec22e1 100644 --- a/crates/core_arch/src/x86/sse2.rs +++ b/crates/core_arch/src/x86/sse2.rs @@ -3332,7 +3332,7 @@ mod tests { core_arch::{simd::*, x86::*}, hint::black_box, }; - use std::{boxed, f32, f64, mem, ptr}; + use std::{boxed, mem, ptr}; use stdarch_test::simd_test; const NAN: f64 = f64::NAN; diff --git a/crates/stdarch-test/src/wasm.rs b/crates/stdarch-test/src/wasm.rs index bf411c1214..feadaa1215 100644 --- a/crates/stdarch-test/src/wasm.rs +++ b/crates/stdarch-test/src/wasm.rs @@ -2,6 +2,7 @@ use crate::Function; use std::collections::HashSet; +use std::path::Path; pub(crate) fn disassemble_myself() -> HashSet { // Use `std::env::args` to find the path to our executable. Assume the @@ -11,6 +12,27 @@ pub(crate) fn disassemble_myself() -> HashSet { let me = std::env::args() .next() .expect("failed to find current wasm file"); + let me = Path::new(&me); + let me = if me.exists() { + // Old build-dir layout + me.to_path_buf() + } else { + // Cargo's build-dir layout stores an artifact named + // `-.wasm` at `//out/-.wasm`. + // The build directory is mounted as the WASI working directory, so + // reconstruct that guest-visible path from the executable name. + let file_name = me + .file_name() + .and_then(|name| name.to_str()) + .expect("current wasm file has a file name"); + let stem = file_name + .strip_suffix(".wasm") + .expect("current wasm file does not have a .wasm extension"); + let (crate_name, hash) = stem + .rsplit_once('-') + .expect("current wasm file name does not contain an artifact hash"); + Path::new(crate_name).join(hash).join("out").join(file_name) + }; let output = wasmprinter::print_file(&me).unwrap(); let mut ret: HashSet = HashSet::new();