I'm trying to use the VS code rust plugin, it says RLS server can't be started. I dug around and found this in this repositories readme:
rustup component add rls rust-analysis rust-src
Which tells me:
error: toolchain 'stable-x86_64-pc-windows-msvc' does not contain component 'rls' for target 'x86_64-pc-windows-msvc'
I've followed this issue: https://github.com/rust-lang/rustup.rs/issues/1184
I did also have 2 rustc's installed because I previously used the installer. Resolved this issue by deinstalling one version and keeping the rustup version.
Then when running rustup update I noticed multiple components couldn't be found (including RLS).
C:\>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2019-01-09, rust version 1.33.0-nightly (d22fa2d87 2019-01-08)
info: downloading component 'rustc'
58.0 MiB / 58.0 MiB (100 %) 44.6 MiB/s ETA: 0 s
info: downloading component 'rust-std'
51.7 MiB / 51.7 MiB (100 %) 33.8 MiB/s ETA: 0 s
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: downloading component 'rust-analysis'
info: downloading component 'rls-preview'
info: removing component 'rustc'
info: removing component 'rust-std'
info: removing component 'cargo'
info: removing component 'rust-docs'
warning: during uninstall component rust-docs-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: removing component 'rls-preview'
warning: during uninstall component rls-preview-x86_64-pc-windows-msvc was not found
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: installing component 'rust-src'
info: installing component 'rust-analysis'
info: installing component 'rls-preview'
info: checking for self-updates
info: downloading self-update
stable-x86_64-pc-windows-msvc unchanged - rustc 1.31.1 (b6c32da9b 2018-12-18)
nightly-x86_64-pc-windows-msvc updated - rustc 1.33.0-nightly (d22fa2d87 2019-01-08)
These are the points of interest:
warning: during uninstall component rust-docs-x86_64-pc-windows-msvc was not found
warning: during uninstall component rust-analysis-x86_64-pc-windows-msvc was not found
warning: during uninstall component rls-preview-x86_64-pc-windows-msvc was not found
What am I doing wrong?
Is this the right repo for this issue?
I figured I'd try a clean install since I had previously used the installer (pre-rustup).
Uninstalled rust entirely:
C:\>rustup self uninstall
Thanks for hacking in Rust!
This will uninstall all Rust toolchains and data, and remove
%USERPROFILE%\.cargo/bin from your PATH environment variable.
Continue? (y/N) y
info: removing rustup home
info: removing cargo home
info: removing rustup binaries
info: rustup is uninstalled
C:\>where rustc
INFO: Could not find files for the given pattern(s).
C:\>where rustup
INFO: Could not find files for the given pattern(s).
Reinstalling rust (did not add rls):
Welcome to Rust!
This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.
It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:
C:\Users\f.stam\.cargo\bin
This path will then be added to your PATH environment variable by modifying the
HKEY_CURRENT_USER/Environment/PATH registry key.
You can uninstall at any time with rustup self uninstall and these changes will
be reverted.
Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable
modify PATH variable: yes
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2018-12-20, rust version 1.31.1 (b6c32da9b 2018-12-18)
info: downloading component 'rustc'
54.3 MiB / 54.3 MiB (100 %) 42.4 MiB/s ETA: 0 s
info: downloading component 'rust-std'
48.3 MiB / 48.3 MiB (100 %) 32.6 MiB/s ETA: 0 s
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: default toolchain set to 'stable'
stable installed - rustc 1.31.1 (b6c32da9b 2018-12-18)
Rust is installed now. Great!
To get started you need Cargo's bin directory (%USERPROFILE%\.cargo\bin) in
your PATH environment variable. Future applications will automatically have the
correct environment, but you may need to restart your current shell.
Press the Enter key to continue.
Adding RLS:
C:\>rustup component add rls rust-analysis rust-src
info: downloading component 'rls'
info: installing component 'rls'
info: downloading component 'rust-analysis'
info: installing component 'rust-analysis'
info: downloading component 'rust-src'
info: installing component 'rust-src'
Victory!
The issue is resolved for me, I'll leave this open so that somebody can decide if any actions should be taken.
I'd guess rustup got into a dodgy state, maybe a failed component install? I'd ask at rust-lang/rustup.rs if you wanted to investigate further.
I don't think it's worth anybody's time to investigate unless this happens a lot, in that case they already know about it.
I was surprised the installer didn't install this and assumed it was supposed to but gauging your reaction I was mistaken.
Most helpful comment
I figured I'd try a clean install since I had previously used the installer (pre-rustup).
Uninstalled rust entirely:
Reinstalling rust (did not add rls):
Adding RLS:
Victory!
The issue is resolved for me, I'll leave this open so that somebody can decide if any actions should be taken.