From fc3a73100b6d3f2ff6dd3da0ff14dd9185ba02f0 Mon Sep 17 00:00:00 2001 From: Mrmaxmeier <3913977+Mrmaxmeier@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:37:00 +0200 Subject: [PATCH] Update `need_wasm_shim` logic for `wasm32-wasip1` (#289) * fix unexpected cfg --> src/stream/functions.rs:58:7 | 58 | #[cfg(tests)] | ^^^^^ help: there is a config with a similar name: `test` * update `need_wasm_shim` logic for `wasm32-wasip1` The `wasm32-wasi` target is being renamed to `wasm32-wasip1` and the `wasm32-wasi` target will be removed in the future. It looks like the shim will also be useful (required?) for `wasm32-wasip2`. --- src/stream/functions.rs | 2 +- zstd-safe/zstd-sys/build.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream/functions.rs b/src/stream/functions.rs index e2aca360..45381ef0 100644 --- a/src/stream/functions.rs +++ b/src/stream/functions.rs @@ -55,5 +55,5 @@ where Ok(()) } -#[cfg(tests)] +#[cfg(test)] mod tests {} diff --git a/zstd-safe/zstd-sys/build.rs b/zstd-safe/zstd-sys/build.rs index e03f3549..e578f606 100644 --- a/zstd-safe/zstd-sys/build.rs +++ b/zstd-safe/zstd-sys/build.rs @@ -135,7 +135,7 @@ fn compile_zstd() { // See: https://github.com/gyscos/zstd-rs/pull/209 let need_wasm_shim = !cfg!(feature = "no_wasm_shim") && env::var("TARGET").map_or(false, |target| { - target == "wasm32-unknown-unknown" || target == "wasm32-wasi" + target == "wasm32-unknown-unknown" || target.starts_with("wasm32-wasi") }); if need_wasm_shim {