Skip to content

Commit 874faab

Browse files
committed
[esm-integration] Add a new core test mode and either fix or disable all test.
This is fairly larger change which can likely to split up before landing.
1 parent 451bbc6 commit 874faab

File tree

8 files changed

+140
-31
lines changed

8 files changed

+140
-31
lines changed

.circleci/config.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,21 @@ jobs:
659659
steps:
660660
- run-tests-linux:
661661
test_targets: "instance"
662+
test-esm-integration:
663+
# We don't use `bionic` here since its tool old to run recent node versions:
664+
# `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found`
665+
executor: linux-python
666+
steps:
667+
- prepare-for-tests
668+
# The linux-python image uses /home/circleci rather than /root and jsvu
669+
# hardcodes /root into its launcher scripts so we need to reinstall v8.
670+
- run: rm -rf $HOME/.jsvu
671+
- install-v8
672+
- install-node-canary
673+
- run-tests:
674+
title: "esm-integration"
675+
test_targets: "esm-integration"
676+
- upload-test-results
662677
test-wasm2js1:
663678
environment:
664679
EMTEST_SKIP_NODE_CANARY: "1"
@@ -811,10 +826,6 @@ jobs:
811826
core0.test_pthread_join_and_asyncify
812827
core0.test_async_ccall_promise_jspi*
813828
core0.test_cubescript_jspi
814-
esm_integration.test_fs_js_api*
815-
esm_integration.test_inlinejs3
816-
esm_integration.test_embind_val_basics
817-
esm_integration.test_undefined_main
818829
"
819830
# Run some basic tests with the minimum version of node that we currently
820831
# support in the generated code.
@@ -1142,6 +1153,7 @@ workflows:
11421153
- test-modularize-instance:
11431154
requires:
11441155
- build-linux
1156+
- test-esm-integration
11451157
- test-browser-chrome
11461158
- test-browser-chrome-2gb:
11471159
requires:

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ fix in future releses. Current limitations include:
138138
* The output of file_packager is not compatible so :ref:`emcc-preload-file` and
139139
:ref:`emcc-embed-file` do not work.
140140

141+
141142
Source Phase Imports (experimental)
142143
===================================
143144

@@ -167,5 +168,14 @@ This setting implicitly enables :ref:`export_es6` and sets :ref:`MODULARIZE` to
167168
``instance``. Because of this all the same limitations mentioned above for
168169
``-sMODULARIZE=intance`` apply.
169170

171+
Some additionl limitaion are:
172+
173+
- ``-pthread`` / :ref:`wasm_workers` are not yet supported.
174+
175+
- Setting :ref:`wasm` to ``0`` is not supported.
176+
177+
- Setting :ref:`wasm_async_compilation` to ``0`` is not supported.
178+
179+
170180
.. _Source phase imports: https://github.com/tc39/proposal-source-phase-imports
171181
.. _Wasm ESM integration: https://github.com/WebAssembly/esm-integration

src/lib/libasync.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ addToLibrary({
498498
});
499499
},
500500

501+
#if !SOURCE_PHASE_IMPORTS && !WASM_ESM_INTEGRATION
501502
emscripten_lazy_load_code__async: true,
502503
emscripten_lazy_load_code: () => Asyncify.handleSleep((wakeUp) => {
503504
// Update the expected wasm binary file to be the lazy one.
@@ -517,6 +518,7 @@ addToLibrary({
517518
var deferred = wasmBinaryFile.slice(0, -5) + '.deferred.wasm';
518519
await instantiateAsync(null, deferred, imports);
519520
},
521+
#endif
520522

521523
$Fibers__deps: ['$Asyncify', 'emscripten_stack_set_limits', '$stackRestore'],
522524
$Fibers: {

test/common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def metafunc(self, with_minimal_runtime, *args, **kwargs):
522522
print('parameterize:minimal_runtime=%s' % with_minimal_runtime)
523523
assert self.get_setting('MINIMAL_RUNTIME') is None
524524
if with_minimal_runtime:
525-
if self.get_setting('MODULARIZE') == 'instance':
525+
if self.get_setting('MODULARIZE') == 'instance' or self.get_setting('WASM_ESM_INTEGRATION'):
526526
self.skipTest('MODULARIZE=instance is not compatible with MINIMAL_RUNTIME')
527527
self.set_setting('MINIMAL_RUNTIME', 1)
528528
# This extra helper code is needed to cleanly handle calls to exit() which throw
@@ -604,6 +604,7 @@ def can_do_standalone(self, impure=False):
604604
return self.is_wasm() and \
605605
self.get_setting('STACK_OVERFLOW_CHECK', 0) < 2 and \
606606
not self.get_setting('MINIMAL_RUNTIME') and \
607+
not self.get_setting('WASM_ESM_INTEGRATION') and \
607608
not self.get_setting('SAFE_HEAP') and \
608609
not any(a.startswith('-fsanitize=') for a in self.emcc_args)
609610

@@ -1138,6 +1139,8 @@ def require_wasm2js(self):
11381139
self.skipTest('wasm2js is not compatible with MEMORY64')
11391140
if self.is_2gb() or self.is_4gb():
11401141
self.skipTest('wasm2js does not support over 2gb of memory')
1142+
if self.get_setting('WASM_ESM_INTEGRATION'):
1143+
self.skipTest('wasm2js is not compatible with WASM_ESM_INTEGRATION')
11411144

11421145
def setup_nodefs_test(self):
11431146
self.require_node()
@@ -1160,6 +1163,8 @@ def setup_node_pthreads(self):
11601163
self.emcc_args += ['-Wno-pthreads-mem-growth', '-pthread']
11611164
if self.get_setting('MINIMAL_RUNTIME'):
11621165
self.skipTest('node pthreads not yet supported with MINIMAL_RUNTIME')
1166+
if self.get_setting('WASM_ESM_INTEGRATION'):
1167+
self.skipTest('pthreads not yet supported with WASM_ESM_INTEGRATION')
11631168
nodejs = self.get_nodejs()
11641169
self.js_engines = [nodejs]
11651170
self.node_args += shared.node_pthread_flags(nodejs)

test/core/test_demangle_stacks.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <emscripten.h>
1010

11+
EM_JS_DEPS(deps, "$jsStackTrace");
12+
1113
namespace NameSpace {
1214
class Class {
1315
public:

0 commit comments

Comments
 (0)