Description
Bug report
Bug description:
In the PyO3 CI I am testing out building emscripten CPython with 3.15rc1. I get a failure when executing the webassembly module:
warning:
stringToNewUTF8is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$stringToNewUTF8')
TypeError: stringToNewUTF8 is not a function
at _Py_emscripten_runtime (/home/david/dev/pyo3/target/wasm32-unknown-emscripten/debug/deps/pyo3-a56cdf8abaaca849.js:8007:500)
It looks like the symbol comes from
Line 3902 in b062727
| return BigInt(stringToNewUTF8(info)); |
I can hack around this with a compiler flag in the PyO3 build scripts. Local AI is telling me that CPython might want to consider adding an EM_JS_DEPS declaration near to the above to link the correct symbol without downstream users having to think about it. I guess either that's actually something worth doing, or this issue can be closed.
cc @hoodmane
CPython versions tested on:
3.15, 3.16, CPython main branch
Operating systems tested on:
Other
Activity
[-]embedding CPython in emscripten build requires[/-]hoodmane commentedon Aug 22, 2026
I'll try adding
EM_JS_DEPSI'm pretty sure that's a valid approach. Thanks for the report @davidhewittgh-156243: Indicate that emscripten_runtime depends on stringToNewUTF8 (
[3.15] gh-156243: Indicate that emscripten_runtime depends on stringT…
pythongh-156243: Indicate that emscripten_runtime depends on stringTo…