Skip to content

Commit 738a9a9

Browse files
authored
[MODULARIZE=instance] Enable ABORT_ON_WASM_EXCEPTIONS. NFC (#24373)
Turns out this works already in `MODULARIZE=instance` mode but not in `WASM_ESM_INTEGRATION` mode.
1 parent 26b4bce commit 738a9a9

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

site/source/docs/compiling/Modularized-Output.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ fix in future releses. Current limitations include:
123123

124124
* `ccall`/`cwrap` are not supported (depends on the ``Module`` global).
125125

126-
* :ref:`abort_on_wasm_exceptions` is not supported (requires wrapping wasm
127-
exports).
128-
129126
* :ref:`dyncalls` is not supported (depends on the ``Module`` global)
130127

131128
* :ref:`asyncify` is not supported (depends on :ref:`dyncalls`)
@@ -170,11 +167,14 @@ This setting implicitly enables :ref:`export_es6` and sets :ref:`MODULARIZE` to
170167

171168
Some additional limitations are:
172169

173-
- ``-pthread`` / :ref:`wasm_workers` are not yet supported.
170+
* ``-pthread`` / :ref:`wasm_workers` are not yet supported.
171+
172+
* :ref:`abort_on_wasm_exceptions` is not supported (requires wrapping wasm
173+
exports).
174174

175-
- Setting :ref:`wasm` to ``0`` is not supported.
175+
* Setting :ref:`wasm` to ``0`` is not supported.
176176

177-
- Setting :ref:`wasm_async_compilation` to ``0`` is not supported.
177+
* Setting :ref:`wasm_async_compilation` to ``0`` is not supported.
178178

179179

180180
.. _Source phase imports: https://github.com/tc39/proposal-source-phase-imports

test/test_core.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6954,7 +6954,7 @@ def test_autodebug_wasm(self):
69546954
### Integration tests
69556955

69566956
@crossplatform
6957-
@no_modularize_instance('ccall is not compatible with WASM_ESM_INTEGRATION')
6957+
@no_modularize_instance('ccall is not compatible with MODULARIZE=instance')
69586958
def test_ccall(self):
69596959
self.emcc_args.append('-Wno-return-stack-address')
69606960
self.set_setting('EXPORTED_RUNTIME_METHODS', ['ccall', 'cwrap', 'STACK_SIZE'])
@@ -6999,7 +6999,7 @@ def test_ccall(self):
69996999
if self.maybe_closure():
70007000
self.do_core_test('test_ccall.cpp')
70017001

7002-
@no_modularize_instance('ccall is not compatible with WASM_ESM_INTEGRATION')
7002+
@no_modularize_instance('ccall is not compatible with MODULARIZE=instance')
70037003
def test_ccall_cwrap_fast_path(self):
70047004
self.emcc_args.append('-Wno-return-stack-address')
70057005
self.set_setting('EXPORTED_RUNTIME_METHODS', ['ccall', 'cwrap'])
@@ -8132,7 +8132,7 @@ def test_async_loop(self):
81328132
def test_async_hello_v8(self):
81338133
self.test_async_hello()
81348134

8135-
@no_modularize_instance('ccall is not compatible with WASM_ESM_INTEGRATION')
8135+
@no_modularize_instance('ccall is not compatible with MODULARIZE=instance')
81368136
def test_async_ccall_bad(self):
81378137
# check bad ccall use
81388138
# needs to flush stdio streams
@@ -8164,7 +8164,7 @@ def test_async_ccall_bad(self):
81648164
self.do_runf('main.c', 'The call to main is running asynchronously.')
81658165

81668166
@with_asyncify_and_jspi
8167-
@no_modularize_instance('ccall is not compatible with WASM_ESM_INTEGRATION')
8167+
@no_modularize_instance('ccall is not compatible with MODULARIZE=instance')
81688168
def test_async_ccall_good(self):
81698169
# check reasonable ccall use
81708170
self.set_setting('ASYNCIFY')
@@ -8193,7 +8193,7 @@ def test_async_ccall_good(self):
81938193
'exit_runtime': (True,),
81948194
})
81958195
@with_asyncify_and_jspi
8196-
@no_modularize_instance('ccall is not compatible with WASM_ESM_INTEGRATION')
8196+
@no_modularize_instance('ccall is not compatible with MODULARIZE=instance')
81978197
def test_async_ccall_promise(self, exit_runtime):
81988198
if self.get_setting('ASYNCIFY') == 2:
81998199
self.set_setting('JSPI_EXPORTS', ['stringf', 'floatf'])
@@ -9544,7 +9544,7 @@ def test_emscripten_stack(self):
95449544
self.do_core_test('test_stack_get_free.c')
95459545

95469546
# Tests settings.ABORT_ON_WASM_EXCEPTIONS
9547-
@no_modularize_instance('ABORT_ON_WASM_EXCEPTIONS')
9547+
@no_modularize_instance('ccall is not compatible with MODULARIZE=instance')
95489548
def test_abort_on_exceptions(self):
95499549
self.set_setting('ABORT_ON_WASM_EXCEPTIONS')
95509550
self.set_setting('ALLOW_TABLE_GROWTH')
@@ -9553,7 +9553,7 @@ def test_abort_on_exceptions(self):
95539553
self.emcc_args += ['-lembind', '--post-js', test_file('core/test_abort_on_exceptions_post.js')]
95549554
self.do_core_test('test_abort_on_exceptions.cpp', interleaved_output=False)
95559555

9556-
@no_modularize_instance('ABORT_ON_WASM_EXCEPTIONS')
9556+
@no_esm_integration('ABORT_ON_WASM_EXCEPTIONS is not compatible with WASM_ESM_INTEGRATION')
95579557
def test_abort_on_exceptions_main(self):
95589558
# The unhandled exception wrappers should not kick in for exceptions thrown during main
95599559
self.set_setting('ABORT_ON_WASM_EXCEPTIONS')
@@ -9567,7 +9567,7 @@ def test_abort_on_exceptions_main(self):
95679567

95689568
@node_pthreads
95699569
@flaky('https://github.com/emscripten-core/emscripten/issues/20067')
9570-
@no_modularize_instance('ABORT_ON_WASM_EXCEPTIONS')
9570+
@no_esm_integration('ABORT_ON_WASM_EXCEPTIONS is not compatible with WASM_ESM_INTEGRATION')
95719571
def test_abort_on_exceptions_pthreads(self):
95729572
self.set_setting('ABORT_ON_WASM_EXCEPTIONS')
95739573
self.set_setting('PROXY_TO_PTHREAD')

tools/link.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,8 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
810810
exit_with_error('WASM_ESM_INTEGRATION is not compatible with WASM2JS')
811811
if settings.MAYBE_WASM2JS:
812812
exit_with_error('WASM_ESM_INTEGRATION is not compatible with MAYBE_WASM2JS')
813+
if settings.ABORT_ON_WASM_EXCEPTIONS:
814+
exit_with_error('WASM_ESM_INTEGRATION is not compatible with ABORT_ON_WASM_EXCEPTIONS')
813815

814816
if settings.MODULARIZE and settings.MODULARIZE not in [1, 'instance']:
815817
exit_with_error(f'Invalid setting "{settings.MODULARIZE}" for MODULARIZE.')
@@ -830,8 +832,6 @@ def limit_incoming_module_api():
830832
diagnostics.warning('experimental', 'MODULARIZE=instance is still experimental. Many features may not work or will change.')
831833
if not settings.EXPORT_ES6:
832834
exit_with_error('MODULARIZE=instance requires EXPORT_ES6')
833-
if settings.ABORT_ON_WASM_EXCEPTIONS:
834-
exit_with_error('MODULARIZE=instance is not compatible with ABORT_ON_WASM_EXCEPTIONS')
835835
if settings.ASYNCIFY == 1:
836836
exit_with_error('MODULARIZE=instance is not compatible with -sASYNCIFY=1')
837837
if settings.DYNCALLS:

0 commit comments

Comments
 (0)