Updating "nightly" + "clippy" is a nightmare

Hello,

I like to write names of functions and variables in my native language instead of English, and this requires:

#![feature(non_ascii_idents)]

Unfortunately, this in turn requires to use the "nightly" toolchain, because the "stable" one gives me:

"#![feature]" may not be used on the stable release channel

Now, here is the real problem. I use the "clippy" component in order to optimise my code, but for the past few weeks, it's been a nightmare to update "nightly" + "clippy", because "clippy" is not easily available anymore. Indeed, if you go to:

https://rust-lang.github.io/rustup-components-history/x86_64-apple-darwin.html

you will see that "clippy" was unavailable 5 days out of 7.

Now, I know that I can install a toolchain from a specific date, but this means that I have to check manually the last availability of "clippy" and run carefully crafted commands, instead of just running:

rustup update

Any solution?

2 Likes

This is far from a solution, but if you can get a working nightly+clippy toolchain, then rustup update will work as you describe.

Specifically, if you can run rustup update; rustup component add clippy --toolchain nightly successfully on a day where the latest nightly has clippy available, then running rustup update after that will skip over all "bad" nightly versions.

This was added in Update to most recent viable nightly by jonhoo · Pull Request #1997 · rust-lang/rustup · GitHub, and it's a part of the solution. Unfortunately, we don't yet have a wholesale solution to option to install toolchain version IFF it has certain components · Issue #1501 · rust-lang/rustup · GitHub.

Yes, unfortunately nightly breaks clippy and rls often because these components are tightly coupled to the compiler. The best thing to do AFAIK is pin your compiler to a specific nightly version by creating a toolchain file in your repo. Then you can decide when (and which specific version) to update to at your leisure.

You can also do this same thing system-wide by setting your default compiler to a specific nightly build, instead of the nightly channel. e.g. rustup default nightly-2019-10-04

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.