Skip to content

Commit ce82cd5

Browse files
authored
[MODULARIZE=instance] Mark file packager as incompatible for now. (#24338)
1 parent d45de28 commit ce82cd5

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ fix in future releses. Current limitations include:
125125
* :ref:`abort_on_wasm_exceptions` is not supported (requires wrapping wasm
126126
exports).
127127

128+
* The output of file_packager is not compatible so :ref:`emcc-preload-file` and
129+
:ref:`emcc-embed-file` do not work.
128130

129131
Source Phase Imports (experimental)
130132
===================================

test/test_core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3910,6 +3910,7 @@ def test_dlfcn_rtld_local(self):
39103910
self.do_runf('main.c', 'main\nfunc_a\nfunc_sub\nfunc_b\nfunc_sub\ndone\n')
39113911

39123912
@needs_dylink
3913+
@no_modularize_instance('uses file packager')
39133914
def test_dlfcn_preload(self):
39143915
# Create chain of dependencies and load the first libary with preload plugin.
39153916
# main -> libb.so -> liba.so

tools/link.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,8 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
794794
if settings.WASM_ESM_INTEGRATION:
795795
diagnostics.warning('experimental', '-sWASM_ESM_INTEGRATION is still experimental and not yet supported in browsers')
796796
default_setting('MODULARIZE', 'instance')
797-
if options.oformat != OFormat.MJS:
798-
exit_with_error('WASM_ESM_INTEGRATION is only compatible with EM module output format')
797+
if not settings.EXPORT_ES6:
798+
exit_with_error('WASM_ESM_INTEGRATION requires EXPORT_ES6')
799799
if settings.MODULARIZE != 'instance':
800800
exit_with_error('WASM_ESM_INTEGRATION requires MODULARIZE=instance')
801801
if settings.RELOCATABLE:
@@ -813,10 +813,12 @@ def limit_incoming_module_api():
813813

814814
if settings.MODULARIZE == 'instance':
815815
diagnostics.warning('experimental', 'MODULARIZE=instance is still experimental. Many features may not work or will change.')
816-
if options.oformat != OFormat.MJS:
817-
exit_with_error('MODULARIZE=instance is only compatible with ES module output format')
816+
if not settings.EXPORT_ES6:
817+
exit_with_error('MODULARIZE=instance requires EXPORT_ES6')
818818
if settings.ABORT_ON_WASM_EXCEPTIONS:
819819
exit_with_error('MODULARIZE=instance is only compatible with ABORT_ON_WASM_EXCEPTIONS')
820+
if options.use_preload_plugins or len(options.preload_files):
821+
exit_with_error('MODULARIZE=instance is not compatile with --embed-file/--preload-file')
820822
if 'INCOMING_MODULE_JS_API' in user_settings:
821823
for s in ['wasmMemory', 'INITIAL_MEMORY']:
822824
if s in settings.INCOMING_MODULE_JS_API:

0 commit comments

Comments
 (0)