From 1f210885914fd1a31b76852f5dbfd9f9453cb8a0 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 21 Mar 2024 11:48:08 -0400 Subject: [PATCH] Normalize `-` to `_` in resulting Wasm file names (#9644) This PR updates the extension builder to normalize `-` to `_` in the Rust package names when computing the resulting `.wasm` file name. The `wasm32-wasi` target does this normalization internally already, so we need to do the same to ensure we're looking for the resulting `.wasm` file in the right spot. Release Notes: - N/A --- crates/extension/src/extension_builder.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/extension/src/extension_builder.rs b/crates/extension/src/extension_builder.rs index af32921b510f95954e5ce3e24a7d752f319ac7a0..21a0b7ece731e4b967a38197aca9f771f978e6bb 100644 --- a/crates/extension/src/extension_builder.rs +++ b/crates/extension/src/extension_builder.rs @@ -138,7 +138,11 @@ impl ExtensionBuilder { "target", RUST_TARGET, if options.release { "release" } else { "debug" }, - cargo_toml.package.name.as_str(), + &cargo_toml + .package + .name + // The wasm32-wasi target normalizes `-` in package names to `_` in the resulting `.wasm` file. + .replace('-', "_"), ]); wasm_path.set_extension("wasm");