Skip to content

Conversation

joboet
Copy link
Member

@joboet joboet commented Sep 19, 2025

Currently, there are two distinct types called AnonPipe in std:

  • The one used to implement io::pipe (in sys::anonymous_pipe)
  • The one used to implement Stdin/Stdout/Stderr (in sys::pal::pipe)

On Windows, these actually have different semantics, as one of the handles returned by the sys::pal::pipe version is opened for asynchronous operation in order to support read2, whereas the sys::anonymous_pipe version does not do so. Thus the naming is extremely confusing.

To fix this, this PR renames the sys::anonymous_pipe version of AnonPipe to simply Pipe, whereas the sys::pal::pipe version is now called ChildPipe. Additionally,

  • sys::anonymous_pipe is now also just called sys::pipe.
  • On Windows, sys::pal::pipe has been moved to sys::process and is now called sys::process::child_pipe.
  • On non-Windows platforms, pipe creation is now exclusively handled by sys::pipe and ChildPipe is defined as a type alias to Pipe within sys::process.

And lastly, the read2 function (originally in sys::pal::pipe) is now called read_output and defined by sys::process, as (at least on Windows) it is only usable with ChildPipe.

Includes #146639 for convenience.

@rustbot
Copy link
Collaborator

rustbot commented Sep 19, 2025

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 19, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@thaliaarchi
Copy link
Contributor

I opened these two PRs before I noticed your PR here, which is a superset, modulo some tiny fixes for tier 3 builds in mine. Sorry. My PRs probably create more work for you, so feel free to close them. But if they'd help to split yours for review, they might be useful.

@rust-log-analyzer

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Sep 22, 2025

The Miri subtree was changed

cc @rust-lang/miri

@RalfJung
Copy link
Member

Sorry for those test failures, I'll adjust this a bit on the Miri side to hopefully make it more resilient without being terribly slow.

@bors
Copy link
Collaborator

bors commented Sep 24, 2025

☔ The latest upstream changes (presumably #146931) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot
Copy link
Collaborator

rustbot commented Sep 24, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants