rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Not recognizing rust-toolchain.toml 's `channel` value when `rustup override list`?

Open FumiyaShibusawa opened this issue 3 years ago • 0 comments

Problem

Sorry if it's intentional or already been issued. I thought rustup override list respects rust-toolchain.toml setting, but it seems not.

With the rust-toolchain.toml setting like below,

[toolchain]
channel = "nightly-x86_64-apple-darwin"

rustup override list says no overrides. But rustup toolchain list shows overridden channel, and rustc's version points to nightly properly.

% rustup override list
no overrides
% rustup toolchain list
stable-x86_64-apple-darwin (default)
beta-x86_64-apple-darwin
nightly-x86_64-apple-darwin (override)
% rustc --version
rustc 1.64.0-nightly (affe0d3a0 2022-08-05)

I'm not sure if this behavior is expected or not, but I couldn't find any docs that mention on this at least.

Steps

  1. install nightly channel by rustup toolchain install nightly.

  2. create rust-toolchain.toml file with the following setting in your working directory.

[toolchain]
channel = "nightly-x86_64-apple-darwin"
  1. run rustup override list to see which channel overrides the default.

Possible Solution(s)

As the command itself rustup override list shows, it might be natural to search for either rust-toolchain.toml or rust-toolchain file.

As the function list_toolchains(cfg: &Cfg, verbose: bool) which is located in src/cli/common.rs invokes find_override(&self, path: &Path) method to find those relevant files, the function list_overrides(cfg: &Cfg) could also utilize find_override as well.

If this looks good, I'd like to work on this.

Notes

No response

Rustup version

% rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.64.0-nightly (affe0d3a0 2022-08-05)`

Installed toolchains

% rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/fumiyashibusawa/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
beta-x86_64-apple-darwin
nightly-x86_64-apple-darwin

active toolchain
----------------

nightly-x86_64-apple-darwin (overridden by '/Users/fumiyashibusawa/workspace/private/rust/blog_os/rust-toolchain.toml')
rustc 1.64.0-nightly (affe0d3a0 2022-08-05)

FumiyaShibusawa avatar Aug 08 '22 17:08 FumiyaShibusawa