eduardomourar opened PR #14107 from eduardomourar:fix/wasmtime-cli-generic-eio to bytecodealliance:main:
Fixes: #14061
eduardomourar requested dicej for a review on PR #14107.
eduardomourar requested wasmtime-wasi-reviewers for a review on PR #14107.
eduardomourar edited PR #14107:
Fixes: #14061.
Map
BrokenPipetoStreamError::Closedin the wasip2 CLI stdout/stdin paths, and preserve the originalstd::io::ErrorinLastOperationFailedfor all other errors (EISDIR, etc.) so they remain recoverable viafilesystem_error_code.
eduardomourar edited PR #14107.
:memo: dicej submitted PR review:
Thanks!
:speech_balloon: dicej created PR review comment:
Could we combine this with
stream_error_fromand move it up to the parent module so it can be used both here and instdout.rs? Likewise the duplicatebroken_pipe_maps_to_closedandis_a_directory_preserves_io_errortests could be moved and combined.
:thumbs_up: alexcrichton submitted PR review:
Thanks! Unit tests where they are right now are often pretty brittle, so would you be up for adding more integration-style tests for this? For example extending
tests/all/cli_tests.rsand adding guest programs tocrates/test-programs/src/bin/*?
alexcrichton commented on PR #14107:
oh disregard me, sorry I defer to @dicej
eduardomourar commented on PR #14107:
Thanks! Unit tests where they are right now are often pretty brittle, so would you be up for adding more integration-style tests for this? For example extending
tests/all/cli_tests.rsand adding guest programs tocrates/test-programs/src/bin/*?I actually starting by creating the integration-style test, but the function is internal so I had to make it public. That felt a bit awkward so moved to the unit test within file.
eduardomourar edited a comment on PR #14107:
Thanks! Unit tests where they are right now are often pretty brittle, so would you be up for adding more integration-style tests for this? For example extending
tests/all/cli_tests.rsand adding guest programs tocrates/test-programs/src/bin/*?I actually started by creating the integration-style test, but the function is internal so I had to make it public. That felt a bit awkward so moved to the unit test within file, instead.
eduardomourar requested dicej for a review on PR #14107.
eduardomourar requested wasmtime-core-reviewers for a review on PR #14107.
eduardomourar updated PR #14107.
:memo: eduardomourar submitted PR review.
:speech_balloon: eduardomourar created PR review comment:
done
eduardomourar edited a comment on PR #14107:
Thanks! Unit tests where they are right now are often pretty brittle, so would you be up for adding more integration-style tests for this? For example extending
tests/all/cli_tests.rsand adding guest programs tocrates/test-programs/src/bin/*?
I actually started by creating the integration-style test, but the function is internal so I had to make it public. That felt a bit awkward so moved to the unit test within file, instead.Forget completely what I said. Just created the integration tests without the need to make the function public.
:thumbs_up: dicej submitted PR review.
:speech_balloon: dicej created PR review comment:
Why is it necessary to
mem::forgetthis? It looks like it should only be dropped when this function returns, which is after the child has exited.
:memo: eduardomourar submitted PR review.
:speech_balloon: eduardomourar created PR review comment:
Good catch. Replaced with
into_raw_fd()which properly transfers fd ownership toStdiowithout needingmem::forget. The previousas_raw_fd()+mem::forgetwas avoiding a double-close (bothdir_fileandStdiowould try to close the same fd), butinto_raw_fd()is the right way to express this ownership transfer.
:speech_balloon: eduardomourar edited PR review comment.
eduardomourar updated PR #14107.
dicej has enabled auto merge for PR #14107.
dicej added PR #14107 fix(wasmtime-cli): generic eio error thrown for wasip2 to the merge queue.
github-merge-queue[bot] removed PR #14107 fix(wasmtime-cli): generic eio error thrown for wasip2 from the merge queue.
@eduardomourar Looks like the Windows build is broken, which indicates that we'll need a stub version of
p2_cli_stdin_eisdirfor#[cfg(not(unix))]to make theforeach_cli!(assert_test_exists);check happy.
eduardomourar updated PR #14107.
github-actions[bot] added the label wasi on PR #14107.
dicej added PR #14107 fix(wasmtime-cli): generic eio error thrown for wasip2 to the merge queue.
:check: dicej merged PR #14107.
dicej removed PR #14107 fix(wasmtime-cli): generic eio error thrown for wasip2 from the merge queue.
Last updated: Aug 30 2026 at 09:07 UTC