Merging some WASIp3 PRs together, some more refactorings by me#750
Draft
alexcrichton wants to merge 16 commits intoWebAssembly:mainfrom
Draft
Merging some WASIp3 PRs together, some more refactorings by me#750alexcrichton wants to merge 16 commits intoWebAssembly:mainfrom
alexcrichton wants to merge 16 commits intoWebAssembly:mainfrom
Conversation
This was referenced Feb 28, 2026
Closed
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.
Gets a few more tests passing
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.