Rust-clippy: Unable to install on Rust 1.31.0 with rustup

Created on 6 Dec 2018  Â·  15Comments  Â·  Source: rust-lang/rust-clippy

Don't seem be to be able to install clippy via rustup.

C:\Users\Ash> rustup show
Default host: x86_64-pc-windows-msvc

stable-x86_64-pc-windows-msvc (default)
rustc 1.31.0 (abe02cefd 2018-12-04)
C:\Users\Ash> rustup component add clippy
error: toolchain 'stable-x86_64-pc-windows-msvc' does not contain component 'clippy' for target 'x86_64-pc-windows-msvc'
L-bug

Most helpful comment

I solved this problem with following way.

  1. rustup self uninstall
  2. Download and install lastest rustup-init (rustup >= 1.16.0) in https://rustup.rs/

    • "Installing older rustup-init. And performing rustup self update" can't solve the problem. You must install lastest rustup-init at first time.

  3. Successfully rustup component add clippy and rustup component add rustfmt!

All 15 comments

cc @nrc @alexcrichton

On Thu, Dec 6, 2018, 1:02 PM Ash <[email protected] wrote:

Don't seem be to be able to install clippy via rustup.

C:\Users\Ash> rustup show
Default host: x86_64-pc-windows-msvc

stable-x86_64-pc-windows-msvc (default)
rustc 1.31.0 (abe02cefd 2018-12-04)
C:\Users\Ash> rustup component add clippy
error: toolchain 'stable-x86_64-pc-windows-msvc' does not contain component 'clippy' for target 'x86_64-pc-windows-msvc'

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/rust-lang/rust-clippy/issues/3503, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABivSFEnU-O-dPc5J6fiZ7ivS9-MpsJPks5u2VudgaJpZM4ZHBaA
.

could you try rustup self update and then try re-installing please?

No luck:

C:\Users\Ash> rustup self update
info: checking for self-updates
info: downloading self-update
info: rustup updated successfully to 1.14.0
C:\Users\Ash> rustup component add clippy
error: toolchain 'stable-x86_64-pc-windows-msvc' does not contain component 'clippy' for target 'x86_64-pc-windows-msvc'

rustup component add clippy-preview will work.

I've found the issue and am working on it!

Same for x86_64-unknown-linux-gnu

After the last comment just checked on WSL, and can confirm it's the same for stable-x86_64-unknown-linux-gnu as well (rustup 1.16.0)

EDIT: just updated to 1.16.0 on Win10 box as well, but still have the same issue

Same for clippy on x86_64-apple-darwin. rustfmt too.

~ $ rustup component add clippy
error: toolchain 'stable-x86_64-apple-darwin' does not contain component 'clippy' for target 'x86_64-apple-darwin'
~ $ rustup component add rustfmt
error: toolchain 'stable-x86_64-apple-darwin' does not contain component 'rustfmt' for target 'x86_64-apple-darwin'
~ $ rustup component list | grep -e clippy -e rustfmt
clippy-preview-x86_64-apple-darwin
rustfmt-preview-x86_64-apple-darwin
~ $ rustup show 
Default host: x86_64-apple-darwin

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.31.0 (abe02cefd 2018-12-04)

The solution is to completely wipe your toolchain and reinstall it.

@CryZe that's one heck of a solution, but I can confirm it worked for me on macOS Mojave. rustup self uninstall is the way to uninstall btw.

I solved this problem with following way.

  1. rustup self uninstall
  2. Download and install lastest rustup-init (rustup >= 1.16.0) in https://rustup.rs/

    • "Installing older rustup-init. And performing rustup self update" can't solve the problem. You must install lastest rustup-init at first time.

  3. Successfully rustup component add clippy and rustup component add rustfmt!

Thanks everyone for the workarounds! I'm going to go ahead and close this issue, as it's not directly in the power of Clippy to fix this. Although not ideal, the above workarounds should work if you're running into the problem :heart_decoration:

This bit me, and I suspect it could bite others too (I almost opened an issue). Maybe add a note to the readme around the install instructions?

I just had to do this (run rustup self uninstall and then reinstall) in order to be able to install clippy on stable, after being able to install it on nightly and attempting to fix it on stable by running rustup self update, which didn't work.

  • rustup self uninstall

Solved my problem on WSL

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthiaskrgr picture matthiaskrgr  Â·  3Comments

vitorenesduarte picture vitorenesduarte  Â·  3Comments

icefoxen picture icefoxen  Â·  3Comments

Luro02 picture Luro02  Â·  3Comments

jyn514 picture jyn514  Â·  3Comments