Skip to content

Bump emsdk to 6.0.12 - #436

Open
zzcgumn wants to merge 2 commits into
developfrom
chore/bump_emsdk_6_0_12
Open

zzcgumn wants to merge 2 commits into
developfrom
chore/bump_emsdk_6_0_12

Conversation

@zzcgumn

@zzcgumn zzcgumn commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Bumps the WASM toolchain from emsdk 5.0.7 to 6.0.12 (Emscripten 6.0.x). The archive_override's checksum, folder prefix and URLs come from the BCR source.json for 6.0.12. emsdk's own dependencies are unchanged between the two versions, so nothing else in the dependency graph moves.

Emscripten 6.0 changes checked

  • PThread.runningWorkers removed: library/tests/dtest.cpp's Node clean-exit hook reads it, and also a per-worker loaded flag that 6.0 no longer sets either. Both reads are guarded (|| [], !w.loaded), so the hook degrades to a bounded retry (up to 100 event-loop turns) before terminateAllThreads. test_dtest_wasm_calc_high_thread_count_no_terminated_workers still passes.
    • I tried to reproduce the race it guards against. With the wait disabled, 20 runs at -n 16 printed no "terminated worker" warning, on 6.0.12 and on 5.0.7 alike. With no failing case to drive a change, only the comment is updated. If the race shows up again, a fix needs a failing test first.
  • isFileURI line: Emscripten 6 emits the same line as 5.x, so web/patch_web_wasm.py still matches it (verified with web/update_wasm.sh). Only its version note changes.
  • No-link-time-LTO note: the pre-built cache still ships no LTO system libraries, so the note in docs/wasm_build.md and specs/wasm-emscripten.md stands; only its version reference changes.
  • Not applicable here:
    • Windows .exe launchers instead of .bat: handled inside the emsdk Bazel rules, and the Windows wasm_web job covers it.
    • Higher minimum browsers (Chrome 85 / Firefox 79 / Safari 14.1): still below what the page's SharedArrayBuffer/pthreads already need.
    • FAKE_DYLIBS / -shared default change and pause() returning 0: not used.

Verification (macOS, local)

  • bazelisk test //...: 105/105 pass.
  • bazelisk test //web:dds_web_e2e_test --test_tag_filters=: passes.
  • web/update_wasm.sh: builds, patches and verifies the web bundle.

🤖 Generated with Claude Code

Emscripten 6.0 removes PThread.runningWorkers and no longer sets a
per-worker `loaded` flag, which dtest's Node clean-exit hook reads. Both
reads are guarded, so the hook degrades to a bounded retry before
terminateAllThreads; the existing high-thread-count system test stays
clean (and the race did not reproduce locally on 5.0.7 or 6.0.12 even
with the wait disabled), so only its comment changes here.

The generated isFileURI line is unchanged, so patch_web_wasm.py only
needs its version note bumped. The pre-built cache still has no LTO
system libraries, so the no-link-time-LTO note stands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzcgumn
zzcgumn requested a review from tameware October 16, 2026 22:37
Emscripten 6.0.2 dropped wasmBinary from the default list of Module
properties the generated JS reads. createDdsModule({wasmBinary}) then
aborted in assertion builds (dds_web_wasm_system_test, and the e2e test
waiting on the solver) and would silently ignore the embedded bytes in
release builds. List exactly the property our two callers pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzcgumn

zzcgumn commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed both CI failures (one cause) in the latest commit.

Emscripten 6.0.2 dropped wasmBinary from the default INCOMING_MODULE_JS_API, the list of Module properties the generated JS will read. The page (dds_web_solve.js) and the Node harness (tests/dds_web_wasm_node.mjs) both call createDdsModule({ wasmBinary }). Effects:

  • In assertion builds this aborts with Module.wasmBinary` was supplied but `wasmBinary` not included in INCOMING_MODULE_JS_API. That is the dds_web_wasm_system_test failure.
  • The e2e test's HTTP solver tests then error and the run times out.
  • In release builds Emscripten would silently ignore the embedded bytes.

WASM_WEB_LINKOPTS now sets -sINCOMING_MODULE_JS_API=['wasmBinary'], exactly the property our two callers pass. There's no append syntax, and restating the full default list would break again the next time Emscripten changes its defaults.

Why my earlier local run missed it: both tests skip when node (or the Playwright browser install) isn't available. Bazel's test environment doesn't include /opt/homebrew/bin on PATH, so on macOS they were reported as PASSED while actually skipped. Re-run with --test_env=PATH:

  • dds_web_wasm_system_test failed with the CI error before the fix and passes after.
  • dds_web_e2e_test passes all 36 tests.
  • bazelisk test //... --test_env=PATH gives 105/105, with no WASM/web skips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The major toolchain upgrade changes pthread internals, and cross-platform runtime compatibility still needs human confirmation.

No open issues 🎉

What changed in this PR

Upgrades DDS’s WebAssembly toolchain from emsdk 5.0.7 to 6.0.12.

Changes:

  • Updates the toolchain pin, archive metadata, and lockfile.
  • Explicitly enables wasmBinary input for web module initialization.
  • Refreshes compatibility comments and build documentation.
File Description
web/​patch_web_wasm.py Updates expected SDK version and compatibility comment.
web/​BUILD.bazel Enables wasmBinary initialization input.
specs/​wasm-emscripten.md Refreshes toolchain and LTO notes.
MODULE.bazel.lock Updates SDK artifacts and extension metadata.
MODULE.bazel Pins emsdk 6.0.12 and its archive.
library/​tests/​dtest.cpp Documents shutdown behavior under Emscripten 6; no logic changes.
docs/​wasm_build.md Updates version and build guidance.

Review effort: Balanced

@tameware tameware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I ran the front-end on my Mac. It worked, and the e2e tests pass.

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.

3 participants