Stream: git-wasmtime

Topic: wasmtime / PR #11368 Share stdio implementations in WASI...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 01:01):

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

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 01:01):

alexcrichton opened PR #11368 from alexcrichton:wasi-cli-refactor to bytecodealliance:main:

This commit is a refactoring of the
wasmtime_wasi::{cli,p2::stdio,p3::cli} modules to share more code. The
generic trait object that represents stdio now has the ability to
acquire either a p2 stream or an async-based stream. The acquisition of
p2 has a default implementation so in the future this can be primarily
Async{Read,Write}-based.

Many trait implementations and types and such were all consolidated
together into the wasmtime_wasi::cli module. One-off implementations
in p2/p3 are now shared in one location and WasiCtxBuilder no longer
needs any generics for different stdio streams.

Functionally this necessitated the addition of Async{Read,Write}
implementations for some "base" implementations of stdio primitives.
Implementations were mostly trivial except for a few adapters which were
significantly more complicated, namely the Async{Read,Write}Stream
adapter which converts a single Async{Read,Write} into the stdio of a
component.

Finally the stdin implementation for p3 was refactored to avoid use of
tokio::io::stdin() which generally isn't safe to use. It's replaced
with a custom AsyncRead using the worker thread implementation we have
in the crate already.

Eventually I hope to remove the distinction between p{2,3}::WasiCtx
and have these be the same type. This will make it nicer to only have a
single WasiView trait and additionally make it easier to
simultaneously implement all of WASIp{1,2,3}.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 01:01):

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

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 01:01):

alexcrichton requested pchickey for a review on PR #11368.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 01:01):

alexcrichton commented on PR #11368:

This is currently based on https://github.com/bytecodealliance/wasmtime/pull/11365 and only the final commit is for this PR

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 01:03):

alexcrichton updated PR #11368.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 01:09):

alexcrichton updated PR #11368.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 14:41):

alexcrichton updated PR #11368.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 14:42):

alexcrichton edited a comment on PR #11368:

This is currently based on https://github.com/bytecodealliance/wasmtime/pull/11365 and only the final commit is for this PR (EDIT: no longer)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 01 2025 at 22:31):

dicej submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 02 2025 at 00:04):

alexcrichton merged PR #11368.


Last updated: Dec 06 2025 at 07:03 UTC