Skip to content

Fix strict test suite #24431

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

Merged
merged 11 commits into from
May 29, 2025
Merged

Fix strict test suite #24431

merged 11 commits into from
May 29, 2025

Conversation

juj
Copy link
Collaborator

@juj juj commented May 29, 2025

Enable test/runner strict to pass (tested on Windows)

@juj juj force-pushed the fix_strict_test_suite branch from 9775c08 to ff33a9e Compare May 29, 2025 18:59
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % concern about INCOMING_MODULE_JS_API additive-ness

@@ -1336,17 +1336,17 @@ def in_dir(self, *pathelems):
def add_pre_run(self, code):
assert not self.get_setting('MINIMAL_RUNTIME')
create_file('prerun.js', 'Module.preRun = function() { %s }\n' % code)
self.emcc_args += ['--pre-js', 'prerun.js']
self.emcc_args += ['--pre-js', 'prerun.js', '-sINCOMING_MODULE_JS_API=[preRun]']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with doing this here is that then the test doesn't have any way to add more to INCOMING_MODULE_JS_API.

We currently don't have any way to make settings like INCOMING_MODULE_JS_API additive.

I've tried to make them additive by default (which seems like the right behaviour in almost all cases I can think of): #19938. But that PR got hung up with disagreement about how / if to change the default behaviour.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with doing this here is that then the test doesn't have any way to add more to INCOMING_MODULE_JS_API.

Yeah, I was thinking about the additivity as well while writing this. That should definitely be the best behavior to have.

The add_pre_run() is only for tests, and so far it seems that no test needed to concatenate (or that would have shown up in strict run). If/when such a test comes up, that directive can be refactored to occur at the call site.

Copy link
Collaborator Author

@juj juj May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is, either that specific test can then be written to duplicate the -sINCOMING_MODULE_JS_API=[preRun,theothersymbol], or -sINCOMING_MODULE_JS_API=[preRun] be hoisted from add_pre_run() to all the tests.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM if the tests pass

@sbc100
Copy link
Collaborator

sbc100 commented May 29, 2025

For errors like emcc: error: invalid entry in INCOMING_MODULE_JS_API: noFSInit I would suggested adding these to the EXTRA_INCOMING_JS_API list in emcc.py (and guarding their use in the source code with expectToReceiveOnModule

@@ -9414,7 +9414,11 @@ def test_pthread_dylink_longjmp(self):
@needs_dylink
@node_pthreads
def test_pthread_dylink_main_module_1(self):
self.emcc_args += ['-Wno-experimental', '-pthread', '-lhtml5']
# TODO: For some reason, -lhtml5 must be passed in -sSTRICT mode, but can NOT
# be passed when not compiling in -sSTRICT mode. That does not seem intentional?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This certainly sounds like a bug. Could you open one an link it here (and below).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juj juj enabled auto-merge (squash) May 29, 2025 21:30
@juj juj disabled auto-merge May 29, 2025 22:41
@juj juj merged commit 29a2e09 into emscripten-core:main May 29, 2025
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants