-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[MODULARIZE=instance] Mark -sDYNCALLS as not supported. NFC #24340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,8 @@ if (ENVIRONMENT_IS_NODE) { | |
| // Weak map of handle functions to their wrapper. Used to implement | ||
| // addEventListener/removeEventListener. | ||
| var wrappedHandlers = new WeakMap(); | ||
| /** @suppress {checkTypes} */ | ||
| globalThis.onmessage = null; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could split the wasm workers stuff into a separate PR but I've already done a lot of splitting. Let me know if you want me to split this one off too. |
||
| function wrapMsgHandler(h) { | ||
| var f = wrappedHandlers.get(h) | ||
| if (!f) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 8312 | ||
| 8307 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 22242 | ||
| 22233 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 6617 | ||
| 6613 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 17611 | ||
| 17602 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 53705 | ||
| 53691 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 51755 | ||
| 51741 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1843,6 +1843,7 @@ def test_emscripten_get_compiler_setting(self): | |
| self.set_setting('RETAIN_COMPILER_SETTINGS') | ||
| self.do_runf(src, read_file(output).replace('waka', utils.EMSCRIPTEN_VERSION)) | ||
|
|
||
| @no_modularize_instance('MODULARIZE=instance is not compatible with ASYNCIFY=1') | ||
| def test_emscripten_has_asyncify(self): | ||
| src = r''' | ||
| #include <stdio.h> | ||
|
|
@@ -4068,6 +4069,7 @@ def test_dylink_basics_no_modify(self): | |
| self.do_basic_dylink_test() | ||
|
|
||
| @with_dylink_reversed | ||
| @no_modularize_instance('DECLARE_ASM_MODULE_EXPORTS=0 is not compatible with MODULARIZE') | ||
| def test_dylink_no_export(self): | ||
| self.set_setting('NO_DECLARE_ASM_MODULE_EXPORTS') | ||
| self.do_basic_dylink_test() | ||
|
|
@@ -5147,13 +5149,8 @@ class Bar : public Foo { | |
| @needs_dylink | ||
| def test_dylink_argv_argc(self): | ||
| # Verify that argc and argv can be sent to main when main is in a side module | ||
|
|
||
| self.emcc_args += ['--extern-pre-js', 'pre.js'] | ||
|
|
||
| create_file('pre.js', ''' | ||
| var Module = { arguments: ['hello', 'world!'] } | ||
| ''') | ||
|
|
||
| self.emcc_args += ['--pre-js', 'pre.js'] | ||
| create_file('pre.js', "Module['arguments'] = ['hello', 'world!']") | ||
| self.dylink_test( | ||
| '', # main module is empty. | ||
| r''' | ||
|
|
@@ -6343,7 +6340,7 @@ def test_dlmalloc_inline(self): | |
|
|
||
| src = read_file(path_from_root('system/lib/dlmalloc.c')) + '\n\n\n' + read_file(test_file('dlmalloc_test.c')) | ||
| self.do_run(src, '*1,0*', args=['200', '1'], force_c=True) | ||
| self.do_run('src.js', '*400,0*', args=['400', '400'], force_c=True, no_build=True) | ||
| self.do_run(self.output_name('src'), '*400,0*', args=['400', '400'], force_c=True, no_build=True) | ||
|
|
||
| @no_asan('depends on the specifics of memory size, which for asan we are forced to increase') | ||
| @no_lsan('depends on the specifics of memory size, which for lsan we are forced to increase') | ||
|
|
@@ -6356,10 +6353,11 @@ def test_dlmalloc(self): | |
| self.do_runf('dlmalloc_test.c', '*1,0*', args=['200', '1']) | ||
| self.do_run(self.output_name('dlmalloc_test'), '*400,0*', args=['400', '400'], no_build=True) | ||
|
|
||
| self.run_process([EMCC, test_file('dlmalloc_test.c'), '-sINITIAL_MEMORY=128MB', '-o', 'src.js'] + self.get_emcc_args()) | ||
| out_js = self.output_name('dlmalloc_test') | ||
| self.run_process([EMCC, test_file('dlmalloc_test.c'), '-sINITIAL_MEMORY=128MB', '-o', out_js] + self.get_emcc_args()) | ||
|
|
||
| self.do_run('src.js', '*1,0*', args=['200', '1'], no_build=True) | ||
| self.do_run('src.js', '*400,0*', args=['400', '400'], no_build=True) | ||
| self.do_run(out_js, '*1,0*', args=['200', '1'], no_build=True) | ||
| self.do_run(out_js, '*400,0*', args=['400', '400'], no_build=True) | ||
|
|
||
| # The same for new and all its variants | ||
| src = read_file(test_file('new.cpp')) | ||
|
|
@@ -6974,9 +6972,9 @@ def test_EXPORTED_RUNTIME_METHODS(self): | |
| self.do_core_test('EXPORTED_RUNTIME_METHODS.c') | ||
|
|
||
| @also_with_minimal_runtime | ||
| @no_modularize_instance('uses dynCallLegacy') | ||
| @no_wasm64('not compatible with MEMORY64') | ||
| def test_dyncall_specific(self): | ||
| if self.get_setting('MEMORY64'): | ||
| self.skipTest('not compatible with MEMORY64') | ||
| if self.get_setting('WASM_BIGINT') != 0 and not self.is_wasm2js(): | ||
| # define DYNCALLS because this test does test calling them directly, and | ||
| # in WASM_BIGINT mode we do not enable them by default (since we can do | ||
|
|
@@ -7003,7 +7001,7 @@ def test_dyncall_specific(self): | |
| }) | ||
| def test_dyncall_pointers(self, args): | ||
| if args: | ||
| self.skipTest('dynCallLegacy is not yet comatible with WASM_ESM_INTEGRATION') | ||
| self.skipTest('dynCallLegacy is not yet compatible with WASM_ESM_INTEGRATION') | ||
| self.do_core_test('test_dyncall_pointers.c', emcc_args=args) | ||
|
|
||
| @also_with_wasm_bigint | ||
|
|
@@ -7506,21 +7504,21 @@ def test_embind_val_cross_thread_deleted(self): | |
| self.do_runf('test_embind_val_cross_thread.cpp') | ||
|
|
||
| def test_embind_val_coro(self): | ||
| create_file('post.js', r'''Module.onRuntimeInitialized = () => { | ||
| create_file('pre.js', r'''Module.onRuntimeInitialized = () => { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the conversion from post.js to pre.js here and below?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding onRuntimeInitialized during post.js doesn't work in the case we do top-level-await on the wasm module because in that case (and also in the case of sync instantiation) the initialization has already been done before the post-js stuff runs.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes fixes this test so that it works in all mode. |
||
| Module.asyncCoro().then(console.log); | ||
| }''') | ||
| self.emcc_args += ['-std=c++20', '--bind', '--post-js=post.js'] | ||
| self.emcc_args += ['-std=c++20', '--bind', '--pre-js=pre.js'] | ||
| self.do_runf('embind/test_val_coro.cpp', '34\n') | ||
|
|
||
| def test_embind_val_coro_caught(self): | ||
| self.set_setting('EXCEPTION_STACK_TRACES') | ||
| create_file('post.js', r'''Module.onRuntimeInitialized = () => { | ||
| create_file('pre.js', r'''Module.onRuntimeInitialized = () => { | ||
| Module.throwingCoro().then( | ||
| console.log, | ||
| err => console.error(`rejected with: ${err.stack}`) | ||
| ); | ||
| }''') | ||
| self.emcc_args += ['-std=c++20', '--bind', '--post-js=post.js', '-fexceptions'] | ||
| self.emcc_args += ['-std=c++20', '--bind', '--pre-js=pre.js', '-fexceptions'] | ||
| self.do_runf('embind/test_val_coro.cpp', 'rejected with: std::runtime_error: bang from throwingCoro!\n') | ||
|
|
||
| def test_embind_dynamic_initialization(self): | ||
|
|
@@ -9463,6 +9461,7 @@ def test_abort_on_exceptions(self): | |
| self.emcc_args += ['-lembind', '--post-js', test_file('core/test_abort_on_exceptions_post.js')] | ||
| self.do_core_test('test_abort_on_exceptions.cpp', interleaved_output=False) | ||
|
|
||
| @no_modularize_instance('ABORT_ON_WASM_EXCEPTIONS') | ||
| def test_abort_on_exceptions_main(self): | ||
| # The unhandled exception wrappers should not kick in for exceptions thrown during main | ||
| self.set_setting('ABORT_ON_WASM_EXCEPTIONS') | ||
|
|
@@ -9476,6 +9475,7 @@ def test_abort_on_exceptions_main(self): | |
|
|
||
| @node_pthreads | ||
| @flaky('https://github.com/emscripten-core/emscripten/issues/20067') | ||
| @no_modularize_instance('ABORT_ON_WASM_EXCEPTIONS') | ||
| def test_abort_on_exceptions_pthreads(self): | ||
| self.set_setting('ABORT_ON_WASM_EXCEPTIONS') | ||
| self.set_setting('PROXY_TO_PTHREAD') | ||
|
|
@@ -9500,6 +9500,7 @@ def test_emscripten_async_call(self): | |
| self.do_run_in_out_file_test('core/test_emscripten_async_call.c') | ||
|
|
||
| @no_asan('asyncify stack operations confuse asan') | ||
| @no_modularize_instance('ASYNCIFY=1 requires DYNCALLS') | ||
| @parameterized({ | ||
| '': ([],), | ||
| 'no_dynamic_execution': (['-sDYNAMIC_EXECUTION=0'],), | ||
|
|
@@ -9517,6 +9518,7 @@ def test_embind_lib_with_asyncify(self, args): | |
|
|
||
| @no_asan('asyncify stack operations confuse asan') | ||
| @with_asyncify_and_jspi | ||
| @no_modularize_instance('uses ccall') | ||
| def test_em_async_js(self): | ||
| if not self.get_setting('ASYNCIFY'): | ||
| self.set_setting('ASYNCIFY') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this suppose to be in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes without this the
test_embind_wasm_workersdoesn't work. This basically makes wasm worker work in this mode.