Title: embedding CPython in emscripten build requires `stringToNewUTF8` symbol · Issue #156243 · python/cpython · GitHub
Open Graph Title: embedding CPython in emscripten build requires `stringToNewUTF8` symbol · Issue #156243 · python/cpython
X Title: embedding CPython in emscripten build requires `stringToNewUTF8` symbol · Issue #156243 · python/cpython
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: stringToNewUTF8 is a library symbol and not included by default; add it...
Open Graph 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: stringToNewUTF8 is a library sy...
X 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: stringToNewUTF8 is a library sy...
Opengraph URL: https://github.com/python/cpython/issues/156243
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"embedding CPython in emscripten build requires `stringToNewUTF8` symbol","articleBody":"# Bug report\n\n### Bug description:\n\nIn the PyO3 CI I am testing out building emscripten CPython with 3.15rc1. I get a failure when executing the webassembly module:\n\n> warning: `stringToNewUTF8` is 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')\n\n```\nTypeError: stringToNewUTF8 is not a function\n at _Py_emscripten_runtime (/home/david/dev/pyo3/target/wasm32-unknown-emscripten/debug/deps/pyo3-a56cdf8abaaca849.js:8007:500)\n```\n\nIt looks like the symbol comes from \n\nhttps://github.com/python/cpython/blob/b062727097e997bcb900e11503d3248daac903da/Python/sysmodule.c#L3902\n\n----\n\nI 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.\n\ncc @hoodmane \n\n### CPython versions tested on:\n\n3.15, 3.16, CPython main branch\n\n### Operating systems tested on:\n\nOther\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156335\n* gh-156383\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/davidhewitt","@type":"Person","name":"davidhewitt"},"datePublished":"2026-08-22T21:24:26Z","url":"https://github.com/python/cpython/issues/156243"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4294eaa3-7d77-6ba0-cd67-4d6395d4745d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB44:4D9F2:14821FE:1B42BFC:6B01F9E4 |
| html-safe-nonce | b8bc6153224c0dfc9caa45e76f69ca897d98d663499d97f1c2dc4641275bb29e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjQ0OjREOUYyOjE0ODIxRkU6MUI0MkJGQzo2QjAxRjlFNCIsInZpc2l0b3JfaWQiOiIxNzg0NDIzODUyNzE5NDU3MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 69233136b152191b04412e725f4515a7aebb1507dab8c80e32195bb4a71a2f6f |
| hovercard-subject-tag | issue:5224004089 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/156243/issue_layout |
| twitter:image | https://opengraph.githubassets.com/40edbfdc9fb84d2a453d76eb7cf56a1ed8485dd818be5c0a3df2686e26cfed81/python/cpython/issues/156243 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/40edbfdc9fb84d2a453d76eb7cf56a1ed8485dd818be5c0a3df2686e26cfed81/python/cpython/issues/156243 |
| og:image:alt | 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: stringToNewUTF8 is a library sy... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davidhewitt |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width