-
Notifications
You must be signed in to change notification settings - Fork 955
rustup probabilistically panics with "Broken pipe" when used in a shell pipeline #1730
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
Comments
Hi, we have started to address this issue - so far we've merged #1622 which deals with this for As a word of warning though, we do not make any guarantees as to the long-term reliability of such parsing, though we will be aiming to introduce a JSON dump of rustup state at some point as a start of plumbing commands. |
Unfortunately, I have enough already on my plate that I don't really have time to get up to speed with other people's codebases right now.
I didn't expect otherwise. It's for that exact reason that I've tried to make as few assumptions as possible and, if the assumptions I do make are broken, the failure state is annoying but should be harmless. |
Short term, you could write the output to a temporary file which you then parse. That'd enable you to continue until we have something more supportable for plumbing. |
In order to be easier for scripts to use us, until we define a proper CLI API for that, handle EPIPE situations on all the list type subcommands as well as the show subcommands. Fixes rust-lang#1730 Signed-off-by: Daniel Silverstone <[email protected]>
When checking for an installing plugins, there isn't a need to call cargo for each plugin to check. While this is just-as-good as previous behavior, it also limits any issues when calling a Cargo subcommand that might fail. Presently, there are times where a race exists and either `STDOUT` or `STDERR` might disppear when Rustup (or potentially Cargo) is used in a shell pipeline, leading to a program panic with `failed printing to stdout: Broken pipe (os error 32)`. This change tries to minimize the probability that this occurs until a more robust upstream fix has landed. References: rust-lang/rustup#1730 References: rust-lang/rustup#1765 Signed-off-by: Fletcher Nichol <[email protected]>
Problem
When I run the
install-rustup-deps
task in the justfile for my rust-cli-boilerplate repo, there's about a 50/50 chance that one of the several calls to rustup that it makes will panic with the following output:I've been experimenting with porting the repo to cargo-make, so I've confirmed that the issue also occurs under cargo-make, and I pared it down to a small test shell script which also exhibits the bug.
Steps
You should notice that the command which panics varies from run to run and, sometimes, it completes without panicking at all.
Possible Solution(s)
In the case of a broken pipe, exit without an error message (like other shell commands) and with a success exit code (because I haven't run across any other tools which cause cargo-make to abort with spurious failures when used in this way.)
Notes
Output of
rustup --version
:rustup 1.17.0 (069c88ed6 2019-03-05)
Output of
rustup show
:The text was updated successfully, but these errors were encountered: