Unable to create or debug project in Eclipse with Rust 2018 1.31.0 - rls - Windows


#1

I didn’t have Eclipse for rust installed before, but I like it as an IDE, so I’ve tried installing together with Rust 2018 1.31.0.

When I tried to create a new Rust project, I got the Eclipse error message “Requirement for Rust edition were not found”.

image

Upon opening the preferences, Eclipse prompted me to install RLS.

Screenshot

Interestingly enough, the RLS component coudn’t even be accessed through command-line (despite being in the $PATH): instead it gave me the error message “error: 'rls.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc’”

Screenshot

I tried a lot of different ways, but finally, I chose to uninstall Eclipse and rust completely, then reinstall rust from scratch:

cargo show and other proofs for correct installation
fredrik@By-Tor ~/rust/my-sample-project
$ rustup show
Default host: x86_64-pc-windows-msvc

stable-x86_64-pc-windows-msvc (default)
rustc 1.31.0 (abe02cefd 2018-12-04)

fredrik@By-Tor ~/rust/my-sample-project
$ cargo clean

fredrik@By-Tor ~/rust/my-sample-project
$ cargo --version
cargo 1.31.0 (339d9f9c8 2018-11-16)

fredrik@By-Tor ~/rust/my-sample-project
$ rustc --version
rustc 1.31.0 (abe02cefd 2018-12-04)

fredrik@By-Tor ~/rust/my-sample-project
$ rustup --version
rustup 1.16.0 (beab5ac2b 2018-12-06)

fredrik@By-Tor ~/rust/my-sample-project
$ cargo run
   Compiling my-sample-project v0.1.0 (C:\cygwin64\home\fredrik\rust\my-sample-project)
    Finished dev [unoptimized + debuginfo] target(s) in 0.57s
     Running `target\debug\my-sample-project.exe`
Hello, world!

fredrik@By-Tor ~/rust/my-sample-project
$

Then, I installed Eclipse using the Eclipse installer, using the defaults. Naturally, creating a rust project still failed, since it defaults to Eclipse 2018-09. With Eclipse 2018-12 installed, creating a rust project also failed, which surprised me.

Checking the command-prompt, rls had the same issues as before:

fredrik@By-Tor ~/rust/my-sample-project
$ which rls
/cygdrive/c/Users/fredr/.cargo/bin/rls

fredrik@By-Tor ~/rust/my-sample-project
$ rls
error: 'rls.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc'

fredrik@By-Tor ~/rust/my-sample-project
$

Interestingly enough, after installing RLS again, actually worked properly, which I didn’t expect, since I had so many issues before!

fredrik@By-Tor ~/rust/my-sample-project
$ rustup component add rls
info: downloading component 'rls'
info: installing component 'rls'

fredrik@By-Tor ~/rust/my-sample-project
$ rls --version
rls-preview 1.31.6 (6610526 2018-12-01)

fredrik@By-Tor ~/rust/my-sample-project
$

So, finally, I got rls properly running, and this time, launching Eclipse 2018-12, it started properly and I could create a 2018 edition Hello, world project, with a correct set of preferences!

However, I couldn’t get Eclipse to actually run or debug the project! It did invoke cargo and rebuilds when I choose Debug As -> Rust project, but I got no output indicating debug has started:

Compiling new_rust_project v0.1.0 (C:\cygwin64\home\fredrik\rust\new_rust_project)
  Finished dev [unoptimized + debuginfo] target(s) in 0.83s

Trying to Run As->Cargo Based Rust Project gave no result in Eclipse at all. And the entire Project menu was grayed out.

Screenshot

image

Installing the very latest Eclipse, Version: 2018-12 M3 (4.10.0M3) Build id: 20181129-1705 doesn’t help much either. The Project menu is still grayed out. However, this time, it is possible to run the project!?

   Compiling new_rust_project v0.1.0 (C:\cygwin64\home\fredrik\rust\new_rust_project)
    Finished dev [unoptimized + debuginfo] target(s) in 0.65s
     Running `target\debug\new_rust_project.exe`
Hello, world!!

Debugging, on the other hand, still doesn’t work. GDB is installed, but rust-gdb gives the same error error as before for rls: 'rust-gdb.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc'

gdb and rust-gdb version indications
fredrik@By-Tor ~/rust/my-sample-project
$ which gdb
/usr/bin/gdb

fredrik@By-Tor ~/rust/my-sample-project
$ gdb
GNU gdb (GDB) (Cygwin 8.0.1-1) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) quit

fredrik@By-Tor ~/rust/my-sample-project
$ which rust-gdb
/cygdrive/c/Users/fredr/.cargo/bin/rust-gdb

fredrik@By-Tor ~/rust/my-sample-project
$ rust-gdb
error: 'rust-gdb.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc'

fredrik@By-Tor ~/rust/my-sample-project
$ rustup component list | grep gdb

fredrik@By-Tor ~/rust/my-sample-project

Any suggestions?