`wasm-opt` invocation fails on Rust 1.87
🐛 Bug description
I'm getting wasm-opt errors in Rust 1.87.
Here's a minimal reproduction: https://github.com/printfn/repro/tree/rust-wasm-bulk-memory
I believe this issue is caused by the LLVM 20 upgrade in rustc.
I've found that adding additional wasm-opt flags --enable-nontrapping-float-to-int and --enable-bulk-memory seems to fix the issue. Perhaps these just need to be enabled by default?
🤔 Expected Behavior
It should have built.
👟 Steps to reproduce
- Clone the repo
wasm-pack build
🌍 Your environment
Include the relevant details of your environment. wasm-pack version: 0.13.1 rustc version: 1.87.0
I'm running into the same issue: https://github.com/sunng87/handlebars-rust/actions/runs/15157921162/job/42617024966
Yes, the description is correct for the issue (about LLVM 20+ and Rust 1.87+), see here.
Would be glad to get a wasm-pack upgrade where wasm-opt is updated to avoid these issues.
Hotfix:
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["--enable-bulk-memory", "--enable-nontrapping-float-to-int"]
[package.metadata.wasm-pack.profile.release] wasm-opt = ["--enable-bulk-memory", "--enable-nontrapping-float-to-int"]
@drager When can a Rust 1.87 fix be provided?