Skip to content

Fix RuntimeError: Aborted after rebuild and verbose flag - #15

Open
jquast wants to merge 1 commit into
SimHacker:mainfrom
jquast:up-fix-node-loader-wasmbinary
Open

jquast wants to merge 1 commit into
SimHacker:mainfrom
jquast:up-fix-node-loader-wasmbinary

Conversation

@jquast

@jquast jquast commented Sep 29, 2026

Copy link
Copy Markdown

micropolis sim smoke fails by abort after make:

RuntimeError: Aborted(`Module.wasmBinary` was supplied but `wasmBinary` not included in INCOMING_MODULE_JS_API)

The glue aborts for any incoming module property the build left out of INCOMING_MODULE_JS_API, and wasmBinary is one. The committed artifacts came from a build whose list still had it, so this shows up after make clean install replaces them. The glue loads the wasm through locateFile('micropolisengine.wasm'), so the loader's three wasmBinary lines are dead weight and removed.

Existing PRs #12 and #14 fix the same abort by declaring wasmBinary in INCOMING_MODULE_JS_API; this patch changes only the loader.

The loader also passed print and printErr as no-ops, so the engine's own output never reached the terminal. Both now follow the global -v flag, which subsequent PR fixes need to confirm their fixes:

$ cd apps/micropolis
$ node_modules/.bin/tsx cli/entry.ts sim smoke --ticks 10 -v
initdestroyMapArrays: mapBase: 0x27480

loadMicropolisMainModule passed Module.wasmBinary. Emscripten accepts
that option only when wasmBinary is listed in INCOMING_MODULE_JS_API, and
the current default list omits it, so a build made with the current
Emscripten aborted before anything ran:

    RuntimeError: Aborted(`Module.wasmBinary` was supplied but
    `wasmBinary` not included in INCOMING_MODULE_JS_API)

The committed artifacts predate that default, so the failure appears only
once `make install` regenerates them. The loader now takes the wasm from
locateFile, which reads micropolisengine.wasm from disk next to the glue.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant