Skip to content

Update to most recent viable nightly #1997

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

Merged
merged 2 commits into from
Sep 17, 2019

Conversation

jonhoo
Copy link
Contributor

@jonhoo jonhoo commented Sep 16, 2019

Previously, if the user had components installed on nightly which were not available for the latest nightly, rustup update would not update the user's nightly at all. With this patch, rustup will try progressively older nightlies until it finds a nightly that supports all the components the user has installed for their current nightly.

Fixes #1628.
Makes progress towards #1501.
Fixes the underlying issue in #1676.

@jonhoo
Copy link
Contributor Author

jonhoo commented Sep 16, 2019

As an anecdotal observation, the code for mocking a dist in tests/mock/clitools.rs should probably be refactor separately from this change. It's currently pretty messy, and would benefit from some cleanup, and probably some macros.

@jonhoo
Copy link
Contributor Author

jonhoo commented Sep 16, 2019

Cleanup in #1998

@norru
Copy link

norru commented Sep 17, 2019

This is ace. Thank you very much!

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from my concern over missing nightlies and a possible bit of reformatting, this looks like a nice simple elegant solution to the problem.

@jonhoo jonhoo requested a review from kinnison September 17, 2019 14:39
Previously, if the user had components installed on `nightly` which were
not available for the latest nightly, `rustup update` would not update
the user's nightly at all. With this patch, rustup will try
progressively older nightlies until it finds a nightly that supports all
the components the user has installed for their current nightly.

Fixes rust-lang#1628.
Makes progress towards rust-lang#1501.
Fixes the underlying issue in rust-lang#1676.
Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 I'll merge once I have a confirm from CI.

@kinnison kinnison merged commit bca2352 into rust-lang:master Sep 17, 2019
@jonhoo jonhoo deleted the conditional-update branch September 17, 2019 16:12
@vi
Copy link

vi commented Sep 17, 2019

When will it be available for rustup self update?

@kinnison
Copy link
Contributor

When will it be available for rustup self update?

@vi When we're ready to release 1.20.0 -- We have active tester requests out right now, and we may put further requests out on the way to 1.20.0. Once we're good, we'll release. I'd guess at a small (one or two) number of weeks.

@Arnavion
Copy link

Arnavion commented Sep 21, 2019

@jonhoo @kinnison How would I restore the original behavior? Do I have to rustup component remove the components I don't mind losing before rustup updateing, then rustup component add them back? Or is there an easier way?

@najamelan
Copy link

@Arnavion one option is to check https://rust-lang-nursery.github.io/rust-toolstate/ manually and not update if not all your components are there...

@jonhoo
Copy link
Contributor Author

jonhoo commented Sep 21, 2019

@Arnavion I'm not sure I follow? The old behavior was to simply fail the update. If you mean to force the update, then you should be able to pass --force.

@Arnavion
Copy link

Arnavion commented Sep 21, 2019

@jonhoo The new behavior, AFAICT from your change, is that rustup update will always succeed, but leave me with a nightly that is not the latest. The original behavior was that rustup update would fail, which my "update Rust" script would detect and handle by removing components that I don't need (clippy, rustfmt), re-running rustup update, then rustup component adding (rustfmt) or cargo installing (clippy, since it's usually fixed in git master even if the submodule in the rust repo is broken) the components back.

Yes, --force seems to be what I was asking for. Thanks.

@EliSnow
Copy link

EliSnow commented Oct 31, 2019

@jonhoo, I was reminded of this great work today when I did a rustup update and saw the message skipping nightly which is missing installed component 'rls-preview'. Thank you!

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

Successfully merging this pull request may close these issues.

Feature request: "rustup update nightly" to the last version which has all necessary components.
9 participants