Skip to content

[wasm coreclr] enable corerun on nodeJS - #119250

Merged
pavelsavara merged 5 commits into
dotnet:mainfrom
pavelsavara:wasm_corerun
Sep 5, 2025
Merged

[wasm coreclr] enable corerun on nodeJS#119250
pavelsavara merged 5 commits into
dotnet:mainfrom
pavelsavara:wasm_corerun

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Sep 1, 2025

Copy link
Copy Markdown
Member
  • implement debugger break
  • make corerun to statically link dependencies
  • make corerun to use NODERAWFS to access host file system to load managed assemblies
  • pass shell env variables to emscripten/corerun

@pavelsavarapavelsavara added this to the 11.0.0 milestone Sep 1, 2025
@pavelsavarapavelsavara self-assigned this Sep 1, 2025
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Sep 1, 2025
Comment threadsrc/coreclr/hosts/CMakeLists.txt Outdated
Comment threadsrc/coreclr/hosts/corerun/corerun.cpp Outdated
Comment threadsrc/coreclr/pal/src/arch/wasm/stubs.cpp Outdated
@pavelsavara
pavelsavara marked this pull request as ready for review September 4, 2025 11:49
CopilotAI review requested due to automatic review settings September 4, 2025 11:49

CopilotAI 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 enables the corerun host application to work on Node.js for WebAssembly (WASM) CoreCLR builds. The changes implement Node.js-specific functionality and remove browser-specific assumptions to allow running .NET assemblies directly in Node.js environments.

Key changes:

  • Replace inline assembly debugger break with Emscripten's debugger function
  • Add static linking support for WASM builds with Node.js file system access
  • Implement environment variable passing from Node.js to Emscripten runtime

Reviewed Changes

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

Show a summary per file
FileDescription
src/coreclr/pal/src/arch/wasm/stubs.cppReplace inline assembly with emscripten_debugger() for proper Node.js debugging
src/coreclr/hosts/corerun/corerun.jsAdd JavaScript pre-run script to copy Node.js environment variables to Emscripten
src/coreclr/hosts/corerun/corerun.hppAdd WASM-specific conditional compilation to disable dynamic library loading
src/coreclr/hosts/corerun/corerun.cppImplement static symbol resolution for WASM builds instead of dynamic loading
src/coreclr/hosts/corerun/CMakeLists.txtConfigure WASM build with static linking, Node.js file system, and required libraries
src/coreclr/hosts/CMakeLists.txtEnable corerun build for WASM targets alongside existing corewasmrun
docs/workflow/building/coreclr/wasm.mdUpdate documentation to reflect corerun usage instead of corewasmrun for Node.js

Comment threadsrc/coreclr/hosts/corerun/corerun.cpp
Comment threadsrc/coreclr/hosts/corerun/corerun.cpp

@AaronRobinsonMSFTAaronRobinsonMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great, thank you. Please address the CMake feedback and then let's get this merged!

Comment threadsrc/coreclr/hosts/corerun/CMakeLists.txt Outdated
@pavelsavara
pavelsavara merged commit 39ca828 into dotnet:mainSep 5, 2025
99 checks passed
@pavelsavara
pavelsavara deleted the wasm_corerun branch September 5, 2025 09:51
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Oct 6, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-VM-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pavelsavara@janvorli@AaronRobinsonMSFT@SingleAccretion