From 466a31590eb94c44cc55eb5793a6bf171d5ce242 Mon Sep 17 00:00:00 2001 From: Benjamin Eckel Date: Thu, 11 Jan 2024 18:37:52 -0600 Subject: [PATCH] fix: better error message when wasm-merge not found --- Cargo.toml | 2 +- crates/cli/src/main.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a15c653..5210c25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ ] [workspace.package] -version = "1.0.0-rc4" +version = "1.0.0-rc5" edition = "2021" authors = ["The Extism Authors"] license = "BSD-Clause-3" diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 0d47443..a650fd4 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -110,6 +110,11 @@ fn main() -> Result<()> { &import_shim_path, )?; + let output = Command::new("wasm-merge").arg("--version").output(); + if let Err(_) = output { + bail!("Failed to execute wasm-merge. Please install binaryen and make sure wasm-merge is on your path: https://github.com/WebAssembly/binaryen"); + } + // Merge the export shim with the core module let mut command = Command::new("wasm-merge") .arg(&core_path)