emscripten-core / emscripten-core/emscripten
ASYNCIFY and INCOMING_MODULE_JS_API
- Vorherrschende Sprache
- C++
- Sterne
- 27.6k
- Forks
- 3.6k
- Ø Merge
- 1 T. 14 Std.
- Gemergte PRs (30 T.)
- 125
Beschreibung
I noticed that if I use `ASYNCIFY` and `INCOMING_MODULE_JS_API` together, then I must include `noExitRuntime` in the `INCOMING_MODULE_JS_API` list even if I don't actually provide it in the `Module`, otherwise Asyncify won't work. Apparently this has to do with this part of the code:
https://github.com/emscripten-core/emscripten/blob/9ac0425b20d0c1befb54e61d334b245bdb97c0e0/src/library.js#L3012-L3019
Which implies that if `noExitRuntime` is not included in the list, `keepRuntimeAlive()` will always return `false` so Asyncify is impossible. But why would I add it to the list if I don't intend to provide it? This seems like a bug to me.
**Version of emscripten/emsdk:**
```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.59 (0e4c5994eb5b8defd38367a416d0703fd506ad81)
clang version 19.0.0git (https:/github.com/llvm/llvm-project df762a1643bb5b0b3c907611d118c82d4b68a39d)
Target: wasm32-unknown-emscripten
Thread model: posix
```
Beitragsleitfaden
Rechercherichtung
Beginnen Sie bei src/library.js in den Zeilen 3012-3019 und reproduzieren Sie die gemeldete Interaktion zwischen ASYNCIFY und INCOMING_MODULE_JS_API unter Verwendung der angegebenen Emscripten-Version. Verfolgen Sie, wie keepRuntimeAlive() mit einem fehlenden noExitRuntime-Eintrag umgeht, und überprüfen Sie anschließend, dass Asyncify funktioniert, ohne zu verlangen, dass eine ungenutzte Module-Eigenschaft aufgelistet wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, wasm
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100