Commit e2f32e5
build: enable bulk-memory in release wasm-opt
runk build --release failed with a flood of wasm-validator errors
along the lines of:
[wasm-validator error in function NNNN] unexpected false:
memory.copy operations require bulk memory operations
[--enable-bulk-memory-opt]
Trunk's bundled wasm-opt (binaryen v123) does not enable the
bulk-memory feature by default, but rustc 1.82+ (and several of our
dependencies) emit `memory.copy` instructions, so wasm-opt rejects
the staged wasm before it can be optimised.
Forward `--enable-bulk-memory` and `--enable-nontrapping-float-to-int`
to wasm-opt via Trunk's `data-wasm-opt-params` attribute on the
`rust` link in `index.html`. These are the same target features
the rustc wasm32 target enables, so the optimiser now accepts the
input and the release pipeline succeeds.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent db5f3cc commit e2f32e5
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
19 | 32 | | |
20 | 33 | | |
21 | 34 | | |
| |||
0 commit comments