Does not return a non-zero exit status when update fails
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Description
If an update fails, rustup update still returns a zero exit status. I think it should return a non-zero exit status so that if it's called from another program or script, that program or script can easily determine that it failed without having to scrape its output.
Here's an example of the messages that are shown when the update fails:
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2017-07-20, rust version 1.19.0 (0ade33941 2017-07-17)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: removing component 'rustc'
info: removing component 'rust-std'
info: rolling back changes
error: could not rename component file from 'C:\Users\kraaimx\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/x86_64-pc-windows-msvc/lib/arena-12c6b2edb037e265.dll.lib' to 'C:\Users\kraaimx\.rustup\tmp\9lq7jdzdcw367gzh_file'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2017-07-20, rust version 1.20.0-nightly (582af6e1a 2017-07-19)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: removing component 'rustc'
info: removing component 'rust-std'
info: removing component 'cargo'
info: removing component 'rust-docs'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: checking for self-updates
stable-x86_64-pc-windows-msvc update failed - rustc 1.18.0 (03fc9d622 2017-06-06)
nightly-x86_64-pc-windows-msvc updated - rustc 1.20.0-nightly (582af6e1a 2017-07-19)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the rustup update command's handling of a failed channel update and how it selects the final process status. Reproduce a mixed result like the report, where one toolchain fails and another succeeds, then verify that the command returns non-zero while still reporting each update result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100