Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the toolchain overriding config hierarchical #3492

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 12 additions & 8 deletions doc/user-guide/src/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ and override which toolchain is used:
5. The [default toolchain].

The toolchain is chosen in the order listed above, using the first one that is
specified. There is one exception though: directory overrides and the
`rust-toolchain.toml` file are also preferred by their proximity to the current
directory. That is, these two override methods are discovered by walking up
the directory tree toward the filesystem root, and a `rust-toolchain.toml` file
that is closer to the current directory will be preferred over a directory
override that is further away.

To verify which toolchain is active, you can use `rustup show`,
specified. There are a number of caveats though:

- Directory overrides and `rust-toolchain.toml` overrides are determined together.
Since each of them is bounded to the directory it was set in, to find out
which of them to use, `rustup` walks up the directory tree towards the
filesystem root, and whichever has its bounded directory closest to the
current directory wins. If that same closest directory has both overrides,
then `rust-toolchain.toml` is overridden by the directory override.
- When overriding a `rust-toolchain.toml`, its `components` and `targets`
will be carried over to the new toolchain.

To verify which toolchain is active, you can use `rustup show`,
which will also try to install the corresponding
toolchain if the current one has not been installed according to the above rules.
(Please note that this behavior is subject to change, as detailed in issue [#1397].)
Expand Down