fix(wasm): Fix asyncify rewind with asyncify-aware dynCall shims

Emscripten 4.x removed dynCall_* WASM exports, breaking asyncify
rewind through indirect calls (modal dialogs, event handlers).
Generate JS shims that track Asyncify.exportCallStack and register
in wasmExports so doRewind can find them.

Also fixes empty callback functions ((() => {})) generated by
Emscripten 4.x + pthreads for HTML5 events, pthread entry,
sighandler, async timer, and main loop callbacks.

Build pipeline improvements:
- Stub wasm-opt/finalize in Docker (RAM limits), run on host
- Add setup-emsdk.sh for reproducible Emscripten setup
- Simplify env.sh and version management

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2026-03-13 12:26:48 +01:00
commit b46b4b69f1
13 changed files with 150 additions and 65 deletions

View file

@ -28,7 +28,7 @@ npm run test:kicad # KiCad tests (2 tests)
### wxWidgets Only (No Docker)
```bash
# Requires: Emscripten SDK 4.0+, Node.js 18+
# Requires: Node.js 18+ (Emscripten SDK auto-installed on first build)
./scripts/build-wxuniversal-wasm.sh
./scripts/build-wasm-test.sh
cd tests && npm install && npm test
@ -117,15 +117,15 @@ Output: `tests/apps/standalone/`
- 10+ GB disk space for build cache
### For wxWidgets Build (Local)
- Emscripten SDK 4.0+
- Node.js 18+ (for tests)
- Emscripten SDK (auto-installed on first build)
```bash
# macOS
brew install emscripten node
# Initialize submodules
git submodule update --init --recursive
# Install Emscripten SDK (auto-runs on first build, or run manually)
./scripts/setup-emsdk.sh
```
## Testing