Make Rustup install a non-emulated toolchain in an emulated environment
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:
- we add some docs about this
- add a config option to disable emulation detection (default is enabled)
- 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:
- if the default host triple matches the emulation, rewrite it to be the native triple
- if the default toolchain, and any override toolchains, specify the emulated triple, rewrite them to match the native triple
- 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
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.
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