rust-lang / rust-lang/rustup

Tracking: Deduplicate toolchains, components and/or artifacts

Open
#4,663 12 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Problem you are trying to solve

It happens from time to time that the user gets confused about why rustup toolchain install stable, rustup toolchain install 1.92 and rustup toolchain install 1.92.0 require separate and duplicate/redundant downloads when they are essentially the same thing (given that the current stable is 1.92.0).

Such reports include:

The status quo is very well explained in the quote below:

Firstly, 1.70 and 1.70.0 are not the same toolchain. They might be on a given date, but once 1.70.1 releases, they are not.

Secondly, the installed components are currently defined as separate for each toolchain; adding a component that isn't expected might be strange and conceivable a bug for some developers - and turning minor versions into symlinks to concrete versions will have that effect, as you would no longer have separate component lists.
https://github.com/rust-lang/rustup/issues/1366#issuecomment-1633065070

In short, 1.92.0 is a "fixed target" that will always be pointing to that very version of the toolchain, but the other two are "moving target"s: 1.92 will be upgradable to any later 1.92.*, and stable to any later stable. These toolchains are logically separated and I have no intentions to change that, but physically this separation is not an absolute must.

Solution you'd like

A potential solution is to borrow from PNPM and use hard links or junctions that reference a user-global artifact pool. This might have some interesting interactions with multiple proposals, e.g.

  • #3937
  • #731
  • #4636

Another choice could be providing a user-global component (or even toolchain) pool instead of an artifact pool, depending on the flexibility we'd like to achieve.

I personally think choosing the toolchain pool is a bad idea since it turns out sometimes multiple toolchains share the same component esp. when they are not updated.

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 by reviewing the reported cases (#555, #1974, #1366, and #2617), the rustup toolchain install behavior, and the related proposals #3937, #731, and #4636. The issue is exploratory: done would require an agreed design for deduplicating artifacts, components, or toolchains before implementation can be scoped.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.