https://github.com/tiran/cpython-wasm-test
Test CPython WebAssembly builds with Emscripten SDK
https://github.com/tiran/cpython-wasm-test
emscripten python wasi wasm webassembly
Last synced: 15 days ago
JSON representation
Test CPython WebAssembly builds with Emscripten SDK
- Host: GitHub
- URL: https://github.com/tiran/cpython-wasm-test
- Owner: tiran
- License: bsd-3-clause
- Created: 2022-07-17T16:44:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-09T01:07:20.000Z (almost 3 years ago)
- Last Synced: 2024-12-30T01:38:35.767Z (9 months ago)
- Topics: emscripten, python, wasi, wasm, webassembly
- Language: Shell
- Homepage:
- Size: 107 KB
- Stars: 48
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CPython WebAssembly nightly tests & unofficial builds
Test CPython WebAssembly builds with Emscripten SDK and WASI SDK. Build
artifacts are available from latest scheduled *Emscripten nightly tests* and
*WASI SDK nightly tests*.The project also provides [unofficial builds](https://github.com/tiran/cpython-wasm-test/releases)
of CPython for Emscripten and WASI.See [availability notes](https://docs.python.org/3.11/library/intro.html) and
[WASM README.md](https://github.com/python/cpython/blob/main/Tools/wasm/README.md)
for platform limitations.## Emscripten build artifacts
[Emscripten nightly tests](https://github.com/tiran/cpython-wasm-test/actions/workflows/emsdk.yml?query=event%3Aschedule)
The `emsdk-tot-upstream` builds are using Emscripte tip-of-tree (nightlies).
### Emscripten browser target
- `Python-3.11dev-wasm32-emscripten-3.1.24-browser`: Python 3.11 branch, Emscripten SDK 3.1.24
- `Python-3.11dev-wasm32-emscripten-3.1.24-browser-debug`: Python 3.11 branch,
Emscripten SDK 3.1.24, debug build with additional symbols and fewer
optimizations
- `Python-3.11dev-wasm32-emscripten-3.1.24-browser`: Python main branch (3.12), Emscripten SDK 3.1.24The files must be served from a web server. You can use the
`./wasm_webserver.py` script to run a local web server and
access the browser REPL from http://localhost:8000/python.html### Emscripte NodeJS target
- `Python-3.11dev-wasm32-emscripten-3.1.24-node-dl`: WASM dynamic linking, Python
3.11 branch, Emscripten SDK 3.1.24
- `Python-3.11dev-wasm32-emscripten-3.1.24-node-dl-debug`: WASM dynamic linking, Python
3.11 branch, Emscripten SDK 3.1.24, debug build with additional debug symbols and fewer
optimizations
- `Python-3.12dev-wasm32-emscripten-3.1.24-node-dl`: WASM dynamic linking, Python
main branch (3.12), Emscripten SDK 3.1.24
- `Python-3.11dev-wasm32-emscripten-3.1.24-node-pthreads`: WASM pthreads emulation,
Python 3.11 branch, Emscripten SDK 3.1.24
- `Python-3.12dev-wasm32-emscripten-3.1.24-node-pthreads`: WASM pthreads emulation,
Python main branch (3.12), Emscripten SDK 3.1.24
- `Python-3.12dev-wasm64-emscripten-tot-upstream-node`: wasm64-emscripten (MEMORY64),
Python main branch (3.12), Emscripten SDK tip-of-tree.Run:
```shell
node python.js
```You may have to specify `--experimental-wasm-bigint` for older Node versions and
`--experimental-wasm-threads --experimental-wasm-bulk-memory` for pthread builds.**NOTE** `wasm64-emscripten` is experimental and requires Node >= 16 and
`--wasm-experimental-memory64` options.## WASI build artifacts
[WASI nightly tests](https://github.com/tiran/cpython-wasm-test/actions/workflows/wasi.yml?query=event%3Aschedule)
- `Python-3.11dev-wasm32-wasi-16`: Python 3.11 with WASI-SDK 16
- `Python-3.12dev-wasm32-wasi-16`: Python main branch (3.12-dev) with WASI-SDK 16Run:
```shell
wasmtime run --dir . -- python.wasm
```Needs a recent version of [wasmtime](https://wasmtime.dev/).
## Known issues
- Emscripten 3.1.14: no main argv with PROXY_TO_PTHREAD [#17338](https://github.com/emscripten-core/emscripten/issues/17338)
- Emscripten 3.1.16: 64 bit time_t broke utime(), [#17393](https://github.com/emscripten-core/emscripten/issues/17393)
- Emscripten 3.1.20: argv handling broken [#17720](https://github.com/emscripten-core/emscripten/issues/17720)