Skip to content

Disable assertions in tsgen - #25780

Closed
stephenduong1004 wants to merge 2 commits into
emscripten-core:mainfrom
stephenduong1004:patch-2
Closed

Disable assertions in tsgen#25780
stephenduong1004 wants to merge 2 commits into
emscripten-core:mainfrom
stephenduong1004:patch-2

Conversation

@stephenduong1004

Copy link
Copy Markdown
Collaborator

When using tsgen with -sASYNCIFY=1 and assertions enabled, an assertion failure occurs: Assertion failed: missing Wasm export: asyncify_start_unwind. This is due to #25541.

This PR disables assertions when running tsgen to resolve the issue.

When using tsgen with -sASYNCIFY=1 and assertions enabled, an assertion failure occurs: `Assertion failed: missing Wasm export: asyncify_start_unwind`. This is due to emscripten-core#25541.

This change disables assertions when running tsgen to resolve the issue.
@sbc100
sbc100 requested a review from brendandahl November 11, 2025 23:15
Comment thread tools/link.py Outdated

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@brendandahl do you know why this is needed?

Can you add a tsgen test that covers this case?

Comment thread tools/link.py
settings.MEMORY64 = 2
# Source maps haven't been generated yet and aren't needed to run embind_gen.
settings.LOAD_SOURCE_MAP = 0
settings.ASSERTIONS = 0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe add a comment here as to why this is needed?

@brendandahl

Copy link
Copy Markdown
Collaborator

@brendandahl do you know why this is needed?

We run tsgen before the wasm-opt asyncify pass so the asyncify functions haven't been created yet.

@kripken

kripken commented Nov 11, 2025

Copy link
Copy Markdown
Member

Yeah, basically the wasm isn't fully generated yet... disabling assertions fixes asserts that expect those contents, but I wonder if we might hit other issues later. If so, for Asyncify at least, we'd need to run it before tsgen somehow...

brendandahl added a commit that referenced this pull request Dec 3, 2025
When using `tsgen` with `-sASYNCIFY=1` and assertions enabled, an
assertion failure occurs: `Assertion failed: missing Wasm export:
asyncify_start_unwind`. This is due to
#25541.

This PR disables assertions for the `_asyncify_<x>` exports when running
`tsgen` to resolve the issue.

Continuation of #25780

---------

Co-authored-by: stephenduong1004 <stephenduong@google.com>
Co-authored-by: Alon Zakai <alonzakai@gmail.com>
@brendandahl

Copy link
Copy Markdown
Collaborator

Fixed slightly differently in #25899

inolen pushed a commit to inolen/emscripten that referenced this pull request Feb 13, 2026
…#25899)

When using `tsgen` with `-sASYNCIFY=1` and assertions enabled, an
assertion failure occurs: `Assertion failed: missing Wasm export:
asyncify_start_unwind`. This is due to
emscripten-core#25541.

This PR disables assertions for the `_asyncify_<x>` exports when running
`tsgen` to resolve the issue.

Continuation of emscripten-core#25780

---------

Co-authored-by: stephenduong1004 <stephenduong@google.com>
Co-authored-by: Alon Zakai <alonzakai@gmail.com>
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