Open
Description
Hi,
I'm experimenting with building WASM components with emscripten. I'm using wit-bindgen to generate C code from a wit
file, then compile everything with emcc
.
After that I run wasm-tools component new emcc-output.wasm -o component.wasm
to create the component and finally wasmtime run --invoke 'error-message(-6)' component.wasm
to run the code.
The problem is that WIT functions are kebab-case and this is currently not allowed in emscripten, see https://github.com/emscripten-core/emscripten/blob/main/tools/emscripten.py#L575
Using this .wit
world root {
export error-message: func(error-code: s32) -> string;
}
produces the error
emcc: error: invalid export name: cabi_post_error-message
For testing I patched out the check and everything seems to be working. Maybe you could allow dashes in export names for STANDALONE_WASM
or PURE_WASI
?
Metadata
Metadata
Assignees
Labels
No labels