Unofficial release and nightly builds for WebAssembly platforms

I got some demand from the community to provide builds of Python for browser, Node, and WASI. We don’t provide official, yet. I extended my repo GitHub - tiran/cpython-wasm-test: Test CPython WebAssembly builds with Emscripten SDK of nightly tests with builds from release tags.

You can download 3.11.0b5 builds from the release page. The repo also contains some instructions how to run the builds. The release bundles are self-contained and come with a subset of Python’s stdlib.

9 Likes

And for people who would just like to test if their modules can build/run or compile them with mypyc under wasm emscripten ( not wasi ! use tiran’s link for that ) : the prebuilts (emsdk+cpython+lots of common system libraries) used to build pygame are available here : Releases · pygame-web/python-wasm-sdk · GitHub

nb : use Ubuntu 22.04 and unpack in /

ctypes enabled, no threads, backward compatible to chromium 81.0.4044 ( android kitkat 4.4 )

the shortcut is : /opt/python-wasm-sdk/python3-wasm

eg to build a wheel
/opt/python-wasm-sdk/python3-wasm setup.py bdist_wheel

Thank you for making these builds @tiran!

It looks like the auto-build didn’t run for 3.11.0: Releases · tiran/cpython-wasm-test · GitHub

It may be due to these failures, which seem to be related to the version of Node used (Node 12 vs 16) in the GitHub actions: Actions · tiran/cpython-wasm-test · GitHub

Would it be possible/make any sense to fold these into the container images I build for all active Python versions?

1 Like

My hope is we can get WebAssembly to tier 2 and have builds be a part of the official release process.

2 Likes

Nightly WASI builds are now passing again. Christian also changed things so that as long as the specified, stable wasmtime passes then the built versions get uploaded.

I’m currently trying to fix .gitignore seems a bit too aggressive or make distclean isn't aggressive enough · Issue #97731 · python/cpython · GitHub so that everything WASI-related is green everywhere. Then I’m going to try to submit a PR so that build artifacts also get uploaded (so you can build extension modules for WASI).

As for making a 3.11.0 release, only @tiran has that ability as that’s done manually via a workflow dispatch trigger.