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

Add documentation for anonymous pipe module #133986

Merged

Conversation

olishmollie
Copy link
Contributor

@olishmollie olishmollie commented Dec 6, 2024

Tracking issue: #127154

@NobodyXu I've been using this feature lately and thought I might contribute with some documentation. I borrowed liberally from os_pipe so thanks to @oconnor663.

@rustbot

This comment was marked as resolved.

@rustbot
Copy link
Collaborator

rustbot commented Dec 6, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @NobodyXu (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added 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 Dec 6, 2024
@rustbot

This comment was marked as resolved.

@rustbot

This comment was marked as resolved.

Copy link
Contributor

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!

I just have 3 suggestions:

library/std/src/pipe.rs Outdated Show resolved Hide resolved
library/std/src/pipe.rs Outdated Show resolved Hide resolved
library/std/src/pipe.rs Outdated Show resolved Hide resolved
@olishmollie olishmollie force-pushed the tracking-issue-127154-documentation branch from f850623 to 39212d8 Compare December 7, 2024 16:43
@olishmollie
Copy link
Contributor Author

@rustbot review

Copy link
Contributor

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just one final comment:

library/std/src/pipe.rs Outdated Show resolved Hide resolved
@olishmollie olishmollie force-pushed the tracking-issue-127154-documentation branch from 39212d8 to 6ef2822 Compare December 8, 2024 20:17
Copy link
Contributor

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

It LGTM, but unfortunately I don't have power to merge, you'd need to r? to assign another rust member to merge it.

Sorry I should say this earlier

@olishmollie

This comment was marked as resolved.

@rustbot

This comment was marked as resolved.

@jieyouxu
Copy link
Member

jieyouxu commented Dec 9, 2024

r? libs

@jieyouxu jieyouxu added the F-anonymous_pipe `#![feature(anonymous_pipe)]` label Dec 9, 2024
library/std/src/pipe.rs Outdated Show resolved Hide resolved
library/std/src/pipe.rs Outdated Show resolved Hide resolved
library/std/src/pipe.rs Outdated Show resolved Hide resolved
library/std/src/pipe.rs Outdated Show resolved Hide resolved
@tgross35
Copy link
Contributor

Thanks, these docs are a great update!

Could you add some comments to the examples explaining what is going on? E.g. // Create a pipe that sends back whatever it receives, // Spawn a process that will write to the pipe etc.

Also do these need to be no_run? I think they should work find on #[cfg(unix)] (maybe change bash to sh).

r? tgross35

@rustbot rustbot assigned tgross35 and unassigned Noratrieb Dec 13, 2024
@olishmollie olishmollie force-pushed the tracking-issue-127154-documentation branch from 6ef2822 to 83110fa Compare December 14, 2024 07:58
@olishmollie
Copy link
Contributor Author

olishmollie commented Dec 14, 2024

Could you add some comments to the examples explaining what is going on? E.g. // Create a pipe that sends back whatever it receives, // Spawn a process that will write to the pipe etc.

Done.

Also do these need to be no_run? I think they should work find on #[cfg(unix)] (maybe change bash to sh).

I think it's better to leave them no_run rather than chance breaking someone's build. For example, posix shell doesn't support read -n.

@olishmollie olishmollie force-pushed the tracking-issue-127154-documentation branch from 83110fa to fb6a19b Compare December 14, 2024 08:10
@olishmollie olishmollie requested a review from tgross35 December 14, 2024 20:01
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to leave them no_run rather than chance breaking someone's build. For example, posix shell doesn't support read -n.

That one in particular should stay no_run anyway since it writes to the file system. The others would be okay but no harm in skipping them.

Can you just confirm that these tests do pass on your system or on the playground?

@tgross35 tgross35 added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Dec 14, 2024
@olishmollie
Copy link
Contributor Author

Can you just confirm that these tests do pass on your system or on the playground?

I tested the examples without no_run when I wrote them (just confirmed again to be sure), and can confirm they all run in the playground.

@olishmollie olishmollie requested a review from tgross35 December 14, 2024 21:44
@tgross35
Copy link
Contributor

Great, thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 14, 2024

📌 Commit fb6a19b has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 14, 2024
@olishmollie
Copy link
Contributor Author

Sorry @tgross35, I only realized you had approved the changes after I requested another review. Not sure what happens now, but thanks for looking it over and for the great suggestions.

@tgross35
Copy link
Contributor

GH reviews are just a nice API but don't really matter (I only re-approved to dismiss the review request :) ), Bors handles merging. My r+ comment added it to the queue (see the queue comment above), this will eventually get picked up with a couple other changes (a "rollup"), run against the full test suite, and merged. Usually it takes a few hours to a day, no action needed from you though.

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#132939 (Suggest using deref in patterns)
 - rust-lang#133293 (Updates Solaris target information, adds Solaris maintainer)
 - rust-lang#133392 (Fix ICE when multiple supertrait substitutions need assoc but only one is provided)
 - rust-lang#133986 (Add documentation for anonymous pipe module)
 - rust-lang#134022 (Doc: Extend for tuples to be stabilized in 1.85.0)
 - rust-lang#134259 (Clean up `infer_return_ty_for_fn_sig`)
 - rust-lang#134264 (Arbitrary self types v2: Weak & NonNull diagnostics)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 08b9aa0 into rust-lang:master Dec 15, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2024
Rollup merge of rust-lang#133986 - olishmollie:tracking-issue-127154-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.`
@olishmollie olishmollie deleted the tracking-issue-127154-documentation branch December 15, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools F-anonymous_pipe `#![feature(anonymous_pipe)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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