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

When rustup update fails, it doesn't return an exit code that indicate failure #3476

Closed
dzamlo opened this issue Sep 9, 2023 · 2 comments · Fixed by #3952
Closed

When rustup update fails, it doesn't return an exit code that indicate failure #3476

dzamlo opened this issue Sep 9, 2023 · 2 comments · Fixed by #3952

Comments

@dzamlo
Copy link

dzamlo commented Sep 9, 2023

Problem

When rustup update fails, it doesn't return an exit code that indicate failure but instead returns 0.

Steps

  1. Be in a situation where rustup update fails, for example by disabling your network connection
  2. Run rustup update
  3. The command returns the exit code 0, or success

Possible Solution(s)

Return an exit code different than 0 in case of failure

Notes

No response

Rustup version

rustup 1.26.0 (2023-05-04)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.72.0 (5680fa18f 2023-08-23)`

Installed toolchains

Not relevant
@dzamlo dzamlo added the bug label Sep 9, 2023
@rami3l rami3l added this to the 1.28.0 milestone Jul 10, 2024
@rami3l
Copy link
Member

rami3l commented Jul 15, 2024

Thanks for @roife's confirmation: this issue doesn't seem to be reproducible with the official prebuilt binary, so this could be a specificity of the no-self-update feature.

@rami3l
Copy link
Member

rami3l commented Jul 16, 2024

As a matter of fact, the following line (L295):

rustup/src/cli/common.rs

Lines 290 to 296 in 4149df6

pub(crate) async fn update_all_channels(
cfg: &Cfg<'_>,
do_self_update: bool,
force_update: bool,
) -> Result<utils::ExitCode> {
let toolchains = cfg.update_all_channels(force_update).await?;

... has muted all failures during the update, which is quite inappropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants