Skip to content

[wasm] Bump Emscripten to 5.0.6 (6ea9c28c)#240

Open
pavelsavara wants to merge 4891 commits intodotnet:dotnet/mainfrom
pavelsavara:merge/upstream-5.0.6
Open

[wasm] Bump Emscripten to 5.0.6 (6ea9c28c)#240
pavelsavara wants to merge 4891 commits intodotnet:dotnet/mainfrom
pavelsavara:merge/upstream-5.0.6

Conversation

@pavelsavara
Copy link
Copy Markdown
Member

@pavelsavara pavelsavara commented Apr 30, 2026

Contributes to dotnet/runtime#113786

Summary

Bumps dotnet/emscripten to upstream emscripten-core/emscripten tag 5.0.6 at 6ea9c28c38cd.

Branch contents

https://github.com/pavelsavara/emscripten/commits/dotnet/main-bump-emscripten-5.0.6/

Validation

  • linux-x64 build+pack succeeded (50s, 0 errors)
  • Package: Microsoft.NETCore.Runtime.Wasm.Emscripten.Transport.11.0.0-alpha.1.26253.2.nupkg (22M)

subhaushsingh and others added 30 commits February 26, 2026 08:30
`emscripten_websocket_new` uses `$webSockets` but does not declare it as
a dependency.

Fixes: emscripten-core#26310
…emscripten-core#26343)

When using the `--failing-and-slow-first` flag on the CI, treat failure
to parse the previous run log file as a non-fatal error, to help
forcibly terminated CI jobs recover.
When EMTEST_AUTOSKIP=1 and current Node.js version is less than 25, then
skip the Node.js 25 requiring tests automatically.
)

emscripten-core#26297 didn't make it into the 5.0.2 tag. This pull request moves the
ChangeLog entry to 5.0.3.
…mscripten-core#26345)

This removes the dependency that libc++abi has on the pthread API
functions, allowing
better support for Wasm Workers.

Replaces: emscripten-core#26283

Fixes: emscripten-core#26277
When building -sSINGLE_FILE builds with -sSINGLE_FILE_BINARY_ENCODE
enabled, the base64Decode function was being emitted, and Closure was
unable to DCE away the dependent base64ReverseLookup variable. So
optimize this away manually to save code size.

---------

Co-authored-by: juj <clb@h12dsi.clbri.com>
This file seems like it was previously referenced in the docs prior to
6dc95a7 but never actually built or used in any test.
Also, add more assertions about the return value.
)

Also, run it both with and without pthreeds, as it seems like it was
originally intended.
… NFC (emscripten-core#26359)

This works for over 100 reftests in test_browser.py
Support multi-threaded applications in memoryprofiler.

Fixes emscripten-core#18107.
…fault. NFC (emscripten-core#26363)

These are only ever used by EMSCRIPTEN_TRACING so we know exactly when
to include them.

I noticed this while reviewing emscripten-core#26175
…#26364)

This allows for the complete removal of `libmemoryprofiler.js` since the
memory profiler can now just use the same libtrace-based hooks for all
events.

I noticed this while reviewing emscripten-core#26175
These files should have been removed in emscripten-core#6827 (2018!)
…er (emscripten-core#26370)

From what I gather, this header was only ever supported in Firefox, and
now Firefox has removed it.

https://bugzilla.mozilla.org/show_bug.cgi?id=1598759
…ipten-core#26371)

Release notes:

- Fixed [GH#27](pongasoft/emscripten-glfw#27):
properly handles scale change (it was only working when switching back
and forth between 2 scales)
- Fixed [GH#29](pongasoft/emscripten-glfw#29):
when the canvas does not have a `tabindex` attribute, the library
automatically adds one to make sure that the
callback, set via `glfwSetWindowFocusCallback`, is called when the
canvas is focused/unfocused.
In order to measure a difference with the native base64 API we need to
disable the new `-sSINGLE_FILE_BINARY_ENCODE` setting.
…#26367)

Also more a few other tests into `other`.

Followup to emscripten-core#26350

After this change we are down to under 300 files in the top level test
dir.
…26360)

This is the only file that uses it so we don't need to it in the shared
utils.
The code here previously used a pthread_lock. However this is
unnecessary since all calls to the `do_tzset` function are already
wrapped in `LOCK(lock)` and `UNLOCK(lock)`.

This is nice little codesize saving too.
…mscripten-core#24858)

This change does not start using the executable launcher by default.
That can happen later once we get more feedback on it. For example,
its not clear if this will lead to issues with virus/security scanners. 

Assuming we don't run into any issues I hope to eventually completely
remove support for the `.bat` files.

There are several reasons to want to do this:

1. Batch files are notoriously painful to work with and mis-understood.
2. Should be faster (no need to launch cmd.exe).
3. Works around several known issues with .bat files including one that
is known unsolvable one (see emcc.bat for more details)
4. In the future we could potentially launch clang directly, bypassing
the python completely (or at least only invoking python for the link
stage).

See: emscripten-core#26229
See: emscripten-core#19207
This test broke when binaryen recently got more strict:
WebAssembly/binaryen#8403
emscripten-bot and others added 23 commits April 8, 2026 09:19
…6651)

This is an automatic change generated by
tools/maint/rebaseline_tests.py.

The following (1) test expectation files were updated by
running the tests with `--rebaseline`:

```
codesize/test_codesize_cxx_lto.json: 120519 => 120725 [+206 bytes / +0.17%]

Average change: +0.17% (+0.17% - +0.17%)
```

Co-authored-by: emscripten-bot <emscripten-bot@users.noreply.github.com>
This avoids repeating the same set of decorators all over the place.
Under node we install the `uncaughtException` handler in workers (both
in pthread and wasm worker). This means that `uncaughtException` is sent
via `postMessage` back to the main thread. See
nodejs/node#59617 for why we do this.

However, these message was simply being ignored by the main thread in
the case of Wasm Workers.

With this change we honor the `uncaughtException` message and avoid
completely loosing the uncaught exception.
This does not remove anything, just generates a warning if the setting
is used.

See emscripten-core#26647 and emscripten-core#26648
We dropped support for firefox older than 58 a long time back.

We dropped support node older than 18.1 in emscripten-core#26604.
…6656)

This is an automatic change generated by
tools/maint/rebaseline_tests.py.

The following (4) test expectation files were updated by
running the tests with `--rebaseline`:

```
codesize/test_minimal_runtime_code_size_hello_webgl2_wasm.json: 13200 => 13200 [+0 bytes / +0.00%]
codesize/test_minimal_runtime_code_size_hello_webgl2_wasm2js.json: 18534 => 18537 [+3 bytes / +0.02%]
codesize/test_minimal_runtime_code_size_hello_webgl_wasm.json: 12738 => 12738 [+0 bytes / +0.00%]
codesize/test_minimal_runtime_code_size_hello_webgl_wasm2js.json: 18060 => 18063 [+3 bytes / +0.02%]

Average change: +0.01% (+0.00% - +0.02%)
```

Co-authored-by: emscripten-bot <emscripten-bot@users.noreply.github.com>
These minor cleanups were split out from my larger work on precise
wakeups.
)

Linux TID/PID values have a max limit of 4,194,304. We should mimic that
and start WW id at 4,194,304/2.
Fix the following errors after
emscripten-core#26424:
```
- ERROR - [JSC_BAD_JSDOC_ANNOTATION] Parse error. illegal use of unknown JSDoc tag "noreturn"; ignoring it. Place another character before the @ to stop JSCompiler from parsing it as an annotation.
- ERROR - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object.
```
We are nearing the end of our budget, so for a few weeks we need to cut
back.
…en-core#26658)

It turns out that the files in `musl/arch/generic/` and
`musl/arch/emscripten/` are supposed to me internal headers even though
the `bits/` subdirectories are public.

This change means that `syscall_arch.h` is not longer visible outside of
the musl build (e.g. when building wasmfs) so I moved the public
function declarations to `emscripten/syscalls.h`.
- Test using `pthread_kill` on yourself.
- Test using `pthread_kill` from a background thread to the main thread.
For some reason this was disallowed before.
- Add a stub version of `pthread_kill` along with a test.
This is useful when debugging tests that are timing out without having
to wait the full default of 5 minutes to get the failure.

For example I've been debugging a timeout recently using:

```
EMTEST_TIMEOUT=5 ./test/runner posixtest.test_pthread_join_4_1
```

This waits for 5 seconds rather than 5 minutes.
This special handling for `SIGCANCEL` should not be needed. If we need
to do something like `_emscripten_runtime_keepalive_clear` during
pthread cancelation it would be best done when the cancellation in
processed in `__testcancel`/`__cancel`.

The comment & code I'm removing here was added back in emscripten-core#22467 along with
testing in the form of `test/pthread/test_pthread_kill.c` and the
pthread_kill tests in posixtest.

I recently expanded the testing in emscripten-core#26663, and this change doesn't break
any of those tests.
Also, add some testing for this. I also ran this test under native clang
/ glibc on my desktop and got the expected results.
…ripten-core#26673)

This fix only applies to the hybrid Wasm Workers + pthread build mode.

We can't currently rely on calling `pthread_self()` from a Wasm Worker,
even the hybrid mode. We are working on fixing that in emscripten-core#26631. However,
we do have a `CURRENT_THREAD_ID` macro that works on both Wasm Workers
and pthreads.

As it happens, pthread locks under musl do not normally depend on
`pthread_self` except for "recursive" which need to access the
`pthread_self()->tid` field to track the current owner. This means that
I broke the debug + hybrid mode locks in emscripten-core#24607 because I added the
recursion check to all locks in debug builds.

While I have added a repro case for this its not directly testing the
issue, it just heppens to crash due to the current undefined behavior
when doing `pthread_self()->tid` from a Wasm Worker.

Fixes: emscripten-core#26619
Merges emscripten-core/emscripten 5.0.6 (sha 6ea9c28).

Dotnet patches re-applied:
- .gitignore: dotnet build outputs
- .gitmodules: empty (kept)
- embuilder.py: sqlite3 patch dropped (upstream already removed sqlite3 from MINIMAL_TASKS)
- package.json: devDependencies stripped (package-lock.json needs npm prune --production regen)
- src/jsifier.js renamed by upstream to src/jsifier.mjs; CodeQL [js/bad-code-sanitization] suppression re-applied
- tools/js_manipulation.py: CodeQL [SM03905] safe regex retained (auto-merged)
- tools/link.py: STB_IMAGE error retained
- tools/system_libs.py: libstb_image class disabled (auto-merged)

Deletions retained: emrun.py, system/lib/stb_image.c, third_party/stb_image.h,
third_party/ply/doc/makedoc.py, test/** (including newly-modified upstream test files).

eng/emscripten-revision.txt bumped to 6ea9c28.
emscripten-version.txt now reads 5.0.6-git.
eng/Versions.props VersionPrefix unchanged (11.0.0).

Note: package-lock.json taken from upstream; must be regenerated with
npm install --omit=dev to match the dev-dep-free package.json before CI.
Matches the dev-dep-free package.json carried as a dotnet patch.
Produced via: rm package-lock.json; npm install --omit=dev --package-lock-only
with Node v24.14.0 / npm 11.9.0.
@pavelsavara pavelsavara changed the title Merge upstream 5.0.6 into dotnet/main [wasm] Bump Emscripten to 5.0.6 (6ea9c28c) May 4, 2026
@pavelsavara pavelsavara requested a review from akoeplinger May 4, 2026 20:22
@pavelsavara pavelsavara marked this pull request as ready for review May 7, 2026 12:56
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.