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

update README.md on how to install toolchain and components #6294

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,29 @@ for more info.
To run rustfmt after this, use `cargo run --bin rustfmt -- filename`. See the
notes above on running rustfmt.

### Troubleshooting the toolchain

This project uses a pinned toolchain with specific components, as indicated in
[`rust-toolchain`](https://github.com/rust-lang/rustfmt/blob/master/rust-toolchain).
The toolchain hat the name 'nightly-YYYY-MM-DD'.

If your compiler complains that it cannot find dependencies like `rustc_*`, you might have
a wrong or corrupted toolchain. Here's what you can do:

Check the active toolchain by running `rustup show` in the project directory. It should
list all installed toolchains, including the one indicated in `rust-toolchain`. The same
should be given as 'active toolchain' with the hint that it was overridden by the
`rust-toolchain` file.

Make sure that you don't have a directory override. You can remove it with
`rustup override unset`.

If the build still fails, try to completly remove the given toolchain with
`rustup toolchain uninstall nightly-YYYY-MM-DD`. The next `cargo build` should
download and install it correctly.

Additional documentation can be found here:
[Rustup Book, Chapter Overrides](https://rust-lang.github.io/rustup/overrides.html).

## Configuring Rustfmt

Expand Down
Loading