alexcrichton opened PR #7063 from alexcrichton:wasi-fix-stdin
to bytecodealliance:main
:
This commit is intended to address #6986 and some other issues related to stdin and reading it, notably:
- Previously once EOF was reached the
closed
flag was mistakenly not set.- Previously data would be infinitely buffered regardless of how fast the guest program would consume it.
- Previously stdin would be immediately ready by Wasmtime regardless of whether the guest wanted to read stdin or not.
- The host-side preview1-to-preview2 adapter didn't perform a blocking read meaning that it never blocked.
These issues are addressed by refactoring the code in question. Note that this is similar to the logic of
AsyncReadStream
somewhat but that type is not appropriate in this context due to the singleton nature of stdin meaning that the per-stream helper task and per-stream buffer ofAsyncReadStream
are not appropriate.Closees #6986
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-core-reviewers for a review on PR #7063.
alexcrichton requested fitzgen for a review on PR #7063.
alexcrichton requested pchickey for a review on PR #7063.
pchickey submitted PR review.
pchickey has enabled auto merge for PR #7063.
alexcrichton updated PR #7063.
alexcrichton has enabled auto merge for PR #7063.
alexcrichton merged PR #7063.
Last updated: Dec 23 2024 at 13:07 UTC