Skip to content

[emrun] Allow --emrun together with -sEXIT_RUNTIME=0 - #28407

Open
juj wants to merge 1 commit into
emscripten-core:mainfrom
juj:emrun_allow_no_exit_runtime
Open

juj wants to merge 1 commit into
emscripten-core:mainfrom
juj:emrun_allow_no_exit_runtime

Conversation

@juj

@juj juj commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Linking with --emrun has been an error together with an explicit -sEXIT_RUNTIME=0 since #23096.

Make EXIT_RUNTIME=1 only the default of --emrun, and honor an explicit -sEXIT_RUNTIME=0.

My wasm_webgpu test harness uses this combo.

Linking with --emrun has been an error together with an explicit
-sEXIT_RUNTIME=0 since emscripten-core#23096. Before that, --emrun silently enabled
EXIT_RUNTIME even when it was explicitly disabled.

Make EXIT_RUNTIME=1 only the default of --emrun, and honor an explicit
-sEXIT_RUNTIME=0. emrun_postjs.js needs the runtime to exit only for
reporting the exit code of the program to emrun. The capture of stdout
and stderr does not depend on it, and emrun also quits when the browser
is closed. So a page that keeps running after main() has returned, e.g.
a test that finishes in an asynchronous callback, can be run under emrun
and end the run by closing its window.

With -sEXIT_RUNTIME=0 the callback that emrun_postjs.js registers with
addOnExit() is never called.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant