fix(install): use prebuilt wasm-bindgen binary on macOS aarch64#1585
Merged
guybedford merged 1 commit intoMay 22, 2026
Merged
Conversation
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 wasm-bindgen#1581
1d199ec to
9f68c69
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes wasm-pack download the prebuilt wasm-bindgen-cli release on macOS aarch64 instead of falling back to building from source, resolves #1581.
On Apple Silicon the existing match arm only covered cargo-generate and wasm-opt, so wasm-bindgen fell through to
_ => bail!(\"Unrecognized target!\")and wasm-pack ended up invokingcargo install. wasm-bindgen has publishedaarch64-apple-darwintarballs since 0.2.100, so we can just point at those.The change collapses the two MacOS aarch64 arms into a wasm-opt-specific one plus a catch-all that returns
aarch64-apple-darwinfor every other tool:becomes:
The existing
can_download_prebuilt_wasm_bindgentest is now also enabled on macos/aarch64 so the new code path is actually exercised, alongsideall_latest_tool_download_urls_validwhich already iterates every (tool, arch, os) combination and HEAD-checks the URL.Verified locally on Apple Silicon - all three download tests pass, including the new aarch64 wasm-bindgen download.