Skip to content

feat(cli/rustup-mode): warn about auto-installation in some subcommands#4895

Open
rami3l wants to merge 3 commits into
rust-lang:release/1.29from
rami3l:feat/backport-auto-install-rustup-warn
Open

feat(cli/rustup-mode): warn about auto-installation in some subcommands#4895
rami3l wants to merge 3 commits into
rust-lang:release/1.29from
rami3l:feat/backport-auto-install-rustup-warn

Conversation

@rami3l

@rami3l rami3l commented Jun 5, 2026

Copy link
Copy Markdown
Member

Adapted from c037408 (#4840); closes #4894.

@rami3l rami3l modified the milestone: 1.29.1 Jun 5, 2026
@rami3l rami3l added the backport This is an issue which should be backported to the next patch release, or it is a backporting PR. label Jun 5, 2026
@rami3l

rami3l commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

Hmmm the blast radius is too large.

Lemme think: maybe we should just print the warning as an additional step for warn_auto_install()?

@rami3l rami3l force-pushed the feat/backport-auto-install-rustup-warn branch 3 times, most recently from 41ff1f3 to 191ea78 Compare June 5, 2026 17:47
@rami3l rami3l changed the title feat: warn about auto-installation in some rustup subcommands feat(cli/rustup-mode): warn about auto-installation in some subcommands Jun 5, 2026
@rami3l rami3l force-pushed the feat/backport-auto-install-rustup-warn branch from 191ea78 to 7375543 Compare June 5, 2026 18:28
@rami3l rami3l force-pushed the feat/backport-auto-install-rustup-warn branch from 7375543 to 5f10e42 Compare June 5, 2026 18:44
@rami3l rami3l marked this pull request as ready for review June 5, 2026 19:13
@rami3l rami3l requested a review from djc June 5, 2026 19:13
Comment thread src/config.rs Outdated
Comment thread src/config.rs
@rami3l rami3l force-pushed the feat/backport-auto-install-rustup-warn branch from 5f10e42 to fb400fe Compare June 8, 2026 06:22
@rami3l rami3l force-pushed the feat/backport-auto-install-rustup-warn branch from fb400fe to 69a3107 Compare June 8, 2026 06:29
Comment thread src/config.rs
Comment on lines +159 to +164
// NOTE: Special behavior for rustup v1.29
warn!(
"this is deprecated for most `rustup` commands and may not work in a future release"
);
warn!("see <https://github.com/rust-lang/rustup/issues/4836> for more info");
return;

@djc djc Jun 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, now I am confused about this (sorry). The way I read this, this will issue a warning for subcommands for which allow_auto_install() yields false exactly because they don't use the active toolchain anyway.

So am I misunderstanding this or is this pure noise?

View changes since the review

@rami3l rami3l Jun 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@djc Your understanding looks correct to me.

Looking back I'd argue that allow_auto_install might no longer be the best name here anymore because it now stands for "allows auto install in v1.30" or "should not emit a deprecation warning in v1.29" which is making the code harder for you to review. Is that you are trying to say?

I can offer to do a cleanup commit upfront in which I'll rename this variable, if that makes it easier for you 🙏

One downside for that is that it might make future backports more difficult if they happen to touch this part 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm suggesting that it does not make sense to warn about this because automatic installation is not actually affecting the running command anyway.

@rami3l rami3l Jun 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@djc It doesn't mean anything in the context of the current command indeed, but I've seen people using this (e.g. rustup show) to install the active toolchain, because there was a time when rustup toolchain install wasn't available (v1.27 and earlier) and that was the only way to install the active toolchain. Maybe it makes more sense to you now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmmm maybe for the sake of clarity I should have added "to install the active toolchain, use rustup toolchain install instead" or something like that.

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

Labels

backport This is an issue which should be backported to the next patch release, or it is a backporting PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants