Extend complete profile warning with a profile-switch suggestion - #5000
Extend complete profile warning with a profile-switch suggestion#5000borngraced wants to merge 1 commit into
Conversation
5214d3c to
ea129e9
Compare
|
@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 componentsI'm not sure if I had explicitly set my rustup profile to I will take a proper look at the PR this week and fix the edge cases I missed out. thanks to CI |
|
@borngraced Thanks for your clarification! I think this is indeed caused by your setting the 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 🙏 |
|
@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? Lines 1075 to 1077 in 46035eb |
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 |
|
@borngraced I think extending the warning to the second line suggesting |
agreed. yeah for sure |
| }; | ||
|
|
||
| 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`"; |
There was a problem hiding this comment.
Nit: I think we can be clearer and more concise about the warning. Something like:
| 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`"; |
| ... | ||
| 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 | ||
|
|
There was a problem hiding this comment.
Nit: Remove this newline to align with the existing message style.
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
rustuperror will now explain the cause and points to rustup set profile minimal.