From 2119a86fd3190331c028076275172f86cf489f37 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Fri, 22 May 2026 18:36:29 +0000 Subject: [PATCH 1/4] Re-enable the temporarily disabled circleci tests. --- .circleci/config.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0e2cb2c4e9bda..b35d277b38761 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1389,9 +1389,9 @@ workflows: - test-core0: requires: - build-linux - #- test-core2: - # requires: - # - build-linux + - test-core2: + requires: + - build-linux - test-core3: requires: - build-linux @@ -1410,9 +1410,9 @@ workflows: - test-modularize-instance: requires: - build-linux - #- test-esm-integration: - # requires: - # - build-linux + - test-esm-integration: + requires: + - build-linux - test-stress: requires: - build-linux @@ -1434,14 +1434,14 @@ workflows: - test-sockets-chrome: requires: - build-linux - #- test-bun - #- test-deno - #- test-jsc + - test-bun + - test-deno + - test-jsc - test-spidermonkey - #- test-node-compat - #- test-windows - #- test-windows-browser-firefox + - test-node-compat + - test-windows + - test-windows-browser-firefox - build-windows-launcher - #- test-mac-arm64: - # requires: - # - build-linux + - test-mac-arm64: + requires: + - build-linux From cd1e655f37a367db323d27c28ddf05698bb3097c Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Fri, 22 May 2026 22:58:27 +0000 Subject: [PATCH 2/4] Fix ESM integration pthread worker loading hang Commit 48b061638 optimized worker thread postMessage commands by replacing string literals (like 'load') with integer constants (like CMD_LOAD = 1). However, the ES Module worker bootstrap loader script, pthread_esm_startup.mjs, was missed in that cleanup and kept the hardcoded check msg.data.cmd == 'load'. As a result, when running in WASM_ESM_INTEGRATION mode, the startup loader silently ignored the numeric commands sent by the parent thread. This caused worker threads to never load the main module and prevented them from signaling readiness, resulting in an infinite hang during initialization of pthreads. To resolve this, define the thread command constants in the central, shared parseTools.mjs compile-time utility context, so that they are globally accessible during standalone preprocessing. This enables the ESM worker bootstrap script to cleanly preprocess and evaluate the numeric CMD_LOAD constant macro, fixing the hang. --- src/lib/libpthread.js | 11 ----------- src/lib/libwasm_worker.js | 4 ---- src/parseTools.mjs | 20 ++++++++++++++++++++ src/pthread_esm_startup.mjs | 2 +- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/lib/libpthread.js b/src/lib/libpthread.js index e084c3c49dc4e..2707e1897a55f 100644 --- a/src/lib/libpthread.js +++ b/src/lib/libpthread.js @@ -30,17 +30,6 @@ const MAX_PTR = Number((2n ** 64n) - 1n); const MAX_PTR = (2 ** 32) - 1 #endif -// Message IDs used when communicating with workers via postMessage. -const CMD_LOAD = 1; -const CMD_RUN = 2; -const CMD_LOADED = 3; -const CMD_CHECK_MAILBOX = 4; -const CMD_SPAWN_THREAD = 5; -const CMD_CLEANUP_THREAD = 6; -const CMD_MARK_AS_FINISHED = 7; -const CMD_UNCAUGHT_EXN = 8; -const CMD_CALL_HANDLER = 9; - #if WASM_ESM_INTEGRATION const pthreadWorkerScript = TARGET_BASENAME + '.pthread.mjs'; #else diff --git a/src/lib/libwasm_worker.js b/src/lib/libwasm_worker.js index 89c569592e631..04e3fbe8190b0 100644 --- a/src/lib/libwasm_worker.js +++ b/src/lib/libwasm_worker.js @@ -22,10 +22,6 @@ #endif // ~WASM_WORKERS {{{ -#if !PTHREADS - // In pthread builds this gets defined in libpthread.js - const CMD_UNCAUGHT_EXN = 8; -#endif const workerSupportsFutexWait = () => AUDIO_WORKLET ? "!ENVIRONMENT_IS_AUDIO_WORKLET" : '1'; const wasmWorkerJs = ` #if MINIMAL_RUNTIME diff --git a/src/parseTools.mjs b/src/parseTools.mjs index 54c33952b2b90..6678b35e3cc5c 100644 --- a/src/parseTools.mjs +++ b/src/parseTools.mjs @@ -32,6 +32,17 @@ const FLOAT_TYPES = new Set(['float', 'double']); // Represents a browser version that is not supported at all. const TARGET_NOT_SUPPORTED = 0x7fffffff; +// Message IDs used when communicating with workers via postMessage. +export const CMD_LOAD = 1; +export const CMD_RUN = 2; +export const CMD_LOADED = 3; +export const CMD_CHECK_MAILBOX = 4; +export const CMD_SPAWN_THREAD = 5; +export const CMD_CLEANUP_THREAD = 6; +export const CMD_MARK_AS_FINISHED = 7; +export const CMD_UNCAUGHT_EXN = 8; +export const CMD_CALL_HANDLER = 9; + // Does simple 'macro' substitution, using Django-like syntax, // {{{ code }}} will be replaced with |eval(code)|. // NOTE: Be careful with that ret check. If ret is |0|, |ret ? ret.toString() : ''| would result in ''! @@ -1208,6 +1219,15 @@ addToCompileTimeContext({ TARGET_NOT_SUPPORTED, WASM_PAGE_SIZE, ENVIRONMENT_IS_MAIN_THREAD, + CMD_LOAD, + CMD_RUN, + CMD_LOADED, + CMD_CHECK_MAILBOX, + CMD_SPAWN_THREAD, + CMD_CLEANUP_THREAD, + CMD_MARK_AS_FINISHED, + CMD_UNCAUGHT_EXN, + CMD_CALL_HANDLER, ENVIRONMENT_IS_WORKER_THREAD, addAtExit, addAtPreRun, diff --git a/src/pthread_esm_startup.mjs b/src/pthread_esm_startup.mjs index 87d652e06ad02..57156eda5ff70 100644 --- a/src/pthread_esm_startup.mjs +++ b/src/pthread_esm_startup.mjs @@ -34,7 +34,7 @@ self.onmessage = async (msg) => { #if RUNTIME_DEBUG console.log('pthread_esm_startup', msg.data.cmd); #endif - if (msg.data.cmd == 'load') { + if (msg.data.cmd == {{{ CMD_LOAD }}}) { // Until we initialize the runtime, queue up any further incoming messages // that can arrive while the async import (await import below) is happening. // For examples the `run` message often arrives right away before the import From 597a04417b7e6b29f4308633a3db32248b071420 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Fri, 22 May 2026 23:16:05 +0000 Subject: [PATCH 3/4] Add Deno support to require_wasm64 helper Commit 347da58e3 enabled falling back to other engines in wasm64 requirement helpers if Node.js is missing, but changed the behavior when no capable engine is found from skipping to failing. This broke Deno- only testing environments where the wasm64 test variant was executed via crossplatform-only targets but failed due to Deno not being recognized as an eligible wasm64 JS engine. To resolve this, check for Deno and allow it as a valid wasm64 JS engine inside require_wasm64 helper. --- test/common.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/common.py b/test/common.py index faf500209c2ec..266ce1defba25 100644 --- a/test/common.py +++ b/test/common.py @@ -524,7 +524,12 @@ def require_wasm64(self): self.require_engine(v8) return - self.fail('either d8 or node >= 24 required to run wasm64 tests. Use EMTEST_SKIP_WASM64 to skip') + deno = get_deno() + if deno: + self.require_engine(deno) + return + + self.fail('either d8, node >= 24 or deno required to run wasm64 tests. Use EMTEST_SKIP_WASM64 to skip') def try_require_node_version(self, major, minor=0, revision=0): nodejs = get_nodejs() From 65a1d420430c0dda335103608b57c90149f61679 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Fri, 22 May 2026 23:30:16 +0000 Subject: [PATCH 4/4] Skip wasm64 on bun. --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b35d277b38761..fef28dfe1b890 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -884,6 +884,7 @@ jobs: executor: linux-python environment: EMTEST_SKIP_NEW_CMAKE: "1" + EMTEST_SKIP_WASM64: "1" steps: - checkout - pip-install