Skip to content

WASM build needs RUSTFLAGS set to to work #2753

Open
@Manishearth

Description

@Manishearth

If you build the node package (built using this bash file, invoked by npm build) and try to run the wasm demo (npm run start in wasm-demo), it succeeds by default, but it fails if you remove the RUSTFLAGS in the build file.

The failure shows up as "memory access out of bounds" error. The JS web debugger points to a non-heap write for this, I don't fully trust this but it does point to it being a max stack error / stack overflow.

It still succeeds if the RUSTFLAGS are actually just set to the empty string.

We should investigate this.

Things to try:

  • Reduce the invocation and try to repro the discrepancy with a simpler set of flags
  • Try a newer compiler
  • Try reproducing this in pure node. I suspect the website is needed since the website does a lot more at once.

Couple notes:

  • Rerunning the build requires deleting lib and rerunning npm build, followed by deleting/reinstalling node_modules in the wasm-build folder via npm i
  • Worth clearing out the locally-created target dir to prevent incremental compilation from being a factor

cc @robertbastian @sffc

Metadata

Metadata

Labels

C-ffi-infraComponent: Diplomat, horizontal FFIquestionUnresolved questions; type unclear

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions