Skip to content

Bump wasm-opt to binaryen version_130 for wide-arithmetic support - #83

Merged
Arshia001 merged 2 commits into
mainfrom
bump-binaryen
Jul 15, 2026
Merged

Bump wasm-opt to binaryen version_130 for wide-arithmetic support#83
Arshia001 merged 2 commits into
mainfrom
bump-binaryen

Conversation

@Arshia001

Copy link
Copy Markdown
Contributor

0.1.30 enables +wide-arithmetic by default (#75), but the pinned binaryen version_123 predates the wide-arithmetic proposal and cannot parse the resulting wasm:

[parse exception: unknown misc operation: 22 (at 0:127094)]
Fatal: error parsing wasm (try --debug for more info)

(misc op 22 = i64.mul_wide_u.) This breaks cargo wasix build post-processing for any project whose dependency tree emits wide-arithmetic ops — a plain axum = "0.8" hello-world hits it. This makes 0.1.30 a broken release for affected projects and should ship as 0.1.31 promptly.

Verified with binaryen version_130 (current latest): parses and processes the same wasm cleanly (including --translate-to-exnref), and the processed axum server runs under wasmer and serves requests. All four platform archives (x86_64-linux, x86_64/arm64-macos, x86_64-windows) exist for version_130 with the same layout, and the per-version cache directory (~/.cache/cargo-wasix/<version>/wasm-opt) means upgraded installs download the new binary automatically.

🤖 Generated with Claude Code

Arshia001 and others added 2 commits July 15, 2026 11:27
0.1.30 enables +wide-arithmetic by default (#75), but the pinned
binaryen version_123 predates the proposal and fails to parse the
resulting wasm ("unknown misc operation: 22" — i64.mul_wide), breaking
post-processing for any project whose dependencies emit those ops
(axum's tree does). version_130 parses and processes them fine, and the
processed binaries run under wasmer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both flags exist since binaryen's May 2024 rename (#6592), but
--translate-to-exnref is an ordinary pass executed at its position on
the command line, while --emit-exnref always runs the translation at
the end of the whole pipeline — the robust choice (and the one wasixcc
uses), immune to argument reordering.

Note this does not obviate the version_130 bump: version_123 fails to
parse wide-arithmetic modules regardless of which translation flag is
used (verified: --emit-exnref on 123 hits the same "unknown misc
operation: 22" parse exception).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Arshia001

Copy link
Copy Markdown
Contributor Author

Also switched --translate-to-exnref--emit-exnref here (same semantics for our invocation, but runs the translation at the end of the pipeline regardless of argument order — matches wasixcc). Note this doesn't remove the need for the version_130 bump: the wide-arithmetic failure is a parse error that happens when wasm-opt reads the module, before any pass runs. Verified directly: binaryen 123 with --emit-exnref fails identically (unknown misc operation: 22) on an axum debug build. Both flags have existed since binaryen's May 2024 rename (WebAssembly/binaryen#6592); 123 vs 130 is purely about the parser knowing the wide-arithmetic opcodes that rustc emits since #75.

@Arshia001
Arshia001 merged commit c9e0458 into main Jul 15, 2026
6 checks passed
@Arshia001
Arshia001 deleted the bump-binaryen branch July 15, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant