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

@ -4,12 +4,12 @@
# Redirect all output to a log file (re-execs script with redirection)
source "$(dirname "$0")/common/logging.sh"
# Source common environment (sets up EMSDK_PYTHON for Emscripten 4.0.22+)
# Source common environment (sets up local emsdk)
source "$(dirname "$0")/common/env.sh"
# This builds the GUI-enabled wxWidgets needed for KiCad
#
# Prerequisites:
# - Emscripten SDK installed and activated
# - Emscripten SDK (auto-installed by env.sh via scripts/setup-emsdk.sh)
# - autoconf (for regenerating configure from configure.in)
#
# To regenerate Makefile.in from bakefiles (after modifying files.bkl):
@ -23,14 +23,6 @@ source "$(dirname "$0")/common/env.sh"
set -e
# Ensure 'python' command is available (macOS only has python3)
# Homebrew's python libexec has the python -> python3 symlink
if [[ -d "/opt/homebrew/opt/python/libexec/bin" ]]; then
export PATH="/opt/homebrew/opt/python/libexec/bin:$PATH"
elif [[ -d "/usr/local/opt/python/libexec/bin" ]]; then
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
BUILD_DIR="$PROJECT_ROOT/build-wasm/wxwidgets-universal"