Skip to content

Link the 2D cores and CLI toolchains for node,web,worker - #15

Open
deviankim wants to merge 1 commit into
monteslu:mainfrom
ssk-play:web-worker-glue
Open

deviankim wants to merge 1 commit into
monteslu:mainfrom
ssk-play:web-worker-glue

Conversation

@deviankim

Copy link
Copy Markdown

Fixes #7.

Replaces #8, which had picked up unrelated fork work. This is one commit on current main.

  • -s ENVIRONMENT=node -> node,web,worker for EM_CLI_FLAGS in scripts/_lib.sh (sdcc/sdas*/sdld, mcpp, rgbds, cc65, asar, dasm, sjasm, tcc816, wla-dx) and the 14 2D core recipes (bluemsx, bsnes, fake08, fceumm, gambatte, gametank, geargrafx, genesis_plus_gx, handy, mgba, prosystem, snes9x, stella2014, vice)
  • scripts/verify-wasm.mjs refuses to publish those glue files if they come out node-only again
  • a CHANGELOG "Unreleased" entry and one line in the romdev-core-host README

Unchanged: NODERAWFS builds, the GPU cores, EM_WRAP_FLAGS, the decompiler.

Under Node the runtime check still picks node. The flag only changes the JS glue: mcpp linked both ways gives a byte-identical .wasm, and the rebuilt gambatte, fceumm, fake08, geargrafx, gpgx, handy, mgba, prosystem, snes9x, stella2014, vice, dasm, tcc816 and wla-dx .wasm files matched the published ones. No versions are bumped; the affected payloads need a rebuild and publish in your release flow, and until then verify-wasm flags the old node-only glue.

Not verified: bsnes is new since #8 and I have not rebuilt it. The bluemsx and gametank recipes did not build in my setup last time (details in #8).

Checked: verify-wasm passes on rebuilt node,web,worker gambatte, fceumm and sdcc payloads, and fails with exit 1 on a node-only glue file.

romdev-core-host documents a bytes-only browser path, but the glue it would
load could not run there: the 2D libretro cores and every tool linked with
EM_CLI_FLAGS were built with -s ENVIRONMENT=node, so emcc hard-codes
ENVIRONMENT_IS_NODE=true and the glue's first act is `await import("module")`.
In a page or Web Worker that throws "Failed to resolve module specifier
'module'" before the wasm is instantiated, although these cores and tools use
nothing but MEMFS. The GPU cores already link with node,web.

EM_CLI_FLAGS (sdcc/sdas*/sdld, mcpp, rgbds, cc65, asar, dasm, sjasm, tcc816,
wla-dx) and the 14 2D core recipes (bsnes included) now use
-s ENVIRONMENT=node,web,worker. Under Node the runtime check still picks node.
The flag only changes the JS glue: mcpp linked both ways gives a
byte-identical .wasm, and the rebuilt gambatte, fceumm, fake08, geargrafx,
gpgx, handy, mgba, prosystem, snes9x, stella2014, vice, dasm, tcc816 and
wla-dx .wasm files are byte-identical to the published ones.

verify-wasm.mjs now refuses to publish those glue files if they come out
node-only again. NODERAWFS builds, the GPU cores, the gcc-family wraps and
rizin/decompiler are unchanged.
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.

2D cores and CLI toolchains ship node-only glue, so romdev-core-host's browser path can't load them

1 participant