[SOLVED] Eclipse stopped building my project


#1

I don’t know if this problem is due to rustc, Eclipse, RustDT, or me. It started after a major edit of the way I use error_chain.

My program builds correctly from the console with “cargo build” and in VSCode. It does not in Eclipse Version: Neon.3 Release (4.6.3) Build id: 20170314-1500 with rustc 1.15.1 (021bd294c 2017-02-08). I get “compiler produced invalid json” for a “variant is never used” warning. The program builds correctly if I remove the block in the errors { } section of error_chain! even though there’s another unused variant. It turns out that the error only occurs if there are two unused variants in the errors { } section.

It’s not an urgent problem, since I can just comment out the offending block.


#2

That sounds like a communication problem between rustc and the eclipse plugin.
Rustc emits, on request, all errors as json, instead of pretty-printing on the command line, for exactly this “integrate into IDE” scenario.

Considering the high rate of turnover in both rust compilers (we’re at 1.20 now) and the desktop plugins, would you mind trying with a newer compiler? Maybe also check for updates to the eclipse plugin?

I can imagine that an (unintentional) format-change in the emitted json happened, that the eclipse plugin relies on.

It would still be a bug in both rust and eclipse, considering Rust’s stability guarantees, but that would at least narrow down the possibilities.


#3

I run rustup on a regular basis, and everything looked fine. The only problem was that I had a set of Rust binaries in /usr/local/bin from an installation before I heard of rustup. So, even though rustup said I was up to date, I was using an old version of all the executables when running from the console but not from Eclipse. My conclusion is that the bug did not appear in rustc 1.15.1, but it did in the version Eclipse was pointing to. After a rustup update both Eclipse and my console are now using rustc 1.20.0 (f3d6973f4 2017-08-27).

Since I can’t reproduce the problem with rustc 1.20.0 , we can attribute the issue to the fourth option in my list of causes of the problem, namely me.


#4

Or… To the fact that eclipse stopped handling the “old” error output!

Every change, breaks somebodies workflow, today was your unlucky day. Glad that you figured it out!


#5

It’s BAAAACK. After a rustup update to rustc 1.21.0 (3b72af97e 2017-10-09), Eclipse no longer compiles my project, terminating with

compiler produced invalid json: `{"message":"doc comment not used by rustdoc"

Since that message is one I don’t recall seeing, I suspect it is the cause of the problem. I checked for Eclipse and RustDT updates but didn’t see anything that looked relevant.

To the best of my knowledge, I’m not using rustdoc (although I probably should be). A comment by Steve Klabnik indicates that the message is coming from error_chain, which I use extensively. There’s a note that the problem was fixed on August 1 in an unreleased version of error_chain. I’ll take that or a way to turn off rustdoc errors and warnings.


#6

Are you aware that RustDT is no longer (as of July) being developed? The author writes about his decision to stop here: http://pureconcepture.blogspot.co.uk/2017/07/goodbye-to-eclipse-end-of-era-for.html

Eclipse/RustDT was my preferred IDE, but once he dropped support I switched to IntelliJ and have been happy there too. There’s an actual paid team of developers working on the IntelliJ plugin too, which is great.


#7

I did not know that about RustDT. The IntelliJ page for Rust, https://intellij-rust.github.io/, says that it’s in Alpha and that I should expect bugs. Is that statement overly pessimistic, or am I looking in the wrong place?

I have also been using VSCode, but I can’t get it to highlight syntax errors as I type or show syntax errors in the source code when I compile. On the other hand, I haven’t been able to get Eclipse to stop at breakpoints. In both cases, I’m sure it’s configuration errors. My strategy to date has been to edit, compile, and run in Eclipse and debug in VSCode. With the latest Eclipse problem, I now compile in a terminal window. I guess you could call that a tool chain :slight_smile:


#8

For a basic setup of VSCode for Rust and RLS (syntax checking while editing) you can go here (Please note that this is in not complete yet). Maybe this could help you to set up Visual Studio Code which seems to be the best right now (until IntelliJ Rust is out of Alpha).

EDIT: If you are not happy with Alpha software, do not use RLS but LEGACY in VS Code. This will force it to use Cargo check instead (which should be stable)


#9

Yeah, I’d say don’t be put off by the “Alpha” warning. I think I’ve actually experienced fewer (IDE) bugs with the IntelliJ plugin than I did with Eclipse, so definitely give it a try.


#10

Thanks for that info. I already started moving to IntelliJ, but I’ve got two problems. I can’t set breakpoints, and IntelliJ doesn’t play well with error_chain.