Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Could not install RLS component (rls-preview) #363

Closed
jdferreira opened this issue Oct 6, 2017 · 34 comments
Closed

Could not install RLS component (rls-preview) #363

jdferreira opened this issue Oct 6, 2017 · 34 comments

Comments

@jdferreira
Copy link

jdferreira commented Oct 6, 2017

Version of VSCode: 1.17.0
Version of the extension: 0.3.1
OS: Ubuntu 16.04

Description:
I cannot start the RLS. I get the following error when I start vscode (or when I reload the window):

  • RLS not installed. Install?

When I clicked Yes, I got:

  • Couldn't start client Rust Language Server
  • Could not install RLS component (rls-preview)

I reinstalled the extension, but the problem persists.
I see in the Changelog that there was a change on how RLS detection is performed. Could this be related?

Output of the "Rust logging" channel (the selection box shows "Rust Language Server" and not "Rust logging", but I guess that's what you mean?):

[Error - 2:25:52 PM] Starting client failed
@jdferreira
Copy link
Author

Just a quick note to say that the same thing happens with Windows.

@jdferreira
Copy link
Author

Never mind; all I had to do was update rust nightly and install the (new?) rls-preview component.
I'm closing the issue.

Thanks.

@Yanpas
Copy link

Yanpas commented Nov 6, 2017

Facing the same issue, cannot install rls-preivew:

error: could not find rls-preview in registry https://github.com/rust-lang/crates.io-index

@AndreasHassing
Copy link

@Yanpas
Copy link

Yanpas commented Nov 6, 2017

What a mess. Why is extension depends on buggy nightly toolchain, what's the problem with using stable by default? I will be okay with using outdated but at least working copy of rls.

Now it prints 'rls is not found'. Total voodoo magic

According to readme we should switch to https://github.com/rust-lang-nursery/rls-vscode which surprise doesn't work too.

PS Nothing personal, I'm just raged with losing 2 hours on toolchain setup.

@AndreasHassing
Copy link

@Yanpas I feel your pain 😄. Also currently working on getting the toolchain to work, and I thought I would drop in and guide you to what I've learned so far 😃.

@Yanpas
Copy link

Yanpas commented Nov 9, 2017

I've ran rustup component add rls-preview --toolchain nightly and it seems to work

@jtremback
Copy link

Getting

$ rustup component add rls-preview --toolchain nightly
error: toolchain 'nightly-x86_64-apple-darwin' does not contain component 'rls-preview' for target 'x86_64-apple-darwin'

@Cristian-Malinescu
Copy link

Also getting
$ rustup component add rls-preview --toolchain nightly error: toolchain 'nightly-x86_64-unknown-linux-gnu' does not contain component 'rls-preview' for target 'x86_64-unknown-linux-gnu'

@Barsonax
Copy link

Barsonax commented Dec 3, 2017

Doesnt work on windows either:
$ rustup component add rls-preview --toolchain nightly error: toolchain 'nightly-x86_64-pc-windows-msvc' does not contain component 'rls-preview' for target 'x86_64-pc-windows-msvc'

Why doesnt it use stable?

@silverbucket
Copy link

Same problem here.

@paulevans
Copy link

Found my way here after uninstalling from brew and reinstalling via rustup to see if I could get this this working. No dice.
How do you re-open an issue?

@paulevans
Copy link

See that #369
and #370
are related to this. Also about three weeks old at this point.

@paulevans
Copy link

Okay this plug-in is pretty cool about configuration.
Add this to your user settings and pull from beta rather than nightly

    // Rust channel to install RLS from.
    "rust-client.channel": "beta"

so your entire settings might look something like

// Place your settings in this file to overwrite the default settings
{
    "workbench.colorTheme": "Visual Studio Dark",
    "window.zoomLevel": 1,

    // Rust channel to install RLS from.
    "rust-client.channel": "beta"
}

... if you've not configured code much yet.

@thedodd
Copy link

thedodd commented Dec 27, 2017

All, as of today (2017.12.27), this is how I resolved the issue:

# Ensure the rustup component for rls-preview is added.
# I also added the `rust-analysis` & `rustfmt-preview` components; it is possible that
# if those are missing, the vscode plugin may still fail, not 100% sure on that.
rustup update
rustup component add rls-preview 

Lastly, ensure your Rust channel config points to stable in your vscode user settings.

...
"rust-client.channel": "stable"

@ishehadeh
Copy link

Thanks! that worked for me :D

@Korvox
Copy link

Korvox commented Dec 28, 2017

Alright, so beta and stable are working, but rls-preview / rls don't exist as components on nightly anymore and the beta / stable channels of rls immediately error out on code containing #![feature] gates.

Is there a way to get a working rls component for nightly? Can you build it yourself so the vscode-rust plugin picks it up and uses it? I tried rls-git in the AUR (which is a part of the meta Rust package) but it has issues with the latest glibc.

Update: The 12-30 nightly has rls-preview, so if anyone else runs into the problem of most nightlies not including the rls component anymore you can grab 12-30 for now!

@tobz1000
Copy link

Having this problem - again - since updating to 1.25.0-nightly (last time was about a month ago, as others have experienced).

What is the fundamental reason for RLS being unavailable in time for each release of nightly rustc?

@fuszenecker
Copy link

Hi,

Same for me:

fuszenecker@linux:~$ rustup update
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: checking for self-updates

  nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.25.0-nightly (da569fa9d 2018-01-16)

fuszenecker@linux:~$ rustup component add rls-preview
error: toolchain 'nightly-x86_64-unknown-linux-gnu' does not contain component 'rls-preview' for target 'x86_64-unknown-linux-gnu'
fuszenecker@linux:~$ 

@paulevans
Copy link

I suppose an adjacent question is - it is appropriate to have the rust language service being sourced from nightly by default for your tooling?
I'm still pretty new to the Rust community so I don't know how unusual I am to keep in step with the releases rather than nightly.
It seems to me that most of the time something more stable than nightly would cover everything you could expect from a Visual Code plugin.

@AndrewSav
Copy link

AndrewSav commented Jan 18, 2018

it is appropriate to have the rust language service being sourced from nightly by default for your tooling?

It seems that it's the only way to make it work - does not work otherwise.

@esjeon
Copy link

esjeon commented Jan 19, 2018

This isn't difficult to solve, but is fairly confusing for first timers. It would be better if a link to workaround is included in the error message. Some other extensions do that.

So, the only and simple solution is to use older toolchain builds. No worries, rustup supports this:

rustup toolchain install nightly-2018-01-13
rustup default nightly-2018-01-13

The build status of rls can be found here. The page currently says the build have failed since 14 Jan, so 2018-01-13 will work.

There also is a script that automatically finds the latest build which includes RLS, and this one can find the exact version with the latest RLS, which currently is 2018-01-14.

... and I almost forgot this. You'll want to include following lines in your VSCode setting:

"rust-client.channel": "nightly-2018-01-13"

This alone will fix the problem, but downloading toolchain takes time, so you'll have to wait indefinitely until the job finishes. (I mean, I have a slow internet.)

@paulevans
Copy link

paulevans commented Jan 19, 2018 via email

@Barsonax
Copy link

I agree with this why RLS 'needs' nightly and just does not work with stable is beyond my comprehension. Very confusing and annoying.

@AndrewSav
Copy link

Probably someone wants to file a new issue, as I'm not sure if closed issues get attention.
In my mind getting the stable work without workarounds is a worthy cause. Most language plugins manage that, so why not rust?

@paulevans
Copy link

paulevans commented Jan 19, 2018 via email

@paulevans
Copy link

Okay I gave it a go, but I could not get it to compile as-is. Not worked on a VS Code extension before and I'm afraid I'm out of time. There were many warnings from the TypeScript that were being treated as errors.
Seems like we could just change the default in the package though? It's null currently, which defaults to nightly everything.
#373

@jolisper
Copy link

I just set "rust-client.channel": "stable" on my vscode config and it's working ok.

@jazzay
Copy link

jazzay commented Jan 26, 2018

So perhaps part of the confusion is around which VSCode Rust plugin to install (or both). I see Rust 0.4.2 and Rust (rls) 0.3.2 available. The comments above talk about "rust-client.channel" setting but that is only available if you install the latter plugin (rls). If you install the first plugin you get the error dialogs in vscode. This git project also seems to be matched against the first plugin. If I only install that I cannot edit this "rust-client.channel" property as it does not exist.

So again I think maybe there is confusion around which plugins are relevant here. Do I need to install both?

@jazzay
Copy link

jazzay commented Jan 26, 2018

@jolisper did you install the first plugin? which ones did you install? See above.

@jnm2
Copy link

jnm2 commented Feb 2, 2018

This is what worked for me today: rustup component add rls-preview --toolchain nightly.

@siman
Copy link

siman commented Jan 22, 2019

The solution (nightly 2019-01-15 includes RLS):

rustup toolchain install nightly-2019-01-15
rustup default nightly-2019-01-15
rustup component add rls-preview rust-analysis rust-src --toolchain nightly-2019-01-15

@paulevans
Copy link

paulevans commented Jan 22, 2019 via email

@gulshan
Copy link

gulshan commented Mar 31, 2019

Rust newbie here. One of my project dependencies requires nightly. Now I could not manage to use RLS with it. If rls-preview were available in the nightly toolchain, I think it would solve the problem. Can this be solved with some configuration, so that stable rls is used with other nightly components?

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

No branches or pull requests