Proposal: special toolchain names referring to particular override levels
Maintainers usually reply within 1 day
@14elias is already working on this.
Since Sep 6, 2026.
Assessment
This issue has not been assessed yet.
Description
Part of https://github.com/rust-lang/rustup/issues/4059.
Since https://github.com/rust-lang/rustup/pull/4932 it has been decided that only characters satisfying GeneralSecurityProfile::identifier_allowed() should be allowed in rustup toolchain names.
This has opened up new possibilities for us to assemble our special/reserved toolchain names as needed with special characters such as @ or =.
Following up the above efforts, noting the five levels of rustup toolchain overrides:
- The
+<toolchain>override.- The
RUSTUP_TOOLCHAINenvironment variable.- The
rustup override setoverride.- The
rust-toolchain.tomloverride.- The default toolchain.
... aiming to address https://github.com/rust-lang/rustup/issues/4391, I propose the following changes:
- Make
envanddefaultnew reserved words in addition to the existingnone. - Introduce the following toolchain syntax:
env: Refers to the toolchain that should be activated by the env override.- This will not be useful per se but sometime people want to be explicit, e.g.
rustup run env cargoinstead ofcargo.
- This will not be useful per se but sometime people want to be explicit, e.g.
dir=<dir>: Refers to the toolchain that should be activated by the dir override on<dir>or its fallback dirs.- e.g.
cargo +dir=./crates/download
- e.g.
file=<file>: Refers to the toolchain that should be activated by the TOML override in<file>which follows therust-toolchain.tomlschema.- e.g.
cargo +file=windows.toml, for a Windows-specificrust-toolchain.tomlsetup.
- e.g.
default: Refers to the default toolchain. Bails out if none is set.- e.g.
cargo +default
- e.g.
Concerns
- How should we handle the error for
dir=andfile=when the dir/TOML override doesn't exist? Should we bail out or warn and fall back to the next level?- My guess is that we should warn and fall back.
- Consider the relation between this proposal and #4945. Should we resolve the toolchain name when the user issues
rustup default file=windows.toml? If so, should we fully resolve or partially resolve it?- My guess is that we should partially resolve to an official or a custom toolchain name (that isn't a reserved word and doesn't have special characters like
=).
- My guess is that we should partially resolve to an official or a custom toolchain name (that isn't a reserved word and doesn't have special characters like
- Can we use this in
RUSTUP_TOOLCHAIN(isRUSTUP_TOOLCHAINnot guaranteed to be a parsable toolchain name by downstreams other than rustup)? If we can, we will also resolve #2793 at the same time by settingRUST_TOOLCHAIN=default.- I think we probably can.
Note
This also simplifies https://github.com/rust-lang/cargo/issues/10098 because this involves changing the override lookup logic to work with arbitrary base paths. In that case, we'd just need to alter the path for our dir/TOML override source by prefixing it with the path passed via cargo -C.
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 1.1k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 45
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/rustup
-
enhancement O-shell
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
rust-analyzer fallback recurses through Homebrew’s wrapperPossibly taken @rami3l claimed this 1 day ago. Openenhancement O-macos
Difficulty 5/5 Over a week Newbie friendliness 35/100
rust-lang/rustup#5133 · 5 comments ·
Maintainers usually reply within 1 day
-
Verbose output for removing components on toolchain updatePossibly taken @rami3l claimed this 9 days ago. Openenhancement
rust-lang/rustup#5122 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Continuous performance tracking to avoid major regressionsPossibly taken @rami3l claimed this 17 days ago. Openmeta
rust-lang/rustup#5103 · 3 comments · 5 reactions · 1 assignee ·
Maintainers usually reply within 1 day
-
Suggest another toolchain when removing a component unavailable to the current toolchainPossibly taken @14elias claimed this 1 day ago. Openenhancement help wanted
Difficulty 3/5 1-2 days Newbie friendliness 65/100
rust-lang/rustup#5098 · 6 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in rust-lang/rustup
Similar issues
-
C-bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rust-lang/rust-analyzer#23501 ·
Maintainers usually reply within 1 day
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP statusPossibly taken A pull request linked to this issue is open or already merged. Openbug P2 ready for work T-security T-transport
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/rust-sdk#1339 ·
Maintainers usually reply within 3 days
-
French BIP39 wordlist starts with a UTF-8 BOM, so generated French mnemonics carry U+FEFF and derive a non-canonical seedPossibly taken @Kshot3000 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 91/100
ergoplatform/sigma-rust#976 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[Bug]: Web chat input doesn't regain focus after a reply finishesPossibly taken @GaijinSystems claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zeroclaw-labs/zeroclaw#11658 ·
Maintainers usually reply within 2 days