rust-lang / rust-lang/rustup

Reconsider the "toolchain options are ignored for a custom toolchain" error

Open
#4,248 12 comments 2 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

Problem you are trying to solve

The rustup 1.28 release introduced new validation for custom toolchains listed in rust-toolchain.toml files. At Microsoft, we use an internal build of the Rust compiler that is distributed as a custom toolchain (not managed by rustup but linked to from ~/.rustup/toolchains) so it's common for our developers to have rust-toolchain.toml files that look like:

[toolchain]
channel = "ms-1.84.1"
targets = [
    "aarch64-pc-windows-msvc",
    "x86_64-pc-windows-msvc",
]

We have tooling that handles installing the Rust build and appropriate targets. For our developers, this is nice as it aligns very closely to working with the standard Rust toolchain build, which we want to support as much as possible.

With the update to rustup 1.28 however, any invocation of rustc, cargo, etc is met with:

> cargo --version
error: toolchain options are ignored for a custom toolchain (ms-1.84.1)

even when the appropriate custom toolchain is already configured and ready to be used.

Solution you'd like

Ideally, it would be great if this error could only be shown in the case where required components or targets are missing from the custom toolchain!

I understand that is probably difficult to determine ahead of time so some other solutions might be:

  1. Revert the additional validation for custom toolchain options.
    • If this is acceptable, I would be happy to prepare a PR with this change.
  2. Allow the user to ignore this error entirely somehow (preferably via a configuration flag in ~/.rustup/settings.toml or an environment variable).
  3. Downgrade the error to a warning or informational message.
    • This is not highly preferred because it will still appear frequently to our developers while not being useful/actionable.

Thanks for your consideration and efforts to improve rustup!

Notes

No response

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 validation introduced in the linked rustup commit and reproduce the error by running cargo --version with a custom toolchain declared in rust-toolchain.toml. Review how custom toolchains and options in rust-toolchain.toml are handled, along with the configuration in ~/.rustup/settings.toml; done means agreeing on and implementing one of the proposed behaviors.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.