-
Notifications
You must be signed in to change notification settings - Fork 13.8k
std: reorganize pipe implementations #146794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
All platforms define this structure the same way, so we can just put it in the `process` module directly.
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
This comment has been minimized.
This comment has been minimized.
f2296a2
to
73ca518
Compare
This comment has been minimized.
This comment has been minimized.
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. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
Currently, there are two distinct types called
AnonPipe
instd
:io::pipe
(insys::anonymous_pipe
)Stdin
/Stdout
/Stderr
(insys::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 supportread2
, whereas thesys::anonymous_pipe
version does not do so. Thus the naming is extremely confusing.To fix this, this PR renames the
sys::anonymous_pipe
version ofAnonPipe
to simplyPipe
, whereas thesys::pal::pipe
version is now calledChildPipe
. Additionally,sys::anonymous_pipe
is now also just calledsys::pipe
.sys::pal::pipe
has been moved tosys::process
and is now calledsys::process::child_pipe
.sys::pipe
andChildPipe
is defined as a type alias toPipe
withinsys::process
.And lastly, the
read2
function (originally insys::pal::pipe
) is now calledread_output
and defined bysys::process
, as (at least on Windows) it is only usable withChildPipe
.Includes #146639 for convenience.