Rls: toolchain 'nightly-x86_64-unknown-linux-gnu' does not contain component 'rls-preview' for target 'x86_64-unknown-linux-gnu'

Created on 28 Oct 2017  Â·  40Comments  Â·  Source: rust-lang/rls

After updating to 1.23.0-nightly (d9f124965 2017-10-27) I am receiving the error below when attempting to install RLS on Linux (nightly-x86_64-unknown-linux-gnu) and Windows (nightly-x86_64-pc-windows-msvc).

$ 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'

Running 'rls' triggers this error:

$ rls

error: toolchain 'nightly-x86_64-unknown-linux-gnu' does not have the binary `rls`

A similar problem was reported last month under Issue 502, when the component was renamed from 'rls' to 'rls-preview'.

For me neither running 'rustup self update' nor uninstalling & reinstalling rustup resolved the issue.

Most helpful comment

@ivstas A sloppy script for this purpose:

#!/bin/bash

for i in `seq 0 99`; do
    echo " === === === "
    RUST_DATE=`date -u -d "-$i days" "+%Y-%m-%d"`
    echo "Checking $RUST_DATE..."
    TOML=`curl -sf https://static.rust-lang.org/dist/$RUST_DATE/channel-rust-nightly.toml`
    if [[ $? -gt 0 ]]; then
        echo "Rust $RUST_DATE does not exist"
    else
        if [[ -n `echo $TOML | grep rls` && -n `echo $TOML | grep fmt` ]]; then
            echo "Rust $RUST_DATE has both rls and rustfmt"
            echo "Run \"rustup default nightly-$RUST_DATE\" to install it"
            break
        fi
    fi
done

Output:

frederick@FredArch:~|⇒  ./find_rls_fmt.sh 
 === === === 
Checking 2017-12-27...
 === === === 
Checking 2017-12-26...
 === === === 
Checking 2017-12-25...
 === === === 
Checking 2017-12-24...
 === === === 
Checking 2017-12-23...
 === === === 
Checking 2017-12-22...
 === === === 
Checking 2017-12-21...
Rust 2017-12-21 has both rls and rustfmt
Run "rustup default nightly-2017-12-21" to install it

All 40 comments

Same problem on Windows 10 Pro:

# 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: checking for self-updates

   stable-x86_64-pc-windows-msvc unchanged - rustc 1.21.0 (3b72af97e 2017-10-09)
  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.23.0-nightly (d9f124965 2017-10-27)

# 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'

# rls
error: toolchain 'nightly-x86_64-pc-windows-msvc' does not have the binary `rls.exe`

Looks like all 3 major platforms, here's MacOS:

$ 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'

Also tried reinstalling rustup and all rust related things.

Ah, looks like a failed build on Appvayor and that a commit was just added to hopefully fix that.

The RLS is currently missing from the nightly channel because of build or testing issues. I recommend using the beta channel for now.

when can it fix?

You can also go back to nightly-2017-10-24 and things work fine there.

@wraithan Could you please explain how to downgrade nightly?
I was able to install the toolchain rustup toolchain install nightly-2017-10-24 and also set it as a default rustup default nightly-2017-10-24 but the problem still persits.

As a workaround for the Rust (rls) vscode plugin one can set the toolchain to stable or something else by adding this to the user settings: "rust-client.channel": "<channel-name, e.g. stable>".

@klingtnet Using rustup default nightly-2017-10-24 is how I would've downgraded, so you did the right thing.

Can you try 2017-10-22? i tried to downgrade to -24 on my test account, but this didn't work either.

My working RLS uses the following:

rustup 1.6.0 (a11c01e8c 2017-08-30)
cargo 0.23.0-nightly (e447ac7e9 2017-09-27)
rustc 1.22.0-nightly (8493813cd 2017-10-22)
Default host: x86_64-apple-darwin

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

stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin

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

nightly-x86_64-apple-darwin (directory override for '/Users/booyaa/Dev/rust/demo_time')
rustc 1.22.0-nightly (8493813cd 2017-10-22)

I'm going to do my own testing tomorrow...

after downgrade,use this command:

rustup component add rls-preview --toolchain nightly-2017-10-24

I've create a workaround issue in the rls-vscode repo to help people override the default channel toolchains: https://github.com/rust-lang-nursery/rls-vscode/issues/181

The RLS and rustfmt should be back in nightly once rust-lang/rust#45597 is merged.

Same for me in Ubuntu 16.0.4

the toolchains are updated
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.21.0 (3b72af97e 2017-10-09)
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.23.0-nightly (269cf5026 2017-10-28)

Updated to nightly-x86_64-unknown-linux-gnu - rustc 1.23.0-nightly (90ef3372e 2017-10-29), RLS is now available and working normally for me. Closing the issue.

Thanks, @DSpeckhals!

RLS is again not available in nightly-x86_64-pc-windows-gnu - rustc 1.23.0-nightly (d762b1d6c 2017-11-04).

Same here on x86_64-apple-darwin.

Same here.
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.23.0-nightly (d762b1d6c 2017-11-04)
rustsrv:~ # 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'

@jedisct1 @jotaerreah
rust-lang-nursery/rustup.rs#1277 proposes prompting users of rustup if the latest updates do not contain an installed component.

Same here

λ 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'

Works on latest rust toolchain:
nightly-x86_64-pc-windows-msvc updated - rustc 1.23.0-nightly (a35a3abcd 2017-11-10)

I'm having the same issue now. I'm unable to install the rls-preview component on both Linux (Antergos and Arch) and Windows. Even downgrading to an older verison, such as 2017-11-10 mentioned above does not fix it.

EDIT:
Nevermind, found out that I had to manually run "rustup default nightly-2017-12-01" to change the current active toolchain to the previous version. That's a workaround.
Still, "rls-preview" apprears to be missing for the current nightly.

@forbjok The 2017-12-01 nightly does not contain RLS or rustfmt. There is a fix in process that should resolve this for a future nightly. 2017-11-30 should have it, though.

2017-11-30 does not work for me, but 2017-11-29 does

Could this ticket be kept open until the root cause is found/fixed?

Same here:

~ > rustup update
info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: syncing channel updates for 'nightly-x86_64-apple-darwin'
info: checking for self-updates

  stable-x86_64-apple-darwin unchanged - rustc 1.22.1 (05e2e1c41 2017-11-22)
  nightly-x86_64-apple-darwin unchanged - rustc 1.24.0-nightly (1956d5535 2017-12-03)

~ > rls
error: toolchain 'nightly-x86_64-apple-darwin' does not have the binary `rls`
~ > 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'

Having the same issue. Had to roll back to 2017-11-29. Here's how I got it working:

rustup default nightly-2017-11-19
rustup component add rust-src --toolchain nightly-2017-11-29
rustup component add rust-analysis --toolchain nightly-2017-11-29
rustup component add rls-preview --toolchain nightly-2017-11-29

Can you please re-open this ticket as it is clearly not fixed or closed?

The reason that the RLS sometimes is not included with the nightly releases is because the RLS is distributed with and tightly linked to the compiler (rustc). The compiler has daily changes, some of which cause breaking changes in the RLS and Rust Format. Because compiler development should not be inhibited by its tools (rustfmt, rls, clippy), these tools can be marked as broken by compiler developers, which makes it not included with nightly releases. They are marked as broken: a) because tests are failing, or b) because the RLS wouldn't compile anyway.

The current reason is because there was a change with use statements, that caused rustfmt to break, which in turn caused the RLS to break. (https://github.com/rust-lang/rust/pull/45846)

There are efforts to improve this process (https://github.com/rust-lang/rust/issues/45861), but thankfully, broken tools are usually fixed quickly.

For now, as stated above, you can pin your nightly, or use the beta channel.

For anyone following this, rls is now back.

missing on msvc target in rustc 1.24.0-nightly (0077d128d 2017-12-14)

Not working yet

@DSpeckhals could you please suggest how to check which is the latest nighlty release that includes rls-preview component.

@ivstas A sloppy script for this purpose:

#!/bin/bash

for i in `seq 0 99`; do
    echo " === === === "
    RUST_DATE=`date -u -d "-$i days" "+%Y-%m-%d"`
    echo "Checking $RUST_DATE..."
    TOML=`curl -sf https://static.rust-lang.org/dist/$RUST_DATE/channel-rust-nightly.toml`
    if [[ $? -gt 0 ]]; then
        echo "Rust $RUST_DATE does not exist"
    else
        if [[ -n `echo $TOML | grep rls` && -n `echo $TOML | grep fmt` ]]; then
            echo "Rust $RUST_DATE has both rls and rustfmt"
            echo "Run \"rustup default nightly-$RUST_DATE\" to install it"
            break
        fi
    fi
done

Output:

frederick@FredArch:~|⇒  ./find_rls_fmt.sh 
 === === === 
Checking 2017-12-27...
 === === === 
Checking 2017-12-26...
 === === === 
Checking 2017-12-25...
 === === === 
Checking 2017-12-24...
 === === === 
Checking 2017-12-23...
 === === === 
Checking 2017-12-22...
 === === === 
Checking 2017-12-21...
Rust 2017-12-21 has both rls and rustfmt
Run "rustup default nightly-2017-12-21" to install it

@Frederick888 fixed it for mac, thanks for script

#!/bin/bash

for i in `seq 0 99`; do
    echo " === === === "
    if [[ $(uname) == "Darwin" ]]; then
    RUST_DATE=`date -v -${i}d "+%Y-%m-%d"`
    else
        RUST_DATE=`date -u -d "-$i days" "+%Y-%m-%d"`
    fi
    echo "Checking $RUST_DATE..."
    TOML=`curl -sf https://static.rust-lang.org/dist/$RUST_DATE/channel-rust-nightly.toml`
    if [[ $? -gt 0 ]]; then
        echo "Rust $RUST_DATE does not exist"
    else
        if [[ -n `echo $TOML | grep rls` && -n `echo $TOML | grep fmt` ]]; then
            echo "Rust $RUST_DATE has both rls and rustfmt"
            echo "Run \"rustup default nightly-$RUST_DATE\" to install it"
            break
        fi
    fi
done

latest is as of today nightly-2017-12-21

@Frederick888 Thanks! Would you like to add it in project's README? It would help more people in readme than in a closed issue.

is there an easy way to find out, on which nightly the rls (or rustfmt) last built successfully and are included?

Here's the best way yet to view the status of the RLS and other tools -- this was implemented by @kennytm not long ago, and it's official.

https://rust-lang-nursery.github.io/rust-toolstate/

I whipped up a quick copy of the above script for Powershell:

$daysOffset = 0
While ($daysOffset -gt -100) {
    Write-Host " === === === "
    $rustDate = (Get-Date).AddDays($daysOffset).ToString("yyyy-MM-dd")
    Write-Host "Checking $rustDate..."

    # Mimic `curl -s`
    $progressPreference = 'silentlyContinue'
    $response = Invoke-WebRequest "https://static.rust-lang.org/dist/$rustDate/channel-rust-nightly.toml"

    if($response.StatusCode -ne 200) {
        Write-Host "Rust $rustDate does not exist"
    }
    else {
        if((Select-String -Pattern "rls" -InputObject $response.RawContent) -and `
           (Select-String -Pattern "fmt" -InputObject $response.RawContent) ) {
           echo "Rust $rustDate has both rls and rustfmt"
           echo "Run ""rustup default nightly-$rustDate"" to install it"
           break;
        }
    }
    $daysOffset -= 1;
}

Latest update on this: https://internals.rust-lang.org/t/nightlies-missing-the-rls-will-no-longer-be-produced/6653/3
TLDR: there would be no nightly builds missing RLS.

Just use latest rustup version:

  1. rustup self update
  2. rustup update

I have the same problem:

$ rustup self update
info: checking for self-updates

$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2018-09-15, rust version 1.30.0-nightly (2ab3eba30 2018-09-14)
error: component 'rls-preview' for 'x86_64-unknown-linux-gnu' is unavailable for download
info: checking for self-updates

       stable-x86_64-unknown-linux-gnu unchanged - rustc 1.29.0 (aa3ca1994 2018-09-11)
  nightly-x86_64-unknown-linux-gnu update failed - rustc 1.29.0-nightly (6a1c0637c 2018-07-23)

$ rustup update nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2018-09-15, rust version 1.30.0-nightly (2ab3eba30 2018-09-14)
error: component 'rls-preview' for 'x86_64-unknown-linux-gnu' is unavailable for download

I have the same problem:

error: component 'rls-preview' for 'x86_64-unknown-linux-gnu' is unavailable for download

@elichai If I understood correctly, that is actually not the problem but a solution to it. Before, you would have gotten the current nightly for which the RLS did not compile. Now you just don't get that nightly, anymore. Every recent nightly that you get through rustup has a working RLS. Wait a day and it will be fixed (it is now, I think) or go back to an older nightly a few days back :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wagnerf42 picture wagnerf42  Â·  3Comments

paulirotta picture paulirotta  Â·  3Comments

parkovski picture parkovski  Â·  3Comments

dnsco picture dnsco  Â·  5Comments

PumpkinSeed picture PumpkinSeed  Â·  3Comments