-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.A-rustupArea: rustup interactionArea: rustup interactionC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: EasyExperience: Easy
Description
Problem
With the rustup changes to set $RUSTC
et al, it's become more likely that people will accidentally use +toolchain
on cargo/rustc/etc directly rather than through the rustup shims. While we shouldn't try to handle the toolchain flag ourselves, it would be beneficial to recognize it in the "no such subcommand" path and print a help note notifying the user that cargo received the +toolchain argument but can't handle it.
〉main:pegcel〉rustup which cargo
D:\.rust\rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe
〉main:pegcel〉D:\.rust\rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe +nightly check
error: no such subcommand: `+nightly`
Proposed Solution
〉main:pegcel〉rustup which cargo
D:\.rust\rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe
〉main:pegcel〉D:\.rust\rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe +nightly check
error: no such subcommand: `+nightly`
Did you mean to run cargo through rustup?
Cargo does not handle `+toolchain` directives itself.
Notes
Some rustup context:
- rustup breaks with cargo-make due to environment variables rustup#3029
- rustup 1.25 sets RUSTC, which overrides custom toolchain specified in sub-Cargo invocation rustup#3031
- un-revert "Set RUSTC and RUSTDOC env for child processes run through the proxy" rustup#3035
- rustup 1.25: On Windows, nested cargo invocation with a toolchain specified fails rustup#3036
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.A-rustupArea: rustup interactionArea: rustup interactionC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: EasyExperience: Easy