rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.2k stars 891 forks source link

Add support for `install --profile empty` #2970

Open jyn514 opened 2 years ago

jyn514 commented 2 years ago

Problem you are trying to solve

Bootstrap in rust-lang/rust wants to have a version of rustfmt that's different than the bootstrap compiler toolchain. Right now, to manage it using rustup, we'd have to install a full duplicate toolchain with rustup install --profile minimal. It would be nice to only install the rustfmt component and nothing else.

Solution you'd like

@kinnison and @rbtcollins on Discord agreed to rustup toolchain install --profile empty, which would mean "register this toolchain with rustup" (and I guess download the manifest?), "but don't install any components". That would allow running rustup toolchain install nightly-2022-02-23 --profile empty --component rustfmt in bootstrap.

Notes

cc https://github.com/rust-lang/rust/issues/95136

kinnison commented 2 years ago

To progress this we need to know if rustup will be okay with a manifest-only toolchain. If so then this isn't too awful to implement. It'd also behove us to decide if we want a --force for this or not.

kinnison commented 2 years ago

After brief discussion on Discord, we think --profile empty might be better since it's more explicitly that there won't be things there. I'll edit the title and first post to reflect that, so that we don't have --profile bare front-and-center if someone wants to help.

bjorn3 commented 2 years ago

In https://rust-lang.zulipchat.com/#narrow/stream/301329-t-devtools/topic/rust-analyzer.20ro.20rust-lang.20org.20transition/near/276493090 it came up that --profile empty could be used to install just the rust-analyzer for a given nightly version without having to install the associated nightly rustc.