Commit graph

12 commits

Author SHA1 Message Date
Hood Chatham
ecb3f23b94
gh-136976: Emscripten: Add _decimal and libmpdec (#136997)
Adds tooling to build mpdec (and thus _decimal) as part of an Emscripten build.
2025-07-24 06:31:30 +00:00
Hood Chatham
bbe589f93c
gh-133600: Move config.site-wasm32-emscripten into the emscripten folder (#136934)
Reorganises the large Emscripten-specific file into the Emscripten folder.
2025-07-22 07:58:31 +08:00
Hood Chatham
9c7b2af73d
gh-136852: Emscripten: Fix bug in #136853 (#136909)
We need to get rid of some whitespace to make this work.
2025-07-21 11:17:36 +02:00
Hood Chatham
aec7f5f8b2
gh-136852: Emscripten: Add PYTHON_NODE_VERSION environment variable (#136853)
To choose the node version we use. Together with:
https://github.com/python/buildmaster-config/pull/614
closes #136852.
2025-07-21 00:30:35 +02:00
Hood Chatham
7ae4749d06
gh-124621: Emscripten: Add support for async input devices (GH-136822)
This is useful for implementing proper `input()`. It requires the
JavaScript engine to support the wasm JSPI spec which is now stage 4.
It is supported on Chrome since version 137 and on Firefox and node
behind a flag.

We override the `__wasi_fd_read()` syscall with our own variant that
checks for a readAsync operation. If it has it, we use our own async
variant of `fd_read()`, otherwise we use the original `fd_read()`.
We also add a variant of `FS.createDevice()` called
`FS.createAsyncInputDevice()`.

Finally, if JSPI is available, we wrap the `main()` symbol with
`WebAssembly.promising()` so that we can stack switch from `fd_read()`.
If JSPI is not available, attempting to read from an AsyncInputDevice
will raise an `OSError`.
2025-07-19 17:14:29 +02:00
Russell Keith-Magee
34393cbdd4
gh-135648: Document that shutil.copyfileobj doesn't flush (#135737)
Adds a note about flush/close on copyfileobj, and updates 
the Emscripten build script to follow documented advice.
2025-06-24 08:55:50 +08:00
Lukas
146b981f76
Silence system utils tests in emscripten python.sh (#133044)
Ensure that checks for system functions don't leak onto stdout on failure.
2025-04-28 06:13:02 +08:00
Hood Chatham
3b18af964d
gh-127629: Add ctypes to the Emscripten build (#127683)
Adds tooling to build libffi and add ctypes to the stdlib for Emscripten.
2024-12-10 10:32:58 +08:00
Hood Chatham
d8d12b37b5
gh-127503: Fix realpath handling in emscripten cli (#127632)
Corrects the handling of realpath on Linux.
2024-12-09 10:03:11 +08:00
Hood Chatham
87faf0a9c4
gh-127503: Emscripten make Python.sh function as proper Python CLI (#127506)
Modifies the python.sh script to work on macOS, and adapt to recent emscripten changes.
2024-12-05 08:44:50 +08:00
Hood Chatham
1629d2ca56
gh-126898: Emscripten support: Use es6 modules (#126903)
Modify Emscripten support to use ES6 modules.
2024-11-21 15:10:46 +11:00
Hood Chatham
f8276bf5f3
gh-126187 Add emscripten.py script to automate emscripten build (#126190)
Add emscripten.py script to automate emscripten build.

This is modeled heavily on `Tools/wasm/wasi.py`. This will form the basis of an Emscripten build bot.
2024-11-09 10:12:55 +08:00