Skip to content

Conversation

@brendandahl
Copy link
Collaborator

@brendandahl brendandahl commented Dec 2, 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

stephenduong1004 and others added 4 commits December 2, 2025 23:00
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.
@brendandahl brendandahl requested review from kripken and sbc100 December 2, 2025 23:30
Co-authored-by: Alon Zakai <alonzakai@gmail.com>
@brendandahl
Copy link
Collaborator Author

Looks like some AOT JS tests rely on the assertions being in the code. I'm thinking I'll just disable ASYNCIFY=1 during tsgen.

@sbc100
Copy link
Collaborator

sbc100 commented Dec 3, 2025

Looks like some AOT JS tests rely on the assertions being in the code. I'm thinking I'll just disable ASYNCIFY=1 during tsgen.

Will it no change the possible shape of the API? At least the JS looks different with that option enabled vs disabled.

The other option is to wait until post-asyncify to run the TS bindings generation?

@brendandahl
Copy link
Collaborator Author

Will it no change the possible shape of the API? At least the JS looks different with that option enabled vs disabled.

It will change the API, but we don't currently generate the correct definitions for async exported functions with JSPI or Asyncify. This is something we should probably fix at some point. FWIW, async embind exports have the correct definitions.

The other option is to wait until post-asyncify to run the TS bindings generation?

The issue with waiting until after binaryen is run, is that is also post optimization. After opt, emscript doesn't work with the minified binary.

AFAICT, the only special functions that binaryen adds are the asyncify_<x>. I'm thinking I'll make a special case for those in the assertions when running with tsgenertion. That way I don't have to disable assertions or asyncify.

@brendandahl brendandahl changed the title [tsgen] Disable assertions in tsgen. [tsgen] Remove asyncify function exports assertions. Dec 3, 2025
@brendandahl brendandahl merged commit 05db1ba into emscripten-core:main Dec 3, 2025
34 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.

4 participants