Skip to content

New function emscripten_has_asyncify #9734

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 3 commits into from
Oct 31, 2019
Merged

Conversation

Beuc
Copy link
Contributor

@Beuc Beuc commented Oct 29, 2019

@gabrielcuvillier
Copy link
Contributor

Good idea.

Actually, I can think of a way to already get the info:

emscripten_get_compiler_setting("ASYNCIFY")

It needs -s RETAIN_COMPILER_SETTINGS=1 though

@sbc100
Copy link
Collaborator

sbc100 commented Oct 29, 2019

True, but I wonder what the space cost of RETAIN_COMPILER_SETTINGS is?

@Beuc
Copy link
Contributor Author

Beuc commented Oct 29, 2019

Also emscripten_get_compiler_setting hits a JavaScript error if not compiled-in.
Since we want to use the new function in the SDL2 port by default, that's annoying, and requires an update to existing build systems that use SDL2 outside of the port system (e.g. upstream SDL2 tarballs) so they add -s RETAIN_COMPILER_SETTINGS at link time. Not to mention people might not want to disclose their compiler settings :)
EDIT: size: out.js += 6kB

To a lesser extent the new functions also currently encapsulates ASYNCIFY||EMTERPRETER_ASYNC.

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good with some minor comments.

And agreed that while RETAIN_COMPILER_SETTINGS can do the same, it's nice to have a direct API for this that doesn't require a new build flag for users. So this makes Asyncify easier for people to use.

@Beuc
Copy link
Contributor Author

Beuc commented Oct 30, 2019

Done!

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@kripken
Copy link
Member

kripken commented Oct 30, 2019

Oh wait, tests are failing, that's odd.

Do you see the failures locally as well?

@Beuc
Copy link
Contributor Author

Beuc commented Oct 30, 2019

test_emscripten_has_asyncify works locally for me.
Not sure what's happening :/

@Beuc
Copy link
Contributor Author

Beuc commented Oct 30, 2019

I can reproduce with fastcomp which complains about ASYNCIFY being removed, while we need to set it for the testcase - I disabled the test in fastcomp.

@kripken
Copy link
Member

kripken commented Oct 31, 2019

Makes sense to disable it for fastcomp, yeah.

@kripken kripken merged commit a05b7e6 into emscripten-core:incoming Oct 31, 2019
@Beuc Beuc deleted the hasasync branch November 1, 2019 13:23
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
Checks if ASYNCIFY was used in the build.

This can help SDL decide how to sleep, Cf. emscripten-ports/SDL2#70
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.

4 participants