Hey @TooTallNate, any chance you can share how you compiled hacbrewpack to wasm?
I'm trying to compile it myself for wasm, but struggling to find the right combination of options that will get it to run properly...
Currently I have this:
# in addition to the default config.mk.template:
CC = emcc
CFLAGS += -flto -Os
LDFLAGS += -s ENVIRONMENT='web,webview,worker,node'
LDFLAGS += -s MODULARIZE=1 -s "EXPORT_NAME='hacbrewpack'"
LDFLAGS += -s EXPORTED_RUNTIME_METHODS='callMain'
LDFLAGS += -s EXPORT_ES6=1
However, when I run it from JS I get these errors:
warn: renderer.ts:46 Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)
error: hacbrewpack.wasm:0x10d9 Uncaught (in promise) RuntimeError: memory access out of bounds
at hacbrewpack.wasm:0x10d9
at hacbrewpack.wasm:0x973d
at hacbrewpack.js:653:12
at Object.callMain (hacbrewpack.js:4910:15)
at renderer.ts:48:36
Hey @TooTallNate, any chance you can share how you compiled hacbrewpack to wasm? I'm trying to compile it myself for wasm, but struggling to find the right combination of options that will get it to run properly...
Currently I have this:
However, when I run it from JS I get these errors:
here's my JS
```js import loadHacBrewPack from './public/hacbrewpack'; loadHacBrewPack({ print(v) { console.log(v); }, printErr(v) { console.warn(v); }, }).then((wasm) => console.log(wasm.callMain(["wasm", "--help"]))); ```