Rustup: Rustup install in bad state

Created on 29 Oct 2018  Â·  8Comments  Â·  Source: rust-lang/rustup

Not exactly sure what happened, perhaps a broken automatic update? The compiler was working, and then I started getting errors about rustc not being found. When I tried to rustup, I get:

warning: during uninstall component rustc-x86_64-pc-windows-msvc was not found
info: removing component 'rust-std'
warning: during uninstall component rust-std-x86_64-pc-windows-msvc was not found
info: removing component 'cargo'
warning: during uninstall component cargo-x86_64-pc-windows-msvc was not found
info: removing component 'rust-docs'
warning: during uninstall component rust-docs-x86_64-pc-windows-msvc was not found
info: removing component 'rls-preview'
warning: during uninstall component rls-preview-x86_64-pc-windows-msvc was not found
info: removing component 'rust-src'
warning: during uninstall component rust-src was not found
info: removing component 'rust-analysis'
warning: during uninstall component rust-analysis-x86_64-pc-windows-msvc was not found
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: rolling back changes
error: failed to install component: 'cargo-x86_64-pc-windows-msvc', detected conflict: '"bin/cargo.exe"'
info: checking for self-updates

  nightly-x86_64-pc-windows-msvc update failed - (rustc does not exist)

Most helpful comment

rustup uninstall stable
rustup update stable

All 8 comments

Update: confirming that I had RLS set to auto-update tools via a workspace setting.

info: latest update on 2018-11-12, rust version 1.32.0-nightly (ca79ecd69 2018-11-11)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: downloading component 'llvm-tools-preview'
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: downloading component 'rls-preview'
info: downloading component 'rust-src'
info: downloading component 'rust-analysis'
info: downloading component 'rustfmt-preview'
info: removing component 'rustc'
info: removing component 'rust-std'
info: removing component 'cargo'
warning: during uninstall component cargo-x86_64-apple-darwin was not found
info: removing component 'rust-docs'
info: removing component 'llvm-tools-preview'
info: removing component 'rust-std' for 'wasm32-unknown-unknown'
info: removing component 'rls-preview'
info: removing component 'rust-src'
warning: during uninstall component rust-src was not found
info: removing component 'rust-analysis'
warning: during uninstall component rust-analysis-x86_64-apple-darwin was not found
info: removing component 'rustfmt-preview'
warning: during uninstall component rustfmt-preview-x86_64-apple-darwin was not found
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: rolling back changes
error: failed to install component: 'cargo-x86_64-apple-darwin', detected conflict: '"bin/cargo"'
info: checking for self-updates

nightly-x86_64-apple-darwin update failed - rustc 1.32.0-nightly (15d770400 2018-11-06)

was excited to try and rust 2018 edition but was faced by this same issue

rustup update stable                                                                            ✘ 130
info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: latest update on 2018-12-06, rust version 1.31.0 (abe02cefd 2018-12-04)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: downloading component 'clippy'
info: downloading component 'rustfmt'
info: downloading component 'rls'
info: downloading component 'rust-analysis'
info: downloading component 'rust-src'
info: removing component 'rustc'
warning: during uninstall component rustc was not found
info: removing component 'rust-std'
warning: during uninstall component rust-std was not found
info: removing component 'cargo'
warning: during uninstall component cargo was not found
info: removing component 'rust-docs'
warning: during uninstall component rust-docs was not found
info: removing component 'clippy'
warning: during uninstall component clippy was not found
info: removing component 'rustfmt'
warning: during uninstall component rustfmt was not found
info: removing component 'rls'
warning: during uninstall component rls was not found
info: removing component 'rust-analysis'
warning: during uninstall component rust-analysis was not found
info: removing component 'rust-src'
warning: during uninstall component rust-src was not found
info: installing component 'rustc'
info: rolling back changes
error: failed to install component: 'rustc-x86_64-apple-darwin', detected conflict: '"bin/rust-gdb"'

I tried blowing away ~/.cargo/bin/rust-gdb and ~/.cargo/bin/ and then tried reinstalling rustup

no dice. help?

without a better workaround I did a rustup self uninstall then tried reinstalling rustup and that seemed to do the trick. hope this helps someone else

The underlying issue here is that rustup update foo does not run a self update. There is a long-term fix here, but rustup does get into a weird state when it has a cache of the manifest using the old rustup.

An alternate workaround is to add the nightly toolchain, wait for the next nightly release and then run rustup update

unfortunately my motivation here was my excitement for a the stabilization announced here. I was actually kind of surprised when I ran into this. I update with every new release and have been using rust since before there was a stable :) this was honestly the first time I experienced any trouble updating. perhaps something related to the new edition was related.

rustup uninstall stable
rustup update stable

Since this transition is well past, I'm just going to close this.

Was this page helpful?
0 / 5 - 0 ratings