Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jul 2, 2021

Support for addAtMain in applications without a main function was
removed in #13901 but I missed that fact that webidl_binder.py was doing
this.

This change replaces addAtMain with addOnInit and also makes the use
of addAtMain in applications withoiut a main into an error so that
the problem (and solution) should be clear.

Update webidl binder test to only use sync compilation when needed, so
that code in question actually gets tested.

This change also reduces code size by not including addAtMain at all
in applications without a main.

Fixes: #14583

@sbc100 sbc100 requested a review from kripken July 2, 2021 20:26
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.

lgtm, but would it make sense to first figure out the possible regression that came up today in the last PR in this area? I mean, landing this now may make the regression harder to diagnose perhaps?

@sbc100 sbc100 changed the title Only define addAtMain and __ATMAIN__ if HAS_MAIN Remove use of addAtMain is webidl_binder.py Jul 7, 2021
@sbc100
Copy link
Collaborator Author

sbc100 commented Jul 7, 2021

Updated to include the actual fix for #14583 and an improved test for webidl_binder.

Support for `addAtMain` in application without a main function was
removed in #13901 but I missed that fact that webidl_binder.py was doing
this.

This change replaces `addAtMain` with `addOnInit` and also makes the use
of `addAtMain` in applications withoiut a `main` into an error so that
the problem (and solution) should be clear.

Update webidl binder test to only use sync compilation when needed, so
that code in question actually gets tested.

This change also reduces code size by not including `addAtMain` at all
in applcications without a `main`.

Fixes: #14583.
@kripken
Copy link
Member

kripken commented Jul 13, 2021

See my question from earlier - did we address that?

@sbc100
Copy link
Collaborator Author

sbc100 commented Jul 13, 2021

Yes. Firstly, I found and fixed the regression here in this change (the webidl breakage). Secondly, this change would have made the regression easier to spot since it no longer fails silently.

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.

Got it, thanks for the extra context!

@sbc100 sbc100 merged commit e6f4d49 into main Jul 13, 2021
@sbc100 sbc100 deleted the limit_atmain branch July 13, 2021 16:50
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.

Emscripten 2.0.18 & higher compiles+links Box2D without error, yet produces incorrect code

3 participants