Skip to content

Conversation

@pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Sep 1, 2025

  • 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

@pavelsavara pavelsavara added this to the 11.0.0 milestone Sep 1, 2025
@pavelsavara pavelsavara self-assigned this Sep 1, 2025
@pavelsavara pavelsavara added the arch-wasm WebAssembly architecture label Sep 1, 2025
@pavelsavara pavelsavara marked this pull request as ready for review September 4, 2025 11:49
Copilot AI review requested due to automatic review settings September 4, 2025 11:49
Copy link
Contributor

Copilot AI left a comment

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
File Description
src/coreclr/pal/src/arch/wasm/stubs.cpp Replace inline assembly with emscripten_debugger() for proper Node.js debugging
src/coreclr/hosts/corerun/corerun.js Add JavaScript pre-run script to copy Node.js environment variables to Emscripten
src/coreclr/hosts/corerun/corerun.hpp Add WASM-specific conditional compilation to disable dynamic library loading
src/coreclr/hosts/corerun/corerun.cpp Implement static symbol resolution for WASM builds instead of dynamic loading
src/coreclr/hosts/corerun/CMakeLists.txt Configure WASM build with static linking, Node.js file system, and required libraries
src/coreclr/hosts/CMakeLists.txt Enable corerun build for WASM targets alongside existing corewasmrun
docs/workflow/building/coreclr/wasm.md Update documentation to reflect corerun usage instead of corewasmrun for Node.js

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

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!

@pavelsavara pavelsavara merged commit 39ca828 into dotnet:main Sep 5, 2025
99 checks passed
@pavelsavara pavelsavara deleted the wasm_corerun branch September 5, 2025 09:51
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-VM-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants