Skip to content

[browser][wasm] Prep changes ahead of emsdk bump#129383

Merged
pavelsavara merged 13 commits into
dotnet:mainfrom
pavelsavara:emsdk-upgrade-prep
Jun 14, 2026
Merged

[browser][wasm] Prep changes ahead of emsdk bump#129383
pavelsavara merged 13 commits into
dotnet:mainfrom
pavelsavara:emsdk-upgrade-prep

Conversation

@pavelsavara

@pavelsavara pavelsavara commented Jun 14, 2026

Copy link
Copy Markdown
Member

Split off from #129299

Summary

This PR carries the WASM changes that are independent of the upcoming Emscripten 5.0.6 / LLVM 23 toolchain bump, so they can be reviewed and merged on their own. Splitting them out keeps the toolchain-bump PR focused on the parts that actually require the new SDK.

What's included

1. Browser version bump — Firefox / GeckoDriver

  • eng/testing/BrowserVersions.props — Firefox 125.0.1140.11.0esr, GeckoDriver 0.34.00.37.0
  • eng/testing/wasm-provisioning.targets — Firefox archive .tar.bz2.tar.xz (new Mozilla release format)

Fully independent of the toolchain; just updates the browsers used for WASM testing.

2. Keepalive / timer balance fixes (runtime bug fixes)

  • src/mono/browser/runtime/scheduling.ts — balance clearTimeout with runtimeKeepalivePop, and reset lastScheduledTimeoutId before executing the timer tick
  • src/mono/browser/runtime/diagnostics/dotnet-gcdump.tsruntimeKeepalivePop when a pending GC-dump timeout is cleared
  • src/mono/browser/runtime/startup.ts — remove a stray, unbalanced runtimeKeepalivePop on the error path
  • src/mono/browser/runtime/loader/exit.ts — only run flush_node_streams under Node

These correct the runtime keepalive ref-count so the event loop can drain/exit properly; unrelated to the SDK version.

3. Disable WASM_BIGINT for corerun / Node (DWARF debugger workaround)

  • src/coreclr/hosts/corerun/CMakeLists.txt — link corerun with -sWASM_BIGINT=0 under Node without HEAP64/HEAPU64 views are not exported when BigInt is off
  • docs/workflow/building/coreclr/wasm.md — update the Node debug-launch args

(cherry picked from commit fa8db40)
(cherry picked from commit 4113f8e)
(cherry picked from commit 5ad201d)
(cherry picked from commit 0dab167)
(cherry picked from commit 3bcf4d0)
(cherry picked from commit 7f3a839)
@pavelsavara pavelsavara added this to the 11.0.0 milestone Jun 14, 2026
@pavelsavara pavelsavara requested a review from akoeplinger June 14, 2026 13:34
@pavelsavara pavelsavara self-assigned this Jun 14, 2026
@pavelsavara pavelsavara requested a review from lewing as a code owner June 14, 2026 13:34
Copilot AI review requested due to automatic review settings June 14, 2026 13:34
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm labels Jun 14, 2026

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.

Pull request overview

This PR updates .NET’s WASM/Browser infrastructure and runtime glue code, focusing on browser test provisioning updates and WASM runtime behavior adjustments (timers/keepalive and WASM_BIGINT-related export/link behavior).

Changes:

  • Update WASM test browser provisioning by bumping Firefox/GeckoDriver versions and switching Linux Firefox downloads to .tar.xz.
  • Fix/adjust runtime keepalive accounting around timers/GC dump timeouts and startup error paths.
  • Modify CoreCLR WASM build/export behavior around WASM_BIGINT (notably exported HEAP views) and corerun Node linking options; update WASM build/debug docs accordingly.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/mono/browser/runtime/startup.ts Adjusts keepalive behavior on runtime initialization failure path.
src/mono/browser/runtime/scheduling.ts Balances keepalive with timer rescheduling and adjusts timer tick bookkeeping order.
src/mono/browser/runtime/loader/exit.ts Guards Node-only stream flushing to avoid running it outside Node.
src/mono/browser/runtime/diagnostics/dotnet-gcdump.ts Balances keepalive when rescheduling/canceling GC dump stop timeout.
src/coreclr/runtime.proj Introduces a target affecting WASM_BIGINT-related export selection for browser builds.
src/coreclr/hosts/corerun/CMakeLists.txt Changes corerun Node link flags to explicitly disable WASM_BIGINT.
eng/testing/wasm-provisioning.targets Switches Linux Firefox provisioning URL from .tar.bz2 to .tar.xz.
eng/testing/BrowserVersions.props Bumps Firefox/GeckoDriver versions used in WASM test runs.
eng/native.wasm.targets Expands exported Emscripten runtime methods (HEAP views) and gates HEAP64/HEAPU64 on a property.
docs/workflow/building/coreclr/wasm.md Updates Node debugging launch args.

Comment thread src/mono/browser/runtime/startup.ts
Comment thread src/coreclr/runtime.proj Outdated
Comment thread src/coreclr/hosts/corerun/CMakeLists.txt Outdated
Copilot AI review requested due to automatic review settings June 14, 2026 13:53

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.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Comment thread src/mono/browser/runtime/startup.ts Outdated
Comment thread src/coreclr/hosts/corerun/CMakeLists.txt Outdated
Comment thread eng/native.wasm.targets
Comment thread src/coreclr/runtime.proj Outdated
@pavelsavara pavelsavara changed the title [browser][wasm] Prep changes ahead of the emsdk 5.0.6 / LLVM 23 toolchain bump [browser][wasm] Prep changes ahead of emsdk bump Jun 14, 2026
Copilot AI review requested due to automatic review settings June 14, 2026 14:32

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread src/coreclr/hosts/corerun/CMakeLists.txt
Comment thread src/mono/browser/runtime/startup.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 14, 2026 14:47

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread src/coreclr/hosts/corerun/CMakeLists.txt
Comment thread src/coreclr/hosts/corerun/CMakeLists.txt
Copilot AI review requested due to automatic review settings June 14, 2026 17:33

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.

Pull request overview

Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.

Comment thread eng/Versions.props
Copilot AI review requested due to automatic review settings June 14, 2026 17:43

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread src/coreclr/hosts/corerun/CMakeLists.txt
Comment thread src/mono/browser/runtime/scheduling.ts
Comment thread src/mono/browser/runtime/diagnostics/dotnet-gcdump.ts
@pavelsavara

Copy link
Copy Markdown
Member Author

/ba-g known CI issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants