Skip to content
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

Tracking Issue for anonymous pipe API #127154

Open
4 of 5 tasks
NobodyXu opened this issue Jun 30, 2024 · 21 comments · May be fixed by #135822
Open
4 of 5 tasks

Tracking Issue for anonymous pipe API #127154

NobodyXu opened this issue Jun 30, 2024 · 21 comments · May be fixed by #135822
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. F-anonymous_pipe `#![feature(anonymous_pipe)]` finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@NobodyXu
Copy link
Contributor

NobodyXu commented Jun 30, 2024

This is a tracking issue for the ACP rust-lang/libs-team#375 .
The feature gate for the issue is #![feature(anonymous_pipe)].

// std::pipe

fn pipe() -> io::Result<(PipeReader, PipeWriter)>;

struct PipeReader {...}
struct PipeWriter {...}

impl PipeReader {
    fn try_clone(&self) -> io::Result<Self>;
}

impl PipeWriter {
    fn try_clone(&self) -> io::Result<Self>;
}

impl Read for &PipeReader
impl Read for PipeReader
impl Debug for PipeReader
impl From<PipeReader> for Stdio

impl Write for &PipeWriter
impl Write for PipeWriter
impl Debug for PipeWriter
impl From<PipeWriter> for Stdio

// unix {
impl AsFd for PipeReader
impl AsRawFd for PipeReader
impl FromRawFd for PipeReader
impl IntoRawFd for PipeReader
impl From<PipeReader> for OwnedFd
impl From<OwnedFd> for PipeReader

impl AsFd for PipeWriter
impl AsRawFd for PipeWriter
impl FromRawFd for PipeWriter
impl IntoRawFd for PipeWriter
impl From<PipeWriter> for OwnedFd
impl From<OwnedFd> for PipeWriter
// }

// windows {
impl AsHandle for PipeReader
impl AsRawHandle for PipeReader
impl FromRawHandle for PipeReader
impl IntoRawHandle for PipeReader
impl From<PipeReader> for OwnedHandle
impl From<OwnedHandle> for PipeReader

impl AsHandle for PipeWriter
impl AsRawHandle for PipeWriter
impl FromRawHandle for PipeWriter
impl IntoRawHandle for PipeWriter
impl From<PipeWriter> for OwnedHandle
impl From<OwnedHandle> for PipeWriter
// }

Steps

Implementation history

@NobodyXu NobodyXu added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Jun 30, 2024
@Fulgen301
Copy link
Contributor

You might want to fix the typo in the title and feature name - it's an anonymous pipe, not an annoymous pipe.

@NobodyXu NobodyXu changed the title Tracking Issue for annoymous_pipe API Tracking Issue for anonymous pipe API Jun 30, 2024
@NobodyXu
Copy link
Contributor Author

Thanks!

I've fixed the typo in this issue and the linked PR.

jhpratt added a commit to jhpratt/rust that referenced this issue Jul 11, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 12, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154
jhpratt added a commit to jhpratt/rust that referenced this issue Jul 13, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 14, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 15, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154
tgross35 added a commit to tgross35/rust that referenced this issue Jul 16, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 18, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 18, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154

try-job: x86_64-msvc
try-job: i686-mingw
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 20, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154

try-job: x86_64-msvc
try-job: i686-mingw
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 20, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154

try-job: x86_64-msvc
try-job: i686-mingw
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 21, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154

try-job: x86_64-msvc
try-job: i686-mingw
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 22, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154

try-job: x86_64-msvc
try-job: i686-mingw
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 23, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154

try-job: x86_64-msvc
try-job: i686-mingw
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 24, 2024
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: rust-lang#127154

try-job: x86_64-msvc
try-job: i686-mingw
@NobodyXu
Copy link
Contributor Author

NobodyXu commented Jul 28, 2024

I think we can now add specialisation to std::io::copy for std::pipe

jieyouxu added a commit to jieyouxu/rust that referenced this issue Aug 3, 2024
…viper

Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`

Enable `std::io::copy` specialisation on unix for the newly added anonymous pipe API, tracking issue rust-lang#127154
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 3, 2024
…viper

Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`

Enable `std::io::copy` specialisation on unix for the newly added anonymous pipe API, tracking issue rust-lang#127154
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 3, 2024
Rollup merge of rust-lang#128303 - NobodyXu:specialise-for-pipe, r=cuviper

Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`

Enable `std::io::copy` specialisation on unix for the newly added anonymous pipe API, tracking issue rust-lang#127154
@NobodyXu
Copy link
Contributor Author

I'm thinking about a new method for checked conversion from OwnedFd on unix.

I think it would be quite helpful for jobserver-rs

@RalfJung
Copy link
Member

Currently the documentation for this module is very bare-bones, quite far from the depth and quality we are used to in other parts of the standard library. There's not even a single example. This should be resolved before stabilization.

@jieyouxu jieyouxu added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 9, 2024
@tbu-
Copy link
Contributor

tbu- commented Jan 9, 2025

I find that creating a new module for these three symbols (fn pipe, struct PipeReader, struct PipeWriter) is a bit too much — fitting it into another module means that the number of modules in std directly does not unnecessarily increase.

@NobodyXu
Copy link
Contributor Author

NobodyXu commented Jan 9, 2025

I don't have a particular strong opinion on this honestly, if t/libs-api thinks that's better I am willing to change that

@joshtriplett
Copy link
Member

No strong preference either. I don't think there's any problem with small modules, but I'd also be fine with merging it into io.

@rustbot label +I-libs-api-nominated

@rustbot rustbot added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Jan 10, 2025
@m-ou-se
Copy link
Member

m-ou-se commented Jan 14, 2025

We discussed this in the library api meeting. There were not a lot of strong opinions. The consensus in the meeting was to put it in the std::io module. One of the arguments was that pipe::pipe() looks less appealing than io::pipe(). Another was that we don't need a module for pipe documentation, as fn pipe() itself is already a logical place for pipe documentation.

@m-ou-se m-ou-se removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Jan 14, 2025
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Jan 17, 2025
@rfcbot
Copy link

rfcbot commented Jan 17, 2025

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@rfcbot rfcbot added the to-announce Announce this issue on triage meeting label Jan 17, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 18, 2025
…iplett

Move `std::pipe::*` into `std::io`

Resolve concern from final comment period rust-lang#127154 (comment)
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jan 18, 2025
Rollup merge of rust-lang#135583 - NobodyXu:move-pipe-to-io, r=joshtriplett

Move `std::pipe::*` into `std::io`

Resolve concern from final comment period rust-lang#127154 (comment)
tbu- added a commit to tbu-/rust that referenced this issue Jan 21, 2025
@tbu- tbu- linked a pull request Jan 21, 2025 that will close this issue
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jan 23, 2025
tbu- added a commit to tbu-/rust that referenced this issue Jan 24, 2025
@joboet
Copy link
Member

joboet commented Jan 24, 2025

@rust-lang/libs-api were the system-specific trait implementations (e.g. From<OwnedFd>, From<OwnedHandle>) also part of the FCP? And could you confirm that you are okay with establishing this pattern, considering that File does not have such implementations? For what it's worth I have nothing against those implementations, but they are unprecedented...

@rustbot label +I-libs-api-nominated

My bad, I overlooked them...

@rustbot rustbot added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Jan 24, 2025
@joshtriplett
Copy link
Member

@joboet
Copy link
Member

joboet commented Jan 24, 2025

Oh dang, sorry, I totally overlooked that. Nevermind!

@joboet joboet removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Jan 24, 2025
tbu- added a commit to tbu-/rust that referenced this issue Jan 24, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 25, 2025
Improve and expand documentation of pipes

- Reference UNIX, not just Linux
- Simplify some of the language
- Don't imply that pipes *only* work across multiple processes; instead,
  *suggest* that they're typically used across two or more separate
  processes.
- Specify that portable applications cannot use multiple readers or
  multiple writers for messages larger than a byte, due to potential
  interleaving.

Tracking issue for anonymous pipes:
rust-lang#127154
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jan 26, 2025
Rollup merge of rust-lang#134373 - joshtriplett:pipe-docs, r=joboet

Improve and expand documentation of pipes

- Reference UNIX, not just Linux
- Simplify some of the language
- Don't imply that pipes *only* work across multiple processes; instead,
  *suggest* that they're typically used across two or more separate
  processes.
- Specify that portable applications cannot use multiple readers or
  multiple writers for messages larger than a byte, due to potential
  interleaving.

Tracking issue for anonymous pipes:
rust-lang#127154
tbu- added a commit to tbu-/rust that referenced this issue Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. F-anonymous_pipe `#![feature(anonymous_pipe)]` finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.