From 9f68c698cc3442425b57c43a95868fa4d386aadc Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Wed, 20 May 2026 11:00:08 -0700 Subject: [PATCH] fix(install): use prebuilt wasm-bindgen binary on macOS aarch64 Previously wasm-pack built wasm-bindgen-cli from source on Apple Silicon because the macOS aarch64 match arm only covered cargo-generate and wasm-opt. wasm-bindgen publishes an aarch64-apple-darwin tarball for every release, so fall through to that target for any tool other than wasm-opt (which uses the binaryen 'arm64-macos' naming). Also enable the can_download_prebuilt_wasm_bindgen test on macos/aarch64 so the new code path is exercised in CI. Fixes #1581 --- CHANGELOG.md | 9 +++++++++ src/install/mod.rs | 2 +- tests/all/download.rs | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed9dd567..9d92e222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## 🤍 Unreleased +- ### 🤕 Fixes + + - **Use prebuilt wasm-bindgen binary on macOS aarch64 - [guybedford], [pull/1585]** + + Previously wasm-pack built `wasm-bindgen-cli` from source on Apple Silicon. The + prebuilt `aarch64-apple-darwin` release is now used directly. + + [pull/1585]: https://github.com/wasm-bindgen/wasm-pack/pull/1585 + ## 🌷 0.15.0 - ### ✨ Features diff --git a/src/install/mod.rs b/src/install/mod.rs index c0feb0ef..8f3b5468 100644 --- a/src/install/mod.rs +++ b/src/install/mod.rs @@ -180,8 +180,8 @@ pub fn prebuilt_url_for(tool: &Tool, version: &str, arch: &Arch, os: &Os) -> Res (Os::Linux, Arch::X86_64, _) => "x86_64-unknown-linux-musl", (Os::MacOS, Arch::X86_64, Tool::WasmOpt) => "x86_64-macos", (Os::MacOS, Arch::X86_64, _) => "x86_64-apple-darwin", - (Os::MacOS, Arch::AArch64, Tool::CargoGenerate) => "aarch64-apple-darwin", (Os::MacOS, Arch::AArch64, Tool::WasmOpt) => "arm64-macos", + (Os::MacOS, Arch::AArch64, _) => "aarch64-apple-darwin", (Os::Windows, Arch::X86_64, Tool::WasmOpt) => "x86_64-windows", (Os::Windows, Arch::X86_64, _) => "x86_64-pc-windows-msvc", _ => bail!("Unrecognized target!"), diff --git a/tests/all/download.rs b/tests/all/download.rs index 7042daac..ebf040ad 100644 --- a/tests/all/download.rs +++ b/tests/all/download.rs @@ -4,6 +4,7 @@ use wasm_pack::install::{self, Arch, Os, Tool}; #[cfg(any( all(target_os = "linux", target_arch = "x86_64"), all(target_os = "macos", target_arch = "x86_64"), + all(target_os = "macos", target_arch = "aarch64"), all(windows, target_arch = "x86_64"), ))] fn can_download_prebuilt_wasm_bindgen() {