Skip to content

Merging some WASIp3 PRs together, some more refactorings by me#750

Draft
alexcrichton wants to merge 16 commits intoWebAssembly:mainfrom
alexcrichton:wasip3
Draft

Merging some WASIp3 PRs together, some more refactorings by me#750
alexcrichton wants to merge 16 commits intoWebAssembly:mainfrom
alexcrichton:wasip3

Conversation

@alexcrichton
Copy link
Collaborator

Posting this in case others ar interested. I'll be doing my best to peel off commits from the base of this PR into separate PRs and getting those landed, but that'll require others to review my code.

rvolosatovs and others added 16 commits March 2, 2026 07:30
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
This commit extends the support in WebAssembly#734 by deduplicating the separate
paths for reading a stream shared between `read` and `recvfrom`, for
example. The `get_{read,write}_stream` methods now return more metadata
and the TCP `recvfrom` implementation delegates to an internal
`__wasilibc_read` to perform the actual read. This opens up the door to
supporting nonblocking reads/writes on other streams in the future, for
example.
* Generalize the `wasip2_{read,write}_t` types to `wasi_{read,write}_t`
  with conditional internals depending on the WASI version.
* Fix error handling for stdin to use stdin error codes instead of
  filesystem error codes.
* Call `subtask.drop` for writes to acknowledge the subtask being done.
* When stdin is done, drop the future for the error after it's read to
  ensure the future isn't read twice.
This is an initial implementation of some basic file-handling functions
such as reading, writing, opening directories, iterating them, etc. A
number of previously failing tests are now passing and the
`wasip2_file.c` implementation is now merged with WASIp3 with `file.c`.
Bindings generation is also updated to flag some specific functions as
being lowered synchronously as libc always blocks on the result.
Handle `O_APPEND` by calling `append-via-stream`
Use the same WASIp2 implementation for WASIp3
Use the wasip2 implementation
Use the wasip2 implementation
Use the wasip2 implementation
Use the wasip2 implementation
Use the wasip2 implementation
Use the wasip2 implementation
Use the wasip2 version
Use the wasip2 implementation
Use the wasip2 implementations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants