Skip to content

Build-time error on use of emscripten_promise_any if Promise.any is not available #19172

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 1 commit into from
Apr 14, 2023

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Apr 13, 2023

No description provided.

@sbc100 sbc100 force-pushed the conditional_promise_any branch 2 times, most recently from 5f417e5 to a88ef13 Compare April 13, 2023 16:26
@sbc100 sbc100 requested review from kripken and tlively April 13, 2023 16:26
# This test depends on Promise.any, which in turn requires a modern target. Check that it
# fails to even build without bumping the min versions:
err = self.expect_fail([EMCC, test_file('core/test_promise.c')])
self.assertContained('error: emscripten_promise_any used, but Promise.any is not supported the current browser configuration', err)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.assertContained('error: emscripten_promise_any used, but Promise.any is not supported the current browser configuration', err)
self.assertContained('error: emscripten_promise_any used, but Promise.any is not supported in the current runtime configuration (run with EMCC_DEBUG=1 in the env for more details)', err)

@sbc100 sbc100 force-pushed the conditional_promise_any branch 3 times, most recently from 47693ab to 5bf1a9e Compare April 13, 2023 17:33
@sbc100 sbc100 enabled auto-merge (squash) April 13, 2023 17:52
@@ -9761,6 +9761,14 @@ def test_main_reads_args(self):

@requires_node
def test_promise(self):
# This test depends on Promise.any, which in turn requires a modern target. Check that it
# fails to even build without bumping the min versions:
err = self.expect_fail([EMCC, test_file('core/test_promise.c')])
Copy link
Member

Choose a reason for hiding this comment

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

Don't all the versions below support Promise.any, so this build should succeed rather than fail? I must be missing something.

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 default versions fail, so we run a compile here to check that it fails, then we set the correct settings and then we expect the test to pass, right?

Copy link
Member

Choose a reason for hiding this comment

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

Aha, yes, makes sense. I didn't grok that this was doing the build twice, once before and once after setting the settings.

@sbc100 sbc100 force-pushed the conditional_promise_any branch 2 times, most recently from 1af44c8 to b40e4fd Compare April 14, 2023 03:47
@sbc100 sbc100 force-pushed the conditional_promise_any branch from b40e4fd to bd5dc58 Compare April 14, 2023 06:35
@sbc100 sbc100 merged commit 97c22d4 into main Apr 14, 2023
@sbc100 sbc100 deleted the conditional_promise_any branch April 14, 2023 07:48
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.

3 participants