Skip to content

Extend complete profile warning with a profile-switch suggestion - #5000

Open
borngraced wants to merge 1 commit into
rust-lang:mainfrom
borngraced:main
Open

Extend complete profile warning with a profile-switch suggestion#5000
borngraced wants to merge 1 commit into
rust-lang:mainfrom
borngraced:main

Conversation

@borngraced

Copy link
Copy Markdown

after adding a component (e.g. miri) on one toolchain, rustup try installing it on every other toolchain, failing with no explanation when unavailable there rustup error will now explain the cause and points to rustup set profile minimal.

@borngraced
borngraced force-pushed the main branch 3 times, most recently from 5214d3c to ea129e9 Compare August 8, 2026 20:38
@borngraced
borngraced marked this pull request as draft August 8, 2026 22:19
@rami3l

rami3l commented Aug 10, 2026

Copy link
Copy Markdown
Member

@borngraced I'm sorry, but I'm not sure to have completely understood what you are trying to address with this PR, would you mind elaborating?

@borngraced

Copy link
Copy Markdown
Author

@borngraced I'm sorry, but I'm not sure to have completely understood what you are trying to address with this PR, would you mind elaborating?

@borngraced I'm sorry, but I'm not sure to have completely understood what you are trying to address with this PR, would you mind elaborating?

@rami3l so after working on a codebase that requires/uses the nightly compiler(clippy codebase in my case) and switching to another codebase that depends on stable rustc, rustup tries to download the components that were previously used for the nightly toolchain hence failing with a not so clear error on what to do. e.g the current error output is this:

error: some components are unavailable for download for channel '1.97-x86_64-unknown-linux-gnu': 'miri' for target 'x86_64-unknown-linux-gnu', 'rustc-codegen-cranelift' for target 'x86_64-unknown-linux-gnu'

after this PR it should be this:

error: some components are unavailable for download for channel '1.97-x86_64-unknown-linux-gnu': 'miri' for target 'x86_64-unknown-linux-gnu', 'rustc-codegen-cranelift' for target 'x86_64-unknown-linux-gnu'

note: these were added as default components on another toolchain
help: run `rustup set profile minimal` to stop new toolchains from inheriting extra components

I'm not sure if I had explicitly set my rustup profile to complete but yeah the error message isn't helpful at all.

I will take a proper look at the PR this week and fix the edge cases I missed out. thanks to CI

@rami3l

rami3l commented Aug 10, 2026

Copy link
Copy Markdown
Member

@borngraced Thanks for your clarification!

I think this is indeed caused by your setting the complete profile as the default in the override, but In our case this profile is retained for compatibility purposes only and is not supposed to be used anymore. Thus, it is expected that the installation on stable will never succeed on modern Rust toolchains.

In other words, your new error message isn't quite precise because your reported behavior is not caused by your repo-local override.

Rather, I think it'd be better if we can add deprecation warnings when the user tries to use it. Thanks again for your comprehension 🙏

@rami3l

rami3l commented Aug 10, 2026

Copy link
Copy Markdown
Member

@borngraced It seems that we already have this warning in place. Did you see it in your case, or do you think it could use more refinements?

rustup/src/cli/rustup_mode.rs

Lines 1075 to 1077 in 46035eb

if cfg.get_profile()? == Profile::Complete {
warn!("{}", common::WARN_COMPLETE_PROFILE);
}

@borngraced

borngraced commented Aug 10, 2026

Copy link
Copy Markdown
Author

@borngraced It seems that we already have this warning in place. Did you see it in your case, or do you think it could use more refinements?

rustup/src/cli/rustup_mode.rs

Lines 1075 to 1077 in 46035eb

if cfg.get_profile()? == Profile::Complete {
warn!("{}", common::WARN_COMPLETE_PROFILE);
}

@borngraced It seems that we already have this warning in place. Did you see it in your case, or do you think it could use more refinements?

rustup/src/cli/rustup_mode.rs

Lines 1075 to 1077 in 46035eb

if cfg.get_profile()? == Profile::Complete {
warn!("{}", common::WARN_COMPLETE_PROFILE);
}

Yeah, it does warn actually but doesn't really imply anything

[I] borngraced@0x ~/w/tdev (main) [1]> RUSTUP_LOG=warn ~/dev/rustup/target/debug/rustup toolchain install 1.97
2026-08-10T13:17:25.615271Z  WARN rustup::cli::rustup_mode: downloading with complete profile isn't recommended unless you are a developer of the rust language
2026-08-10T13:17:30.163548Z ERROR rustup::cli::common: some components are unavailable for download for channel '1.97-x86_64-unknown-linux-gnu': 'miri' for target 'x86_64-unknown-linux-gnu', 'rustc-codegen-cranelift' for target 'x86_64-unknown-linux-gnu'

Maybe we could extend the warning instead. what do you think @rami3l ?

I don't think this is bad either

[I] borngraced@0x ~/w/tdev (main) [1]> RUSTUP_LOG=warn ~/dev/rustup/target/debug/rustup toolchain install 1.97
2026-08-10T13:17:25.615271Z  WARN rustup::cli::rustup_mode: downloading with complete profile isn't recommended unless you are a developer of the rust language
2026-08-10T13:17:30.163548Z ERROR rustup::cli::common: some components are unavailable for download for channel '1.97-x86_64-unknown-linux-gnu': 'miri' for target 'x86_64-unknown-linux-gnu', 'rustc-codegen-cranelift' for target 'x86_64-unknown-linux-gnu'

help: run `rustup set profile minimal` to stop new toolchains from inheriting extra components

@rami3l

rami3l commented Aug 10, 2026

Copy link
Copy Markdown
Member

@borngraced I think extending the warning to the second line suggesting rustup set profile default or rustup set profile minimal makes perfect sense. Would you mind repurposing this PR for that?

@borngraced

Copy link
Copy Markdown
Author

@borngraced I think extending the warning to the second line suggesting rustup set profile default or ``rustup set profile minimal` makes perfect sense. Would you mind repurposing this PR for that?

agreed. yeah for sure

@borngraced
borngraced marked this pull request as ready for review August 10, 2026 13:39
@borngraced borngraced changed the title Improve error message when default components are unavailable on a new toolchain Extend complete profile warning with a profile-switch suggestion Aug 10, 2026
Comment thread src/cli/common.rs Outdated
};

pub(crate) const WARN_COMPLETE_PROFILE: &str = "downloading with complete profile isn't recommended unless you are a developer of the rust language";
pub(crate) const WARN_COMPLETE_PROFILE: &str = "downloading with complete profile isn't recommended unless you are a developer of the rust language. consider switching to the default profile with `rustup set profile default` or the minimal profile with `rustup set profile minimal`";

@rami3l rami3l Aug 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: I think we can be clearer and more concise about the warning. Something like:

Suggested change
pub(crate) const WARN_COMPLETE_PROFILE: &str = "downloading with complete profile isn't recommended unless you are a developer of the rust language. consider switching to the default profile with `rustup set profile default` or the minimal profile with `rustup set profile minimal`";
pub(crate) const WARN_COMPLETE_PROFILE: &str = "downloading with the `complete` profile has been deprecated
help: consider switching to the `default` profile with `rustup set profile default`";

View changes since the review

Comment thread tests/suite/cli_v2.rs
...
warn: downloading with complete profile isn't recommended unless you are a developer of the rust language
warn: downloading with the `complete` profile has been deprecated

@rami3l rami3l Aug 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Remove this newline to align with the existing message style.

View changes since the review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants