wasm-pack icon indicating copy to clipboard operation
wasm-pack copied to clipboard

`wasm-opt` invocation fails on Rust 1.87

Open printfn opened this issue 7 months ago • 3 comments

🐛 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

  1. Clone the repo
  2. wasm-pack build

🌍 Your environment

Include the relevant details of your environment. wasm-pack version: 0.13.1 rustc version: 1.87.0

printfn avatar May 17 '25 03:05 printfn

I'm running into the same issue: https://github.com/sunng87/handlebars-rust/actions/runs/15157921162/job/42617024966

sunng87 avatar May 21 '25 09:05 sunng87

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"]

darioAnongba avatar May 21 '25 17:05 darioAnongba

[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?

reneleonhardt avatar Jun 12 '25 07:06 reneleonhardt