Skip to content

Commit 23207cc

Browse files
committed
Fix the Pages build: install wasm-bindgen-cli at the Cargo.lock version
The workflow pinned wasm-bindgen-cli 0.2.100 while the wasm module linked wasm-bindgen 0.2.126, and the bindgen schema must match exactly, so the deploy failed at the bindings step. Read the version out of Cargo.lock at install time so the CLI and the crate can never drift apart again.
1 parent 2dfc0f9 commit 23207cc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/pages.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ jobs:
3030
with:
3131
targets: wasm32-unknown-unknown
3232
- name: Install wasm-bindgen-cli
33-
run: cargo install wasm-bindgen-cli --version 0.2.100 --locked || cargo install wasm-bindgen-cli --locked
33+
# The CLI's bindgen schema must exactly match the wasm-bindgen crate the wasm module was
34+
# built against, so read the version from Cargo.lock rather than pinning it here, and the
35+
# two can never drift apart.
36+
run: |
37+
VERSION=$(grep -A1 'name = "wasm-bindgen"' Cargo.lock | grep version | head -1 | cut -d'"' -f2)
38+
echo "wasm-bindgen crate version from Cargo.lock: $VERSION"
39+
cargo install wasm-bindgen-cli --version "$VERSION" --locked
3440
- name: Build web artifacts
3541
run: ./tools/build_web.sh
3642
- uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)