summaryrefslogtreecommitdiffstats
path: root/Python/emscripten_syscalls.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.14] gh-124621: Emscripten: Support pyrepl in browser (GH-136931) (GH-136988)Łukasz Langa2025-07-221-9/+107
| | | | | | | | | | | | | | | | | | | Basic support for pyrepl in Emscripten. Limitations: * requires JSPI * no signal handling implemented As followup work, it would be nice to implement a webworker variant for when JSPI is not available and proper signal handling. Because it requires JSPI, it doesn't work in Safari. Firefox requires setting an experimental flag. All the Chromiums have full support since May. Until we make it work without JSPI, let's keep the original web_example around. (cherry picked from commit c933a6bb329bb97bc7e448388dad1b74f7ca4baa) Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Éric <merwok@netwok.org>
* [3.14] gh-136251: Improvements to WASM demo REPL (GH-136252) (GH-136977)Miss Islington (bot)2025-07-221-1/+1
| | | | | | (cherry picked from commit d1d526afe7ce62c787b150652a2ba136cb949d74) Co-authored-by: adam j hartz <adam@smatz.net> Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* [3.14] gh-124621: Emscripten: Add support for async input devices ↵Miss Islington (bot)2025-07-221-0/+182
| | | | | | | | | | | | | | | | | | | | | | | (GH-136822) (GH-136935) 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`. (cherry picked from commit 7ae4749d064bd49b0dd96172fee20c1f1678d9e9) Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* [3.14] gh-127146: Emscripten: Make os.umask() actually work (GH-136706) ↵Miss Islington (bot)2025-07-161-1/+21
| | | | | | | | | (#136711) Provide a stub implementation of umask that is enough to get some tests passing. More work is needed upstream in Emscripten to make all umask tests to pass. (cherry picked from commit 12e52cad718723636a96042f9399634392285c44) Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* [3.14] gh-127146: Report uid in Emscripten + node as native uid (GH-136509) ↵Miss Islington (bot)2025-07-161-0/+19
(#136699) Corrects the handling of getuid on emscripten, which was consistently reporting as 0. (cherry picked from commit e81c4e84b3a8688a367099e3adf9b2fcf914447f) Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>