ci: pin binaryen / wasm-opt for deterministic WASM builds (SQLR-58)#138
Merged
Conversation
`jetli/wasm-pack-action` and wasm-pack's curl-installer both let wasm-pack pick whatever binaryen its internal cache happens to hold. When that copy predates multi-table WASM support, wasm-opt rejects rustc output with "Only 1 table definition allowed in MVP" — a flake whose hit/miss depended on runner image cache state (first surfaced on PR #135; rerun passed). Pin binaryen to version_122 in both the ci.yml `wasm-build` and release.yml `publish-wasm` jobs by downloading the official tarball before wasm-pack runs and prepending it to PATH. wasm-pack auto-detects wasm-opt on PATH, so no further wiring needed. Bump procedure documented in docs/release-plan.md so future-me knows to update both workflows in lockstep. Verified locally on darwin-arm64: `wasm-pack build --target web --release` reports `[INFO]: found wasm-opt at ".../binaryen-version_122/bin/wasm-opt"` and builds a 2.14 MiB bundle (in line with prior sizes). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
binaryen(provideswasm-opt) toversion_122in bothci.yml(wasm-build) andrelease.yml(publish-wasm) by downloading the official GitHub release tarball beforewasm-packruns and prepending it toPATH.wasm-packauto-detectswasm-optonPATH(and falls back to its internal binaryen cache otherwise) — so this single change is enough to force a deterministicwasm-optacross runner image cache states.Why
PR #135 flaked with:
Root cause:
jetli/wasm-pack-actionandwasm-pack's curl-installer both letwasm-packuse whatever binaryen its per-runner cache happens to hold. Older binaryen rejects rustc's multi-table WASM output. The same commit shipped successfully on a rerun (different cache state) and via the release pipeline — proving it's a binaryen-version flake, not a code regression. The release pipeline can't tolerate this: a failedpublish-wasmleaves the release wave inconsistent.Why option 2 (pin via tarball)
wasm-pack, which itself picks the binaryen version. No newer tag ofjetli/wasm-pack-actionsolves the binaryen problem.wasm-opt's size optimization, removes the cache-roulette behavior, and turns binaryen bumps into a deliberate two-file diff.Verified locally
wasm-pack build --target web --releasewith the pinned binaryen on PATH:Output bundle: 2.14 MiB — in line with prior sizes (the v0.10.0 release WASM bundle was ~2.1 MiB).
Test plan
wasm-buildjob passes on this PR.wasm-opt version 122 (version_122)in the "Install pinned binaryen" + "wasm-pack build" steps.wasm-buildjob 2–3 times — pass on each run (proving determinism).release.yml'spublish-wasmpath will be exercised on the next release wave; expectation is the sameversion_122line in the build log.Follow-ups (separate PRs)
sdk/wasm/Cargo.lockis stale — it still pins internal crates at0.1.23whileCargo.tomlis at0.10.0. The 0.10.0 bump didn't touch it becausesdk/wasm/is its own workspace andscripts/bump-version.shdoesn'tcargo buildinside it. Spinning that off into its own ticket; out of scope here.🤖 Generated with Claude Code