Skip to content

[pull] master from rustwasm:master#11

Open
pull[bot] wants to merge 311 commits into
kzantow-rust:masterfrom
wasm-bindgen:master
Open

[pull] master from rustwasm:master#11
pull[bot] wants to merge 311 commits into
kzantow-rust:masterfrom
wasm-bindgen:master

Conversation

@pull

@pull pull Bot commented Feb 16, 2022

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? πŸ’– Please sponsor : )

printfn and others added 29 commits January 14, 2023 20:56
Fix binaryen URL and use updated `binary-install` to fix installation on macOS (adding to @matheus23's PR)
Add support for workspace inheritance
Replace two mentions of `wasm-pack init` with `wasm-pack build` in the docs
fix: adds back run.js to npm installer
This is a less extreme version of #1208, which only marks snippets and the main file on the bundler target as having side effects instead of all files.

This means that the shim file which contains the vast majority of the JS code is still properly marked as having no side effects, allowing bundlers to get rid of things like unused `new TextEncoder` calls which could theoretically have side effects but don't.

Fixes #972.
Bumps [openssl-src](https://github.com/alexcrichton/openssl-src-rs) from 111.24.0+1.1.1s to 111.25.0+1.1.1t.
- [Release notes](https://github.com/alexcrichton/openssl-src-rs/releases)
- [Commits](https://github.com/alexcrichton/openssl-src-rs/commits)

---
updated-dependencies:
- dependency-name: openssl-src
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Docs: Update npm installation link
…11.25.01.1.1t

chore(deps): bump openssl-src from 111.24.0+1.1.1s to 111.25.0+1.1.1t
- First, show only the instructions specific to the detected platform.

- Then, always display the cargo, npm, and yarn install options below.

- Add a note to the unix instructions to say you can use the
  alternative options if you don't like piping `curl` into `sh`.

Fixes #355
Mark snippets and the bundler target's main file as having side effects
Update actions/checkout in GitHub Actions workflows to v3
Update actions/cache in GitHub Actions workflows to v3
…on-update

Update JamesIves/github-pages-deploy-action in GHA workflow to v4.4.1
…nimatch-3.1.2

chore(deps): bump minimatch from 3.0.4 to 3.1.2 in /npm
drager and others added 30 commits January 12, 2026 12:37
Bumps [time](https://github.com/time-rs/time) from 0.3.45 to 0.3.47.
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](time-rs/time@v0.3.45...v0.3.47)

---
updated-dependencies:
- dependency-name: time
  dependency-version: 0.3.47
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
- Parameterize target triple in cargo_build_wasm() and cargo_build_wasm_tests()
- Extract --target from extra_options in build and test commands
- Add --enable-memory64 to wasm-opt args for wasm64 targets
- Construct CARGO_TARGET_*_RUNNER env var dynamically from target triple
- Pass target triple through to cargo_test_wasm()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…match-3.1.5

chore(deps): bump minimatch from 3.1.2 to 3.1.5 in /npm
chore(deps): bump time from 0.3.45 to 0.3.47
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.44 to 0.4.45.
- [Commits](composefs/tar-rs@0.4.44...0.4.45)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 0.4.45
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
chore(deps): bump tar from 0.4.44 to 0.4.45
Add wasm64-unknown-unknown target support
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.12 to 1.1.14.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v1.1.12...v1.1.14)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [rustls-webpki](https://github.com/rustls/webpki) from 0.103.9 to 0.103.13.
- [Release notes](https://github.com/rustls/webpki/releases)
- [Commits](rustls/webpki@v/0.103.9...v/0.103.13)

---
updated-dependencies:
- dependency-name: rustls-webpki
  dependency-version: 0.103.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.11 to 1.16.0.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.11...v1.16.0)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-version: 1.16.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Adds a new --panic-unwind option to `wasm-pack build` and `wasm-pack test`
that builds with `-Cpanic=unwind` instead of the default `panic=abort`.

When the flag is set, cargo is invoked via `+nightly` with
`-Z build-std=std,panic_unwind` and `RUSTFLAGS` is augmented with
`-Cpanic=unwind` (preserving any user-provided `RUSTFLAGS`). The nightly
toolchain, `rust-src` component, and nightly `wasm32-unknown-unknown`
target are auto-installed via `rustup` if not already present. The stable
rustc and wasm-target preflight checks are skipped when --panic-unwind is
set, since they are irrelevant for the nightly invocation.

This is a build-tool-level enabler: it produces a wasm artifact compiled
with unwinding semantics. The actual conversion of caught panics into
JavaScript exceptions is the responsibility of the consuming bindings layer
(e.g. wasm-bindgen's catch-unwind support).
…ION (#1578)

Two bugs broke `curl https://wasm-bindgen.github.io/wasm-pack/installer/init.sh -sSf | sh`:

1. The arg-parsing block introduced in 15e4f4f used bash arrays
   (`ORIG_ARGS=("$@")` / `"${ORIG_ARGS[@]}"`), so any non-bash POSIX
   shell (dash, ash, BusyBox sh) failed with a syntax error. This is
   issue #1527.

2. `docs/_installer/build-installer.rs` does a literal `$VERSION` ->
   `vX.Y.Z` text replacement on the script. Since 15e4f4f also added
   real `$VERSION` shell expansions (`if [ -z "$VERSION" ]`, the
   `case "$VERSION"`, etc.), every one of those got mangled in the
   published artifact, e.g. `if [ -z "v0.14.0" ]` and
   `VERSION="vv0.14.0"`. The runtime --version / VERSION-env override
   has been silently broken in every published release since.

This commit:

* switches the build-time placeholder to `@@WASM_PACK_VERSION@@` so it
  cannot collide with real shell variable references (both in init.sh
  and index.html).
* rewrites init.sh as POSIX sh: no arrays, no `local`, scans args via
  `for _arg in "$@"` without consuming them so they still pass
  through to wasm-pack-init.
* keeps the precedence: explicit `VERSION=` env > `--version X` arg >
  build-time baked version > "latest" (resolved via GitHub API).

Verified syntax-clean and behaviourally correct under dash, /bin/sh,
and bash for piped invocation (`curl ... | sh`), `sh -s -- --version
X`, env override, and arg passthrough.

Supersedes #1550, closes #1527.
…ish (#1579)

The published `wasm-pack` npm package is broken on the registry: 0.14.0
shipped with the old `drager/wasm-pack` release URL and was never
republished after the repository moved. `npm install -g wasm-pack` fails
with a 404 against
`github.com/drager/wasm-pack/releases/download/v0.14.0/...`.

The fix for the URL has been on master since 5f48264, but there is no
automation to actually publish to npm, so every release since requires a
maintainer to run `npm publish` by hand and 0.14.0 has stayed broken.

While here, replace the `binary-install` dependency, which the author
deprecated in 2025 and which transitively pulls in unmaintained
`rimraf@3`, `glob@7`, `inflight`, and `tar@6` (all of which trigger
`npm warn deprecated` lines during install).

Changes:

* npm/binary.js: inline the install/run logic (~110 lines). Uses Node
  stdlib `https` with manual redirect handling to fetch the release
  tarball, then `tar` (v7, actively maintained) to extract. Same public
  shape as before (`install()`, `run()`).
* npm/package.json: drop `binary-install`, promote `tar` from
  `resolutions` to a real `dependencies` entry, add an `engines` and a
  `files` allowlist so the package only ships the four files it needs.
* npm/yarn.lock: regenerated. 292 lines down to 43, no deprecated deps.
* .github/workflows/release.yml: add an `npm-publish` job that runs
  after the existing GitHub release job on tag pushes. Syncs the
  package version to the tag and publishes with provenance. Gated on
  `github.repository == 'wasm-bindgen/wasm-pack'` so forks can't
  accidentally publish. Requires a one-time `NPM_TOKEN` repo secret
  from the owner of the `wasm-pack` npm package.

Verified locally: `npm install` and `yarn install` both succeed with
zero deprecation warnings, post-install fetches from the correct
`wasm-bindgen/wasm-pack` URL, and `node run.js --version` invokes the
extracted binary.
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
)

Resolves #1576.

Building for wasm64-unknown-unknown failed in two ways introduced by
#1553:

1. `rustup target add wasm64-unknown-unknown` failed because wasm64 is
   a tier-3 target with no prebuilt artifacts. Users had to work around
   this with `--mode force`.
2. The bundled wasm-opt (binaryen v117) could not parse 64-bit tables;
   support landed in binaryen v118.

The cargo target triple β€” declared in `.cargo/config.toml`,
`CARGO_BUILD_TARGET`, or as an extra cargo argument
(`-- --target wasm64-unknown-unknown`) β€” is the source of truth for
what wasm-pack builds. The target triple resolver now follows the same
precedence cargo uses (CLI > env > `.cargo/config.toml` walk-up >
`$CARGO_HOME/config.toml` > default), so wasm-pack and cargo always
agree on the target.

For tier-3 wasm targets (currently the `wasm64-*` family) wasm-pack
stays out of the cargo invocation β€” it does not inject `+nightly` or
`-Z build-std` (those would override a project's `rust-toolchain.toml`
pin or surprise users who hadn't intended a nightly build). Instead it:

* verifies the active toolchain is nightly, with a helpful error
  pointing at `rust-toolchain.toml` and `[unstable] build-std` in
  `.cargo/config.toml` if it isn't,
* installs the `rust-src` component for the active toolchain via
  rustup if missing,
* skips the `rustup target add` attempt (which always fails for tier-3
  targets),
* passes `--enable-memory64` to wasm-opt so the optimiser accepts
  64-bit memories and tables.

The bundled binaryen is bumped from `version_117` to `version_129`
(latest stable) so wasm-opt accepts 64-bit memories and tables.

`--panic-unwind` is untouched.

Tests:

* New unit test `build::tests::tier3_wasm_detection` covers the
  triple-classification helper.
* New `command::build::tests` unit tests cover the cargo-config
  walk-up resolution.
* New `wasm_opt_prebuilt_url_is_pinned_version` test guards against
  regressing the binaryen version below v118 (the first release with
  64-bit table support).
* Existing `all_latest_tool_download_urls_valid` validates the v129
  release URLs across all supported architectures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.