rust-lang / rust-lang/rustup

Make Rustup install a non-emulated toolchain in an emulated environment

Open
#3,514 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

As a continuation of #3068:

Is it possible to teach 'rustup self update' to install the correct non-emulated binary (even if there isn't a new rustup version to update to)?

I think we'd also need to change the default target in the rustup config, since that will be intel rather than aarch64 too.

I'm not sure UX wise whether doing it silently is sensible. I worry about IDE integrations.

What about this as a proposal:

  1. we add some docs about this
  2. add a config option to disable emulation detection (default is enabled)
  3. if emulation detection is enabled:
    a) all proxies stop working and output an error directing folk to our docs
    b) rustup self update with no options is unchanged
    c) rustup self update --to-native, a new option to self update, will:
    1. if the default host triple matches the emulation, rewrite it to be the native triple
    2. if the default toolchain, and any override toolchains, specify the emulated triple, rewrite them to match the native triple
    3. download the native rustup-init and install it into place

I'm not suggesting deleting toolchains because that gets into rapidly mounting complexity: cross.rs for instance wants lots of non-native toolchains present, linked toolchains can be wrong too and we don't have their arch etc.

Changing the defaults and overrides will cause implicit installation of the rewritten toolchain specifications automatically at next use.

Originally posted by @rbtcollins in https://github.com/rust-lang/rustup/issues/3068#issuecomment-1474436068

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 issue #3068 and the rustup self update entry point described here. Trace emulation detection, configuration, proxy handling, toolchain overrides, and rustup-init installation before deciding the design. Done means the documented proposal is implemented, including --to-native, configuration behavior, rewritten targets, and user-facing guidance.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.