From 3fcf2094f114c4fb978c23a2b231512f8e17b80b Mon Sep 17 00:00:00 2001 From: kingchenc Date: Sat, 23 May 2026 23:00:13 +0200 Subject: [PATCH] ci(wasm): install wasm-pack via taiki-e prebuilt instead of jetli's stale 0.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jetli/wasm-pack-action@v0.4.0 with no version: input installs whatever wasm-pack the action's bundled installer fetches — currently a ~0.10.x release whose 'build' subcommand does not yet accept --features. Our build invocation 'wasm-pack build … --features panic-hook' now fails with error: Found argument '--features' which wasn't expected, or isn't valid in this context USAGE: wasm-pack build --release --target even though that exact command worked on past runs where the action happened to install a newer wasm-pack. (The bundler-target release.yml job passed for v0.2.1 only because it shared the same cached install on that runner.) wasm-pack's --features top-level flag has been stable since 0.12.0, so the fix is to install a fresh wasm-pack each run. Switch both the ci.yml 'WASM build' step and the release.yml 'wasm-publish' job to the same taiki-e/install-action prebuilt-binary installer we already use for cargo-llvm-cov and cargo-fuzz. taiki-e tracks the latest wasm-pack release and the install is a single binary download — no compile, no shell installer. The wasm-pack invocations themselves are unchanged. --- .github/workflows/ci.yml | 11 ++++++++++- .github/workflows/release.yml | 7 ++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 881bb63d..ed228fb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -250,7 +250,16 @@ jobs: uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - name: Install wasm-pack - uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa # v0.4.0 + # jetli/wasm-pack-action@v0.4.0 with no `version:` input installs an + # old wasm-pack (~0.10.x) whose `build` subcommand does not yet accept + # `--features`, so `wasm-pack build … --features panic-hook` fails + # with "Found argument '--features' which wasn't expected". Use the + # same taiki-e prebuilt-binary installer we already use for + # cargo-llvm-cov and cargo-fuzz; it tracks the latest wasm-pack + # release, which has `--features` as a top-level flag (since 0.12). + uses: taiki-e/install-action@6c1f7cf125e42770ff087ea443901b487cc5471a # v2.79.5 + with: + tool: wasm-pack - name: Build WASM package run: wasm-pack build bindings/wasm --target web --release --features panic-hook diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db957e70..629d1302 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -370,7 +370,12 @@ jobs: with: targets: wasm32-unknown-unknown - - uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa # v0.4.0 + - name: Install wasm-pack (latest, via prebuilt binary) + # See the matching note in ci.yml: jetli's default installs an old + # 0.10.x wasm-pack whose build subcommand rejects --features. + uses: taiki-e/install-action@6c1f7cf125e42770ff087ea443901b487cc5471a # v2.79.5 + with: + tool: wasm-pack - name: Sync root README into bindings/wasm so wasm-pack ships it in pkg/ # wasm-pack copies the crate's README.md into the generated pkg/