rust-lang / rust-lang/rustup

rust-toolchain.toml documentation improvements

Open
#2,880 0 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Hi everyone! Thanks for all the effort you've put into rustup.

Describe the problem you are trying to solve

Today I'm trying to figure out exactly what rust-toolchain.toml does.

I see that it's documented here. But for example, I can't find where it says that it might cause cargo build to install a toolchain first.

I think the manual should be super up-front about this, because it was surprising to me—even knowing that .cargo/bin/cargo is a proxy—that an innocuous-looking cargo command would implicitly install components.

Describe the solution you'd like

Document rust-toolchain.toml in terms of what effect each setting has, and/or what it's for.

Here are the questions I could not answer from the manual:

  • Under what circumstances does a rustup proxy try to download and install toolchain components?
  • What all is installed?
  • Can I tell it not to?
  • How do components and profile interact, if I have both?
  • What happens if I try to use a component that's not selected? What if it's already installed?
  • Does targets affect the target architecture of a cargo build, the way channel affects toolchain selection? Should I use specify targets only if I am cross-compiling?
  • Do components, profile, and targets come into play only when rustup tries to install toolchain components "on demand"? Is there a command that explicitly does that installation? (one imagines something like rustup install --auto, omitting the <toolchain> argument)
  • A single toolchain has to be used for the entire build, so toolchain files in dependencies are always ignored... Right?

Also: If installation fails, I think it would be helpful, after the current error message, to add something like the above error happened while trying to install <component>, specified in <file>.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the rustup manual's “The toolchain file” section at overrides.html#the-toolchain-file and review the documented behavior of rust-toolchain.toml, rustup proxies, and cargo build. Use the listed questions to define the documentation scope, and confirm that the manual explains installation, components, profile, targets, dependencies, and installation failures when finished.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.