Description
Problem
IntelliJ RustRover and scripts use rustup show active-toolchain
to get the active toolchain name. The output is now broken as it includes a message "active because: it's the default toolchain" on a second line.
This happened in #3225.
$ rustup show active-toolchain --help
Show the active toolchain
Usage: rustup[EXE] show active-toolchain [OPTIONS]
Options:
-v, --verbose Enable verbose output with rustc information
-h, --help Print help
Discussion:
Shows the name of the active toolchain.
This is useful for figuring out the active tool chain from
scripts.
You should use `rustc --print sysroot` to get the sysroot, or
`rustc --version` to get the toolchain version.
This is useful for figuring out the active tool chain from scripts.
Which is why it should output exactly the toolchain name, nothing more.
Steps
Current output (v1.28.0):
$ rustup show active-toolchain
nightly-x86_64-unknown-linux-gnu
active because: it's the default toolchain
Gives this chaotic error when loading any project in RustRover:
Execution failed (exit code 1).
/home/sky9/.cargo/bin/cargo "+nightly-x86_64-unknown-linux-gnu
active because: it's the default toolchain" vendor --respect-source-config /home/sky9/.cache/JetBrains/RustRover2025.1/intellij-rust/stdlib/1.87.0-nightly-c16751b793dfce34909c1ba3fd1cbf4f827d7deb/vendor
in working directory: /home/sky9/.cache/JetBrains/RustRover2025.1/intellij-rust/stdlib-local-copy/1.87.0-nightly-9375198e512f5c5ff5ae71857b1e38933ec1941d/library/sysroot
with extra environment variables: RUSTC_BOOTSTRAP=1 TERM=ansi RUST_BACKTRACE=short RUSTC=/home/sky9/.cargo/bin/rustc
stdout: error: toolchain 'nightly-x86_64-unknown-linux-gnu
active because: it's the default toolchain' is not installed
stderr:
It is trying to find a toolchain with the name nightly-x86_64-unknown-linux-gnu\nactive because: it's the default toolchain
(with a newline in the middle) which obviously doesn't exist.
Previous output (v1.27.1 and below):
$ rustup show active-toolchain
nightly-x86_64-unknown-linux-gnu (default)
Possible Solution(s)
A v1.28.1
should be released with a patch reverting just the rustup show active-toolchain
output back to pre-1.28.0 behavior.
Rustup version
rustup 1.28.0 (6e19fbec7 2025-03-02)