`wasm-opt` download fails with "Unrecognized target!" on Windows ARM64, despite binaryen publishing an arm64-windows build
Bug description
wasm-pack build hard-fails on Windows ARM64 when it tries to download wasm-opt:
Error: no prebuilt wasm-opt binaries are available for this platform: Unrecognized target!
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.The root cause is in prebuilt_url_for. Its (Os, Arch, Tool) match table has no case for (Os::Windows, Arch::AArch64, _) at all, so it falls through to bail!("Unrecognized target!")
This isn't actually a case of no binary existing as binaryen's own releases already publish an arm64-windows build (e.g. binaryen-version_132-arm64-windows.tar.gz, https://github.com/WebAssembly/binaryen/releases), following the exact same - naming convention already used for the other entries in this table ("arm64-macos", "x86_64-windows").
Adding:
(Os::Windows, Arch::AArch64, Tool::WasmOpt) => "arm64-windows",
to the match table should be sufficient to fix it
Source: wasm-bindgen/wasm-pack