Skip to content

rustup toolchain install doesn't consistently trigger self update #4565

@rami3l

Description

@rami3l

When going through update()'s logic, it seems that both rustup update and rustup toolchain install foo will do one of the following:

  1. Perform self-update based on runtime settings.
  2. Issue a warning when self-update is disabled at compile time.

However this is not true for rustup toolchain install with no arguments (corresponding to the branch at L1021), since the first case is impossible:

rustup/src/cli/rustup_mode.rs

Lines 1017 to 1028 in 59aec45

if self_update {
exit_code &= self_update::self_update(&dl_cfg).await?;
}
} else if ensure_active_toolchain {
let (toolchain, source) = cfg.ensure_active_toolchain(force_non_host, true).await?;
info!("the active toolchain `{toolchain}` has been installed");
info!("it's active because: {}", source.to_reason());
} else {
exit_code &= common::update_all_channels(cfg, opts.force).await?;
if self_update {
exit_code &= self_update::self_update(&dl_cfg).await?;
}

This could be considered as an inconsistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions