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

Propagate io and terminal errors upward and ignore EPIPE #1630

Merged
merged 1 commit into from
Feb 26, 2019

Conversation

NickeZ
Copy link
Contributor

@NickeZ NickeZ commented Jan 30, 2019

This is an alternative to: #1622

In this solution I instead ignore the EPIPE error at the highest level. I haven't contributed to rustup before, so please check the PR carefully.

Fixes #1621

@kinnison
Copy link
Contributor

kinnison commented Feb 3, 2019

HI @NickeZ thanks for taking the time to produce this alternative patch. I'm sorry I was away last week so didn't get a chance to review it before now.

A brief look over suggests this is a reasonable approach, but I want to take some time to consider if there're other places where we ought to handle epipe in a similar fashion (e.g. component list)

Please bear with me for a few days.

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

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

I like this change. 👍

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 5, 2019

Great, but can you check if the macro I have written is correct/idiomatic?

edit: It could probably just be a regular function...

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 5, 2019

Is it possible to add a test that runs the equivalent of rustup show | head -1? Could someone show me approximately where and how to do that?

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

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

Yeah, I think as a function it's a bit nicer. I didn't mind the macro at all, but this is perhaps easier for others to grok.

Are there any other parts of the codebase where handling epipe would be useful? I'm not asking for them in this PR, it has a 👍 already from me, but perhaps once this is in you might go for a wander and see if there's other places worth checking on?

Regarding the testing for rustup show | head -1 I don't think we have a way to easily simulate that in our tests right now, so I don't mind not having that yet, but if you think of something I'll be pleased to review another PR (or change on this one) for it.

@@ -1,3 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this added by a new version of Cargo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It must have been. I only ran cargo fmt, check and build. I didn't manually change that file. do you want me to remove it?

Copy link
Member

Choose a reason for hiding this comment

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

Is this added by a new version of Cargo?

Yes: rust-lang/cargo#6548

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 5, 2019

Do you want me to squash it or anything else before merging? To me it is good to go as it is now.

@kinnison
Copy link
Contributor

kinnison commented Feb 7, 2019

Do you want me to squash it or anything else before merging? To me it is good to go as it is now.

My preference is certainly that the commits are neat and tidy, so yes, a squash would be appreciated.

Thanks

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 8, 2019

OK, squashed.

@bors
Copy link
Contributor

bors commented Feb 10, 2019

☔ The latest upstream changes (presumably #1643) made this pull request unmergeable. Please resolve the merge conflicts.

@nrc
Copy link
Member

nrc commented Feb 10, 2019

Sorry, this needs a rebase

This commit solves the problem where rustup panics when the stdout is a
pipe that has been closed. Rustup will now ignore EPIPE on write and
instead quit with status code 0.
@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 11, 2019

rebased and pushed

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 19, 2019

ping

@nrc nrc merged commit a107c9f into rust-lang:master Feb 26, 2019
This was referenced Feb 26, 2019
@NickeZ NickeZ deleted the fix-panic-2 branch February 26, 2019 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants