Stream: git-wasmtime

Topic: wasmtime / PR #13872 Reduce dependencies on `cap-std`-fam...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 13 2026 at 18:42):

alexcrichton opened PR #13872 from alexcrichton:cap-primitives-migration to bytecodealliance:main:

This commit is an attempt to reduce the number of layers of abstraction that we have for the wasmtime-wasi crate and implementation, in particular around the dependencies that we have. Historically wasmtime-wasi has primarily depended on cap-std which provides a std-like API for using the native filesystem and other features (e.g. networking). Over time networking has largely moved away from cap-std, however. I've additionally historically found it difficult to trace through the tree of dependencies for figuring out what a WASI call does. This requires following code in wasmtime-wasi, to cap-std, to cap-*-ext sometimes, to cap-primitives, then to rustix. The goal of this commit is to shorten this chain and instead primarily rely on the "meat" of cap-std, the cap-primitives crate.

The cap-std crate additionally serves a bit of a dual purpose of providing filesystem sandboxing and abstracting the underlying platform. This abstraction though is a bit leaky where the API is different enough across platforms that it can come at a performance cost on some platforms while also still needing #[cfg]s on others. This commit additionally is intended to reduce the reliance on this portability layer since the API that we're implementing, WASI, is the definition of what we want portability-wise which doesn't always match what cap-std does.

Overall this commit removes the cap-std and io-lifetimes dependencies from the Wasmtime workspace itself. A dependency is left on cap-fs-ext out of necessity but it's only to access an otherwise-private API located in the cap-primitives crate. Implementations throughout wasmtime-wasi have shifted to using their std counterparts (e.g. clocks), encapsulating more platform-specific logic (e.g. unix-vs-windows filesystem behavior), and refactoring to avoid dependencies (e.g. networking).

This commit is not intended to introduce any new behavior nor change any preexisting behavior. The goal of this commit is to reduce the dependency tree of Wasmtime to the bare minimum necessary through the cap-primitives crate.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jul 13 2026 at 18:42):

alexcrichton requested dicej for a review on PR #13872.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 13 2026 at 18:42):

alexcrichton requested wasmtime-wasi-reviewers for a review on PR #13872.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 13 2026 at 18:42):

alexcrichton requested wasmtime-core-reviewers for a review on PR #13872.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 13 2026 at 18:42):

alexcrichton requested wasmtime-default-reviewers for a review on PR #13872.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 13 2026 at 19:09):

alexcrichton updated PR #13872.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 13 2026 at 21:02):

github-actions[bot] added the label wasmtime:c-api on PR #13872.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 13 2026 at 21:02):

github-actions[bot] added the label wasi on PR #13872.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 21:03):

:thumbs_up: pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 21:08):

alexcrichton added PR #13872 Reduce dependencies on cap-std-family crates to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 21:34):

:check: alexcrichton merged PR #13872.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 21:34):

alexcrichton removed PR #13872 Reduce dependencies on cap-std-family crates from the merge queue.


Last updated: Jul 29 2026 at 05:03 UTC