Repository navigation
Emscripten build fails with Python 3.14 #137025
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Jul 22, 2025 cc @hoodmane
The new way to build Emscripten is with:
python Tools/wasm/emscripten buildI don't think anyone uses
wasm_build.pyanymore so we should probably remove it (cc @brettcannon )Maybe it would be good to add a news entry about this change.
I agree a news entry is a good idea. I would also update
Tools/wasm/README.mdto no longer recommendwasm_build.py:
Lines 12 to 14 in aafb143
Users and developers are encouraged to use the script `Tools/wasm/wasm_build.py`. The tool automates the build process and provides assistance with installation of SDKs, running tests, etc. - addeddocsDocumentation in the Doc dirDocumentation in the Doc dirand removedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Jul 22, 2025 Right, the new instructions are in the dev guide here:
https://devguide.python.org/contrib/workflows/compile/#emscriptenI can update the readme to link there.
Further down in the readme it does say to use
python Tools/wasm/emscripten:
Lines 58 to 68 in aafb143
```shell python Tools/wasm/emscripten build ``` or you can break it out into four separate steps: ```shell python Tools/wasm/emscripten configure-build-python python Tools/wasm/emscripten make-build-python python Tools/wasm/emscripten make-libffi python Tools/wasm/emscripten configure-host python Tools/wasm/emscripten make-host ``` Reacted by Emma SmithThe new way to build Emscripten is with:
python Tools/wasm/emscripten buildI don't think anyone uses
wasm_build.pyanymore so we should probably remove it (cc @brettcannon )I should have read further down in the README. Thanks!
Using
python Tools/wasm/emscripten buildseemed to work, but the demo didn't seem to work.I had to manually copy
Tools/wasm/emscripten/web_example/python.worker.mjstocross-build/wasm32-emscripten/build/python/web_example. Then runningpython server.pyfromcross-build/wasm32-emscripten/build/python/web_exampleworked as expected.Separately, I'm not sure how to get the JSPI demo working. I noticed there was not a
server.pyfile in the newweb_example_pyrepl_jspi/directory and triedpython ../web_example/server.pybut that didn't seem to result in a working demo. The demo at http://127.0.0.1:8000 showed a dark background (the xterm.js terminal background color I assume) and didn't load anything nor show any errors in the console or network inspector tabs. The browser tab also froze. This same same black window and freezing happened in 2 versions of Chrome and in Firefox.The JSPI demo can be served with
http.server. It should work with Chrome version >= 137. (Firefox requires an experimental flag.)Which versions of Chrome did you try? Could you try opening the dev console before visiting the page with Ctrl+Shift+J and then navigate to the page and see if you see anything in the console?
I had to manually copy Tools/wasm/emscripten/web_example/python.worker.mjs to cross-build/wasm32-emscripten/build/python/web_example.
Oops, I messed that up, sorry. I'll make a PR to fix it tomorrow.
The JSPI demo can be served with
http.server. It should work with Chrome version >= 137. (Firefox requires an experimental flag.)Which versions of Chrome did you try? Could you try opening the dev console before visiting the page with Ctrl+Shift+J and then navigate to the page and see if you see anything in the console?
Ah I was apparently still on Chrome 136. I just upgraded and it works now!
I'm very excited to ship an in-browser pyrepl in the future. Thanks to all who made this possible.
- added a commit that references this issue
on Jul 31, 2025 - added a commit that references this issue
on Oct 7, 2025 - added a commit that references this issue
on Oct 9, 2025 I'm fairly certain this is resolved now; closing. If anyone is still having problems, let us know.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsTodo
Bug report
Bug description:
I tried to use emsdk
4.10.0and ran./Tools/wasm/wasm_build.py emscripten-browser build replagainst thev3.14.0rc1branch, but the build failed:It seems like the
config_sitesettings are pointing to the wrong subdirectories.I fixed that for Emscripten like this (in this branch):
The build still fails after this:
Using emsdk
4.10.0and running./Tools/wasm/wasm_build.py emscripten-browser build replagainst thev3.13.5branch works.CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
python.worker.mjsin Emscripten Web Example #137236python.worker.mjsin the Emscripten Web Example (GH-137236) #137272