Skip to content

wasi-python 0.1.2

Choose a tag to compare

@github-actions github-actions released this 29 Oct 04:25
· 98 commits to dev since this release
Immutable release. Only release title and notes can be modified.

0.1.2 starts each call from a snapshot you choose: make_snapshot runs your setup once, make_package_snapshot imports every package, and Snapshot.save and load share it across processes, so imports are paid once and fuel counts only the call. The module cache works when another user owns /, refusing folders others can change. Grants refuse FIFOs, sockets and devices, a process holds at most 64 abandoned tool threads, and a guest's memory budget is stated. You may need to act on four changes: close() on the loop's thread now waits, mounts refuse : and \ in names, a tool call with no bound ends after an hour, and the PyPI wheel carries no PyPI provenance, so verify its GitHub attestation instead.

New

  • Start every call from your own snapshot. make_snapshot runs your setup code once (imports, data, functions) and make_package_snapshot() imports every package; pass the result as snapshot= to run or Session. Each call is still a fresh, sealed instance that skips the seconds its imports took, and Snapshot.save and load share one across processes. Snapshots
  • Embedders in other languages can start every call from a starting image. The snapshot binary, python-snapshot.wasm, exports prepare, which runs your setup code once and leaves its memory ready to copy into each new instance. Embed from other languages
  • Every wasi-python run option has its help. wasi-python run --help describes all fourteen options, and the messages and docstrings that pointed at old README sections now name the site's pages. Command line
  • Budget host memory for each guest. The limits page says what one guest can hold on the host: with a writable mount, up to three times memory_bytes, about 3 GiB at the default. Budget host memory

Faster

  • Starts are fast again in containers where root does not own /. In 0.1.1 the module cache was refused when another user owned /, so every start compiled the module first. The cache now trusts the owner of / as it trusts root, since that owner can already replace any file. Where the compiled module is kept

Security

  • On macOS, the module cache refuses a folder others can change. If an access list on the way to the cache lets another user or group add, remove or rename what a folder holds, or change its list, the cache is not used, and the warning names the folder, who and the rights. Where the compiled module is kept
  • A FIFO, socket or device no longer stalls a call. A guest's open of such a file in a grant is refused with ENXIO before the host opens it, so a deadline, cancel and Session.close() stop the call as they stop any other. Grant a folder
  • A mount's paths mean the same on every host. A path component that holds a backslash or a colon is refused with EINVAL on Linux, macOS and Windows alike, so a provider that stores files on disk cannot be led outside its mount. Treat a path as a name, not a host path
  • A guest cannot pile up threads in your process. A tool call that times out leaves its function running on a thread; once 64 such threads are alive in a process, the next tool call is answered timeout at once. Bound a tool's time
  • Fewer steps of the release can change what you download. Only the step that creates the GitHub release holds the token that can write it, and the wheel goes to PyPI through the release's pinned uv instead of a third-party container named by a tag. Verify a download
  • wasmtime's advisories of 2026-10-19 do not reach the runner. wasmtime 50.0.0, which this release runs, is outside the critical GHSA-mghf-wjfp-p5xm's range, and the other four are in parts of wasmtime the runner does not use. Three wasmtime fixes, in wasmtime itself

Fixed

  • close() in a host function no longer hangs; every session ends. A close() from a host= function or a mount's provider during run_async used to deadlock; it now returns at once and the session ends with its turn. A turn cancelled while queued, or still queued at exit, no longer leaves its session open. Know how a session ends
  • A mount answers times, reads and folder opens as a grant does. Setting the times of a missing file answers ENOENT, a positioned read of more than 64 KiB returns exactly the bytes asked for, and opening a file as a folder answers ENOTDIR without listing it. Know how a mount differs from a grant
  • Never grant a guest the module cache's folder. The install page said a module the runner did not make is never loaded. Under a umask of 077, a guest's file in a granted cache folder passes as the runner's own; only keeping the cache out of every grant stops it. Where the compiled module is kept
  • Calls that start together no longer fail. When a process's first calls started at the same moment, one could be refused for an unreadable stack, and on macOS run() could raise KeyError when the module cache's folder has an access list; they now start as they would one at a time. Where the compiled module is kept
  • A retried read of a guest's output no longer marks it cut. A read of the output pipe that failed and was retried named its stream in truncated, though no byte was lost. truncated: cut output

Upgrading

  • close() on the event loop's thread now waits for the ending. During a run_async turn, a close() called from the loop's own thread used to return at once; it now blocks until the session has ended. Await the turn first, or close from another thread. Close it, and write files within a turn
  • A mount refuses file names with : or \. On Linux and macOS a mount accepted them before; now every host answers EINVAL, as Windows always did. A guest that writes timestamped names such as 12:30.csv into a mount should use another separator. Treat a path as a name, not a host path
  • Unbounded tool calls now end after an hour. A tool with no timeout_s, in a run with deadline_s=None, used to be waited for as long as it ran; now the guest gets ToolTimeout at the session's lifetime_s, or after 3,600 seconds outside a session. Give the tool a timeout_s to choose another bound. Bound a tool's time
  • The wheel on PyPI no longer carries PyPI's own provenance. Check a download by its GitHub attestation, which is unchanged. Verify a download

For contributors

  • The runner's Windows code is type-checked on every run. A second pass checks it as Windows sees it, each platform's class is checked against its interface, and the type checker's suppressions fell from 25 to 3; a rise needs a reason. How structure is judged
  • Each long function is held at its listed length. A function on the long-function list that grows past its length, or shrinks below it, is reported, so the list stays true. How structure is judged
  • Changes to the agents' settings are reviewed like code. A change to .claude/, .agents/, AGENTS.md or CLAUDE.md needs a news file and a review, and a pull request's check refuses GitHub's skip-checks: true trailer and judges an edited base or description again. What a pull request runs
  • Snapshot rows whose fuel varies keep it as a fact. A call from a snapshot that holds numpy's random module spends a few percent more or less from run to run, so four snapshot rows record that fuel as a fact and the exact rows stay exact. The ratchet
  • Release notes say what a release gives you. Each change is now written for an embedder who did not follow the work: what it gives, the one fact that changed, and a link to the page that explains it. The release process
  • Upstream suites are judged across the move to wasmtime 50. Each group passes the tests it passed under wasmtime 49, and when no macOS fuel of the current wasmtime is recorded for a group only Linux ran, the acceptance records Linux's, labelled with its system and never compared with another's. Two tiers of tests
  • Upstream test archives download even when their host blocks automated downloads. A pinned file may name a copy the project keeps, asked first, and either copy is kept only if its SHA-256 is the pinned one, so the hash is what is trusted. Pins and recipe files

Verify a download (gh logged in; see Verify a download):

gh attestation verify <asset> --repo ClayGendron/wasi-python \
  --signer-workflow ClayGendron/wasi-python/.github/workflows/release.yml@refs/tags/v0.1.2 \
  --source-ref refs/tags/v0.1.2 --deny-self-hosted-runners