# Important links
- [`os-wasi` label](https://github.com/python/cpython/labels/OS-wasi)
- [WASI dev container definition](https://github.com/python/cpython-devcontainers/tree/main/wasicontainer) ([image](https://github.com/python/cpython-devcontainers/pkgs/container/wasicontainer))
# Legend
- π₯§ beginner-friendly ("as easy as pie")
- π Working on it
- π Blocked by something
# Plans
- [ ] Move `Tools/wasm/wasi` to the top-level of the repo
- [x] Discuss [a top-level `Platforms/` directory](https://discuss.python.org/t/should-we-have-a-platforms-directory-in-the-repo/104634) ([poll](https://discuss.python.org/t/should-we-have-a-platforms-directory-in-the-repo/104634/10))
- [x] Get an answer [from the SC](https://github.com/python/steering-council/issues/317)
- [ ] π [Figure out a transition plan to `Platforms/`](https://discuss.python.org/t/moving-to-a-new-platforms-directory/105215)
- [ ] π Get the Buildbot using the WASI container ^buildbot-on-container
- [ ] PEP to specify WASI SDK compatibility expectations
- [x] Have `wasi/` check for `wasi-sdk/VERSION` -- [25 and later](https://github.com/WebAssembly/wasi-sdk/issues/471) -- when using `/opt/wasi-sdk` and warn when it doesn't match the expected version ([PR](https://github.com/python/cpython/pull/140769))
- [x] Use `/opt/wasi-sdk-NN` automatically based on what the appropriate version is ([PR](https://github.com/python/cpython/pull/137244)) ^wasi-sdk-NN
- [x] Update [[#^wasi-container]] to ship with all relevant WASI SDK versions
- [x] Write [PEP](https://github.com/brettcannon/peps/blob/wasi-support-pep/peps/pep-NNNN.rst)
- [x] Make sure [Bytecode Alliance folks think it's reasonable](https://bytecodealliance.zulipchat.com/#narrow/channel/394175-SIG-Guest-Languages/topic/Python.20Enhancement.20Proposals.20.28PEPs.29.20for.20WASI/near/554182568)
- [x] Make sure key core devs think it's reasonable
- [x] See if the [SC would rather](https://github.com/python/steering-council/issues/319) I just keep the details in PEP 11
- [x] Merge [PR](https://github.com/python/peps/pull/4732)
- [x] [Post](https://discuss.python.org/t/pep-816-wasi-support/105237)
- [ ] SC approval
- [ ] π [Support `wasm32-wasip3`](https://github.com/python/cpython/issues/121634) (skipping p2; blocked on WASI 0.3)
- [x] Ability to specify host triple
- [x] Find out if `wasip2` is compatible w/ preview1 hosts
- [ ] buildbot
- [ ] PEP 11
- [ ] Release binaries
- [ ] PEP for a wheel tag ([discussion](https://bytecodealliance.zulipchat.com/#narrow/channel/219900-wasi/topic/Platform.20tags.20for.20packages.20targeting.20WASI/with/516694780); [wasi-libc issue for appropriate macros](https://github.com/WebAssembly/wasi-libc/issues/688))
- [ ] π See if we can use `--enable-wasm-dynamic-linking` so [componentize-py](https://github.com/bytecodealliance/componentize-py) doesn't have to [patch it](https://github.com/dicej/cpython/commit/118e9d8eeabb6345d57295f6cec1616694eacbc2#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R1269-R1272) ([PR](https://github.com/python/cpython/pull/142235))
- [ ] π Move `wasi.py` functionality to `wasi/__main__.py` in buildbots (>= 3.14; waiting on [[#^buildbot-on-container]])
- [ ] `wasi package`
- [ ] Research what should be shipped for building extensions
- [ ] See if [exporting binaries](https://docs.docker.com/build/building/export/) from the WASI container is possible
- [ ] [External dependencies](https://github.com/python/cpython-source-deps) via `wasi externals`
- [ ] Figure out what version policy we want (i.e. always latest or freeze versions like Windows builds?)
- [ ] [zlib](https://github.com/python/cpython/issues/91246) (and potentially undoing part of https://github.com/python/cpython/pull/130297)/zlib-ng
- `RANLIB=/opt/wasi-sdk-29.0-x86_64-linux/bin/ranlib CC=/opt/wasi-sdk-29.0-x86_64-linux/bin/clang CHOST=wasm32 ./configure --static --zlib-compat --prefix ... && make install`
- Blank out `PKG_CONFIG_SYSROOT_DIR` and `PKG_CONFIG_PATH`, set `PKG_CONFIG_LIBDIR` to where `lib/pkgconfig` ended up from `--prefix`
- [ ] bzip2
- [ ] xz
- [`get_externals.bat`](https://github.com/python/cpython/blob/5592399313c963c110280a7c98de974889e1d353/PCbuild/get_externals.bat#L61)
- [`python.props`](https://github.com/python/cpython/blob/5592399313c963c110280a7c98de974889e1d353/PCbuild/python.props#L73)
- [`externals.spdx.json`](https://github.com/python/cpython/blob/5592399313c963c110280a7c98de974889e1d353/Misc/externals.spdx.json#L160)
- [ ] sqlite
- [ ] zstd
- [ ] mpdecimal
- [x] OpenSSL (not safe as WebAssembly doesn't have constant time ops)
- [ ] π Networking under WASI 0.3 (blocked on threading in WASI 0.3 being released)
- [Joel's hack](https://github.com/dicej/cpython/commit/118e9d8eeabb6345d57295f6cec1616694eacbc2)
- Any tests requiring threads probably won't work
- See the [headers in wasi-libc](https://github.com/WebAssembly/wasi-libc/tree/main/libc-top-half/musl/include) for what can be turned on
- Will probably require tweaking `config.site`
- [ ] [Create a GitHub Action to install WASI SDK](https://github.com/WebAssembly/wasi-sdk/issues/468) (? Might not be necessary w/ a container image used in CI)
- [ ] π₯§ Make sure build details are still relevant
- [ ] Check if all the flags set in `configure.ac` are necessary
- [ ] Check what `__wasi__` usage can be removed
- [x] [Check](https://github.com/python/cpython/issues/115982) that the [site config](https://github.com/python/cpython/blob/main/Tools/wasm/config.site-wasm32-wasi) is up-to-date
- [ ] [[HTTP fetch API]]