Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade nightly when adding component #2146

Open
RalfJung opened this issue Dec 5, 2019 · 4 comments
Open

Downgrade nightly when adding component #2146

RalfJung opened this issue Dec 5, 2019 · 4 comments

Comments

@RalfJung
Copy link
Member

RalfJung commented Dec 5, 2019

Describe the problem you are trying to solve

I have a nightly installed and want to add a component that is not available for this or any newer nightly.

Describe the solution you'd like

With #2126 we have rustup toolchain install --allow-downgrade; this issue would be solved by adding the parallel rustup component add --allow-downgrade.

Notes

Currently available work-around: rustup toolchain install $already_installed_channel --allow-downgrade -c added_component_name

@kinnison
Copy link
Contributor

kinnison commented Feb 1, 2020

Unfortunately @BeniCheni grew too busy to continue work on this issue, thus it is open for new contributors once more. Information on one possible approach (though Ben decided he didn't like it in the end) is in #2176 and support is available on Discord in the #wg-rustup channel.

ilai-deutel added a commit to ilai-deutel/kibi that referenced this issue Mar 27, 2020
Sometimes, not all components are available in any given nightly, which causes
errors such as #24. Therefore, we use
the `--allow-downgrade` flag to downgrade the version if rustfmt is not
available for this or any newer nightly.

In the future, `rustup component add` will have a `--allow-downgrade` flag
(see rust-lang/rustup#2146) we can use instead of
this work-around.
ilai-deutel added a commit to ilai-deutel/kibi that referenced this issue Mar 27, 2020
Sometimes, not all components are available in any given nightly, which
causes errors such as #24.
Therefore, we use the `--allow-downgrade` flag to downgrade the version
if rustfmt is not available for this or any newer nightly.

In the future, `rustup component add` will have a `--allow-downgrade`
flag (see rust-lang/rustup#2146) we can use
instead of this work-around.
@kinnison kinnison removed the E-easy label May 10, 2020
@kinnison kinnison removed this from the 1.22.0 milestone May 10, 2020
@kinnison
Copy link
Contributor

This turns out to be moderately hard given where the auto-downgrade logic is currently. I don't want to block a 1.22 release on this.

@kellda
Copy link
Contributor

kellda commented Apr 21, 2021

Currently available work-around: rustup toolchain install $already_installed_channel --allow-downgrade -c added_component_name

What about calling install_from_dist (the same function as rustup toolchain install calls) when --allow-downgrade is passed to rustup component add ? Would we need to prevent upgrading the toolchain in this case ?

@kinnison
Copy link
Contributor

It would indeed need to prevent upgrade, which would complicate the install-from-dist interface again :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants