binaryen.js icon indicating copy to clipboard operation
binaryen.js copied to clipboard

Binaryen moving away from `-sSINGLE_FILE` by default

Open sbc100 opened this issue 4 months ago • 2 comments

See https://github.com/WebAssembly/binaryen/pull/7985

I'm guessing that binaryen.js wants to ship a single file without a .wasm on the side? But maybe not in all cases?

It looks like you already specify -sSINGLE_FILE in your CI so maybe there is nothing to do here?

https://github.com/AssemblyScript/binaryen.js/blob/ccf7d1e09a151166a96c626a69c594ad8bf84f10/.github/workflows/build.yml#L19

You could switch that to -DEMSCRIPTEN_ENABLE_SINGLE_FILE but I don't know if make much odds.

This is mostly and FYI bug, feel free to close if there is no action needed at this end.

sbc100 avatar Oct 23 '25 22:10 sbc100

It depends on how Emscripten fetches the Wasm module; if removing -sSINGLE_FILE doesn't play well with bundlers, it might be better to keep it there (I am assuming the generated code works fine for Node.js and such). I need to look into this more.

Tangent: -sSINGLE_FILE_BINARY_ENCODE (if it's not already enabled through the default Emscripten options) might be of interest if we need to stay with -sSINGLE_FILE.

CountBleck avatar Oct 24 '25 03:10 CountBleck

(-sSINGLE_FILE_BINARY_ENCODE is enabled by default but yes it will help with all users of -sSINGLE_FILE)

sbc100 avatar Oct 24 '25 17:10 sbc100