vscode-rust
vscode-rust copied to clipboard
can't start RLS with OS installed packages.
When I try to start the plugin (0.4.10) I get three notifications:
Couldn't start client Rust Language Server Rustup not available. Install from https://www.rustup.rs/ RLS could not set RUST_SRC_PATH for Racer because it could not read the Rust sysroot. Full log at https://pastebin.com/DNw60Q7w
rustc and rls are both installed from RPMs. OS is Fedora 28. I have also installed additional packages at the recommendation of some Fedora users on the Rust forums (rls-preview and rust-src)
[hbarta@redmaple ~]$ dnf list|egrep "rustc-|rls-|rust-src"
rls-preview.x86_64 0.130.0-2.fc28 @updates
rust-src.noarch 1.29.1-2.fc28 @updates
rust-rustc-demangle-devel.noarch 0.1.7-1.fc28 fedora
rust-rustc-serialize-devel.noarch 0.3.24-5.fc28 fedora
rust-rustc-test-devel.noarch 0.2.0-3.fc28 fedora
[hbarta@redmaple ~]$
Both rustc and rls are installed:
[hbarta@redmaple ~]$ which rls
/usr/bin/rls
[hbarta@redmaple ~]$ rls --version
rls-preview 0.130.0-stable ( )
[hbarta@redmaple ~]$ rustc --version
rustc 1.29.1
[hbarta@redmaple ~]$
I would much prefer to use packages provided by the Linux distro than have to use multiple commands to update my system. Is there something missing that the plugin needs (and hence the attempt to run rustup) or is rustup intrinsically required by the plugin?
Thanks!
Hi, I'm using VS Code on Windows 10 and I encounter similiar problem. The message is something like: rustup not installed, install from rustup.rs. But I can type rustup in command prompt and it writes "rustup 1.14.0 (a364ad985 2018-09-25)".
@isral try this:
Once you have rustup installed, run the following commands:
rustup component add rls-preview rust-analysis rust-src
@isral are you using WSL by any chance? The rustup command should be available in your default system shell (e.g. for WSL-installed Rustup you need wsl rustup), we warn against this in the 0.6 release.
If it's possible, I'd recommend using rustup to manage the toolchains and Rust components - it makes standard tooling a lot more robust and using it much easier. However, if you decide to use OS-shipped rls instead (without Rustup), you might want to set rust-client.rlsPath configuration to rls. This, however, needs to have Rust sysroot libraries in lib path. If these are not built and distributed statically by your packager you might need to create a wrapper script and do something like:
#!/bin/bash
export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
rls "$@"
and set the rlsPath to the location of such script.
Please let me know if that helps.
@isral are you using WSL by any chance?
No, I use the Windows version
Please let me know if that helps.
I already give up, so just ignore that. Maybe in the future I'll be back.
Can't believe this still isn't fixed.
Facing same issue on Fedora 33
Works for me on Fedora when I set "disable rustup" option in VSCode settings.