Skip to content

wasm32-unknown-unknown changes broke builds that assumed less features #141048

Closed as not planned
@nbittich

Description

@nbittich

After upgrading to the latest release, it looks like the llvm update broke my ci pipeline for the Wasm build.

The command that’s failing:

wasm-pack build --target nodejs --release --scope nbittich ./rdfa-wasm

Error message:

unexpected false: Bulk memory operations require bulk memory [--enable-bulk-memory], on ...

Here’s the GitHub Actions run where it failed:
https://github.com/nbittich/graph-rdfa-processor/actions/runs/15053071089

After some digging, I found this in the Rust docs (beta):
https://doc.rust-lang.org/beta/rustc/platform-support/wasm32-unknown-unknown.html

To fix it, I ended up making a few changes:

  • Added this to Cargo.toml:
    [package.metadata.wasm-pack.profile.release] 
    wasm-opt = ["-O", "--enable-bulk-memory", "--enable-mutable-globals"]
  • Also added the Rust compiler flag: -Ctarget-cpu=mvp

The commit with the fix:
nbittich/graph-rdfa-processor@f822e1e

It would be nice to mention this somewhere, maybe in the release notes, as it took me a bit to figure out what was going on. Hope this helps others who might run into the same issue.

Edit: this is rust stable (1.87.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions