Skip to content

[wasm][coreclr] Shutdown runtime at the end when running on node - #121949

Merged
radekdoulik merged 1 commit into
dotnet:mainfrom
radekdoulik:clr-interp-wasm-corerun-node-exit
Nov 25, 2025
Merged

radekdoulik merged 1 commit into
dotnet:mainfrom
radekdoulik:clr-interp-wasm-corerun-node-exit

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

This makes the tests return the right exit code again, when running on Node.js.

@radekdoulik radekdoulik added this to the Future milestone Nov 25, 2025
@radekdoulik
radekdoulik force-pushed the clr-interp-wasm-corerun-node-exit branch from d4e7182 to 121895a Compare November 25, 2025 11:59
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

This makes the tests return the right exit code again, when running on
Node.js.
@radekdoulik
radekdoulik force-pushed the clr-interp-wasm-corerun-node-exit branch from 121895a to 48aeabe Compare November 25, 2025 12:01

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 modifies the corerun host to properly shutdown the CoreCLR runtime and return correct exit codes when running tests on Node.js, while preserving the existing behavior of keeping the runtime alive without shutdown when running in a browser environment.

Key Changes

  • Added Node.js environment detection via Emscripten's EM_ASM_INT
  • Refactored the conditional compilation logic to distinguish between Node.js and browser execution on the WASM/Browser target
  • Enabled runtime shutdown for Node.js environments to ensure proper exit code propagation

Comment thread src/coreclr/hosts/corerun/corerun.cpp Resolved
@radekdoulik
radekdoulik merged commit 99aa031 into dotnet:main Nov 25, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants