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

Allow redirecting subprocess stdout to our stderr etc. (redux) #114590

Merged
merged 5 commits into from
Sep 9, 2023

Conversation

ijackson
Copy link
Contributor

@ijackson ijackson commented Aug 7, 2023

This is the code from #88561, tidied up, including review suggestions, and with the for-testing-only CI commit removed. FCP for the API completed in #88561.

I have made a new MR to facilitate review. The discussion there is very cluttered and the branch is full of changes (in many cases as a result of changes to other Rust stdlib APIs since then). Assuming this MR is approvedl we should close that one.

Reviewer doing a de novo review

Just code review these four commits.. FCP discussion starts here: #88561 (comment)

Portability tests: you can see that this branch works on Windows too by looking at the CI results in #88561, which has the same code changes as this branch but with an additional "DO NOT MERGE" commit to make the Windows tests run.

Reviewer doing an incremental review from some version of #88561

Review the new commits since your last review. I haven't force pushed the branch there.

git diff the two branches (eg git diff 176886197d6..0842b69c219). You'll see that the only difference is in gitlab CI files. You can also see that this MR doesn't touch those files.

This involves adding a new variant `imp::Stdio::StaticFd`.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
We're going to want to reuse this bit of code.
This involves a new variant `imp;::Stdio::InheritSpecific`.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
@rustbot
Copy link
Collaborator

rustbot commented Aug 7, 2023

r? @joshtriplett

(rustbot has picked a reviewer for you, use r? to override)

@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 Aug 7, 2023
@pitaj
Copy link
Contributor

pitaj commented Aug 7, 2023

I can understand splitting the refactor out from the rest, but I would recommend squashing the first, third, and fourth commits together since they each touch a different file and are tightly linked.

@ijackson
Copy link
Contributor Author

ijackson commented Aug 7, 2023

I can understand splitting the refactor out from the rest, but I would recommend squashing the first, third, and fourth commits together since they each touch a different file and are tightly linked

#88561 as initially submitted had the same commit structure and the maintainers didn't seem to object to it then, and I prefer it this way so I will leave this as it is unless the reviewer would like me to squash it.

(When I'm a reviewer, I generally prefer the commits as small as possible. It's always possible to review successive commits together if the submitter has split them up; whereas if the submitter has merged them, I can only review them in that form or ask for a resubmission.)

@pitaj
Copy link
Contributor

pitaj commented Aug 7, 2023

#88561 as initially submitted had the same commit structure and the maintainers didn't seem to object to it then

I don't think that really means anything. I don't think they care about commit structure at all until the very end, where they might ask for everything to be squashed.

(When I'm a reviewer, I generally prefer the commits as small as possible. It's always possible to review successive commits together if the submitter has split them up; whereas if the submitter has merged them, I can only review them in that form or ask for a resubmission.)

The way I see it commits 1, 3, and 4 are all part of the same change. Neither 1 nor 3 make sense without 4, so they should be combined. I would never have committed them separately in the first place.

But that's just my suggestion. Keep it how you like it.

@dtolnay dtolnay assigned dtolnay and unassigned joshtriplett Sep 7, 2023
@dtolnay dtolnay added A-process Area: `std::process` and `std::env` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 7, 2023
Copy link
Member

@dtolnay dtolnay 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! This is terrific.

T-libs-api FCP has completed in #88561 (comment).

Thank you for sticking with this over 2 years 😮👏 while our team has been so backlogged -- we're starting to make better progress again recently.

@dtolnay
Copy link
Member

dtolnay commented Sep 7, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Sep 7, 2023

📌 Commit 36295fa has been approved by dtolnay

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 Sep 7, 2023
@bors
Copy link
Contributor

bors commented Sep 8, 2023

⌛ Testing commit 36295fa with merge 8f0fd01...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 8, 2023
Allow redirecting subprocess stdout to our stderr etc. (redux)

This is the code from rust-lang#88561, tidied up, including review suggestions, and with the for-testing-only CI commit removed.  FCP for the API completed in rust-lang#88561.

I have made a new MR to facilitate review.  The discussion there is very cluttered and the branch is full of changes (in many cases as a result of changes to other Rust stdlib APIs since then).  Assuming this MR is approvedl we should close that one.

### Reviewer doing a de novo review

Just code review these four commits..  FCP discussion starts here: rust-lang#88561 (comment)

Portability tests: you can see that this branch works on Windows too by looking at the CI results in rust-lang#88561, which has the same code changes as this branch but with an additional "DO NOT MERGE" commit to make the Windows tests run.

### Reviewer doing an incremental review from some version of rust-lang#88561

Review the new commits since your last review.  I haven't force pushed the branch there.

git diff the two branches (eg `git diff 176886197d6..0842b69c219`).  You'll see that the only difference is in gitlab CI files.  You can also see that *this* MR doesn't touch those files.
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 8, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 8, 2023
@dtolnay
Copy link
Member

dtolnay commented Sep 8, 2023

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 8, 2023
@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 8, 2023
…Stdio

This implementation is wrong.  Like the impl for From<File>, it is
forced to panic because process::Stdio in unsupported/process.rs
doesn't have a suitable variant.

The root cause of the problem is that process::Stdio in
unsupported/process.rs has any information in it at all.

I'm pretty sure that it should just be a unit struct.  However,
making that build on all platforms is going to be a lot of work,
iterating through CI and/or wrestling Docker.

I don't think this extra panic is making things significantly worse.
For now I have added some TODOs.
@rustbot rustbot added O-unix Operating system: Unix-like O-windows Operating system: Windows labels Sep 9, 2023
@rust-log-analyzer

This comment has been minimized.

@ijackson
Copy link
Contributor Author

ijackson commented Sep 9, 2023

Thanks for the review and the encouragement.

I've fixed WASM (with some flail). Please LMK when you want me to squash this. Hopefully it will turn out not to break some other platform too.

@rustbot reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 9, 2023
@dtolnay
Copy link
Member

dtolnay commented Sep 9, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Sep 9, 2023

📌 Commit 436fe01 has been approved by dtolnay

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 Sep 9, 2023
@bors
Copy link
Contributor

bors commented Sep 9, 2023

⌛ Testing commit 436fe01 with merge 559421e...

@bors
Copy link
Contributor

bors commented Sep 9, 2023

☀️ Test successful - checks-actions
Approved by: dtolnay
Pushing 559421e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 9, 2023
@bors bors merged commit 559421e into rust-lang:master Sep 9, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 9, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (559421e): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.3%, -2.0%] 3
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 629.671s -> 628.555s (-0.18%)
Artifact size: 317.95 MiB -> 317.86 MiB (-0.03%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-process Area: `std::process` and `std::env` merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants