Skip to content
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

--emit-tsd crashes when wasmTable is exported #21788

Closed
kichikuou opened this issue Apr 19, 2024 · 0 comments · Fixed by #21789
Closed

--emit-tsd crashes when wasmTable is exported #21788

kichikuou opened this issue Apr 19, 2024 · 0 comments · Fixed by #21789
Assignees
Labels
TypeScript TypeScript Generation

Comments

@kichikuou
Copy link

Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.57 (1df9c19)

Failing command line in full:

$ touch empty.c
$ emcc empty.c -sEXPORTED_RUNTIME_METHODS=wasmTable --emit-tsd=out.d.ts
Traceback (most recent call last):
  File "/Users/k/soft/emsdk/upstream/emscripten/emcc.py", line 1590, in <module>
    sys.exit(main(sys.argv))
  File "/Users/k/soft/emsdk/python/3.9.2_64bit/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/Users/k/soft/emsdk/upstream/emscripten/emcc.py", line 1583, in main
    ret = run(args)
  File "/Users/k/soft/emsdk/upstream/emscripten/emcc.py", line 648, in run
    return link.run(linker_inputs, options, state, newargs)
  File "/Users/k/soft/emsdk/upstream/emscripten/tools/link.py", line 2987, in run
    phase_post_link(options, state, wasm_target, wasm_target, target, js_syms)
  File "/Users/k/soft/emsdk/python/3.9.2_64bit/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/Users/k/soft/emsdk/upstream/emscripten/tools/link.py", line 1902, in phase_post_link
    phase_emit_tsd(options, wasm_target, js_syms, metadata)
  File "/Users/k/soft/emsdk/python/3.9.2_64bit/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/Users/k/soft/emsdk/upstream/emscripten/tools/link.py", line 1991, in phase_emit_tsd
    all_tsd = emscripten.create_tsd(metadata, embind_tsd)
  File "/Users/k/soft/emsdk/upstream/emscripten/tools/emscripten.py", line 637, in create_tsd
    out += create_tsd_exported_runtime_methods(metadata)
  File "/Users/k/soft/emsdk/upstream/emscripten/tools/emscripten.py", line 619, in create_tsd_exported_runtime_methods
    js_doc += f'{definition["docs"]}\nRuntimeExports[\'{name}\'] = \n{definition["snippet"]};\n'
KeyError: 'snippet'
@sbc100 sbc100 added the TypeScript TypeScript Generation label Apr 19, 2024
brendandahl added a commit to brendandahl/emscripten that referenced this issue Apr 19, 2024
 - Fixes error when a runtime export is undefined.
 - Adds jsdoc for wasmTable.
 - Fixes first runtime export definition missing because of missing new line.

Fixes emscripten-core#21788
brendandahl added a commit to brendandahl/emscripten that referenced this issue Apr 19, 2024
 - Fixes error when a runtime export is undefined.
 - Adds jsdoc for wasmTable.
 - Fixes first runtime export definition missing because of missing new line.

Fixes emscripten-core#21788
brendandahl added a commit to brendandahl/emscripten that referenced this issue Apr 19, 2024
 - Fixes error when a runtime export is undefined.
 - Adds jsdoc for wasmTable.
 - Fixes first runtime export definition missing because of missing new line.

Fixes emscripten-core#21788
brendandahl added a commit that referenced this issue Apr 22, 2024
- Fixes error when a runtime export is undefined.
 - Adds jsdoc for wasmTable.
 - Fixes first runtime export definition missing because of missing new line.

Fixes #21788
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TypeScript TypeScript Generation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants