Improved experience in building for WASI

I just landed a PR which adds Tools/wasm/ to make it easier to build CPython for WASI. The docs can be found at . Hopefully this will make it easier to diagnose any issues you might come across with WASI (although the vast majority of them are from assuming threads or a certain stack size).


Thank you @brettcannon!

1 Like

Does anyone if the build recipe of the container is public? If yes, would anyone be interested to take over the maintenance of this container? It seems like it wasn’t update for a few months.

The cpythonbuild containers comes from GitHub - tiran/cpython_builddep: Install CPython build and development dependencies if I’m not mistaken.

1 Like

Why do you specifically want that container maintained? I already keep updated. Plus, for WASI, it’s installing two things which are self-contained, so it isn’t costly to get going.

I have no idea how to use this container. Can I install it and run it locally on Linux?

Setup and building are instructions on how to use GitHub Codespaces. There’s also a Dockerfile in there if you want to create your own container from the same files. If you’re a VS Code user or use some other editor that supports devcontainers it can build the container for you. But if you look at that Dockerfile you will notice it’s based on Fedora and there’s two key commands to get the two key tools installed: .

There’s GitHub - WebAssembly/wasi-sdk: WASI-enabled WebAssembly C/C++ toolchain if you want a container image for the WASI SDK, probably leaving just installing some WASI host/runtime like wasmtime into it once you launch it (assuming it doesn’t already have it).

Oh ok, I found Setup and building doc. I’m not using GitHub Codespace nor VS Code nor any editor using container.

Well, I would prefer to not install these tools locally, but use a container for that. It’s more convenient for me. So Christian’s container just works as expected for my use case :wink: I just have to run a command, it’s quick (once the image is downloaded, it’s cached locally), and I can work in the container.

I get that, but there’s a Dockerfile at that installs everything you need, so I’m not sure what else you want beyond someone to push a built container to some container registry for you.

If that is what you want, someone could probably set up some CI that pushes to Working with the Container registry - GitHub Docs whenever that Dockerfile changes so it’s available externally.

Yep, I need that :slight_smile:

1 Like

Unfortunately I don’t know containers well enough to know how best to set that up in an automated way that won’t lead to you coming back to me saying, “you did it wrong” :wink: (I’m still impressed I got the Dockerfile set up appropriately). For instance, assuming I could get permissions to push a container to from the CPython repo and I used Publishing and installing a package with GitHub Actions - GitHub Docs , I don’t know what labels and tags are for.

If it’s helpful, here’s a Github Actions workflow fly that builds docker images and pushes them to Github Container Registry:

(It’s a bit more complex because it supports multiple architectures and is a matrix build, but hopefully the relevant bits are clear.)