Skip to content

Commit

Permalink
Error on --emrun with EXIT_RUNTIME=0 (#23096)
Browse files Browse the repository at this point in the history
The emrun post.js file depend on `addOnExit` to report the exit of the
program. We were already forcing `-sEXIT_RUNTIME` but this adds an error
if the user tries to explicitly disable it.
  • Loading branch information
sbc100 authored Dec 9, 2024
1 parent 19345a7 commit 1604c82
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,11 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
if options.emrun:
options.pre_js.append(utils.path_from_root('src/emrun_prejs.js'))
options.post_js.append(utils.path_from_root('src/emrun_postjs.js'))
if settings.MINIMAL_RUNTIME:
exit_with_error('--emrun is not compatible with MINIMAL_RUNTIME')
# emrun mode waits on program exit
if user_settings.get('EXIT_RUNTIME') == '0':
exit_with_error('--emrun is not compatible with EXIT_RUNTIME=0')
settings.EXIT_RUNTIME = 1

if options.cpu_profiler:
Expand Down Expand Up @@ -972,9 +976,6 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
if settings.MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and settings.MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION:
exit_with_error('MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION are mutually exclusive!')

if options.emrun and settings.MINIMAL_RUNTIME:
exit_with_error('--emrun is not compatible with MINIMAL_RUNTIME')

if options.use_closure_compiler:
settings.USE_CLOSURE_COMPILER = 1

Expand Down

0 comments on commit 1604c82

Please sign in to comment.