Rustup: [Feature Request] Downgrading nightly toolchains

Created on 16 Oct 2019  路  9Comments  路  Source: rust-lang/rustup

As talked on Discord with @kinnison
I think an interesting usecase is to be able to downgrade your nightly feature to one that supports specific toolchains.
i.e.
rustup toolchain install nightly --downgrade -c rustc -c rust-std -c cargo -c rustfmt -c clippy -c rls -c rust-analysis -c miri

This can make adding new components to your local toolchain easier (then tools like miri could add this to their docs and you won't need to uninstall latest nightly before installing this).

Another thing that this made me think of, maybe a way to aggregate components?
For example, I install rustup toolchain install nightly -c cargo and now I want to add miri support so by doing something like rustup toolchain install nightly --downgrade --add -c miri It will now find me a toolchain with both clippy and miri.

E-mentor enhancement help wanted

Most helpful comment

I'll look into it during RustFest, coordination through rust-lang discord #wg-rustup

All 9 comments

I wonder if @jonhoo might have input on this?

--downgrade sounds to me like an option on component add, not on install. So you'd do:

$ rustup component add --allow-downgrade miri

UX aside, it's all the same pathway internally, so it'd go via your backtracking code @jonhoo :D I was more interested in what you thought about a bool to obviate the "stop at current version" check we currently have.

I guess it seems okay to downgrade if the user explicitly asks for it :man_shrugging:

Travis provides Rust environments for Nightly with:

language: rust
rust:
    - nightly

This is great, unless you happen to require specific components for your builds. If you do, you'll need to uninstall the existing Rust version to be able to ensure rustup can install something that fulfills your requirements.

This is from Intercom's current .travis.yml:

    - rustup component add clippy rustfmt
    - if( ! cargo clippy -V || ! cargo fmt --version ); then rustup uninstall nightly && rustup toolchain install nightly -c clippy -c rustfmt; fi

--allow-downgrade would simplify this a lot!

I'll look into it during RustFest, coordination through rust-lang discord #wg-rustup

The PR mentions "rustup toolchain install --allow-downgrade", but what about "rustup component add --allow-downgrade" that was also mentioned above -- should a new issue be opened for that?

@RalfJung It might make sense to create an issue around that, yes.

The functionality is available via rustup toolchain install $already_installed_channel -c added_component_name but the rustup component add pathway is a bit different and harder to get this feature into right now, hence it's missing from the CLI for 1.21.0

Was this page helpful?
0 / 5 - 0 ratings