Skip to content

Tracking Issue for anonymous pipe API #127154

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
5 tasks done
NobodyXu opened this issue Jun 30, 2024 · 23 comments · Fixed by #137793
Closed
5 tasks done

Tracking Issue for anonymous pipe API #127154

NobodyXu opened this issue Jun 30, 2024 · 23 comments · Fixed by #137793
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.
Milestone

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
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
@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
@LevitatingBusinessMan
Copy link

Did something happen to this experimental api?

The example code at https://doc.rust-lang.org/stable/std/pipe/index.html does not seem to compile anymore.

@NobodyXu
Copy link
Contributor Author

It has been moved into std::io

https://doc.rust-lang.org/nightly/std/io/fn.pipe.html

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 9, 2025
…r=joshtriplett

Stablize anonymous pipe

Since rust-lang#135822 is staled, I create this PR to stablise anonymous pipe

Closes rust-lang#127154
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this issue Mar 11, 2025
…documentation, r=tgross35

Add documentation for anonymous pipe module

Tracking issue: rust-lang#127154

`@NobodyXu` I've been using this feature lately and thought I might contribute with some documentation. I borrowed liberally from [os_pipe](https://docs.rs/os_pipe/latest/os_pipe/) so thanks to `@oconnor663.`
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this issue Mar 11, 2025
…iplett

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

Resolve concern from final comment period rust-lang#127154 (comment)
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 13, 2025
…<try>

Stablize anonymous pipe

Since rust-lang#135822 is staled, I create this PR to stablise anonymous pipe

Closes rust-lang#127154

try-job: test-various
@bors bors closed this as completed in 62c2a7b Mar 17, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 17, 2025
Rollup merge of rust-lang#137793 - NobodyXu:stablise-annoymous-pipe, r=joshtriplett

Stablize anonymous pipe

Since rust-lang#135822 is staled, I create this PR to stablise anonymous pipe

Closes rust-lang#127154

try-job: test-various
@cuviper cuviper added this to the 1.87.0 milestone Mar 21, 2025
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this issue Mar 26, 2025
…r=joshtriplett

Stablize anonymous pipe

Since rust-lang#135822 is staled, I create this PR to stablise anonymous pipe

Closes rust-lang#127154

try-job: test-various
# for free to join this conversation on GitHub. Already have an account? # 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.