This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Eclipse Scala project suddenly fails to compile

13 replies
Lachlan Cotter
Joined: 2009-11-01,
User offline. Last seen 42 years 45 weeks ago.
Hi all,



I have a Scala project in Eclipse that I've been working with for some time without issues.
Yesterday however, something apparently changed, and Eclipse now fails to compile any of my Scala classes. 
It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual.
Tested it out with a completely fresh project which also failed to compile.
I re-installed the Scala plug-in and got managed to compile "Hello World", but my original project is still refusing to build.
Presumably something in the project config is corrupt, but I've no idea what to look for.

Anyone encountered this phenomenon before?




Many thanks,Lach
Andreas W
Joined: 2009-01-10,
User offline. Last seen 1 year 14 weeks ago.
Re: Eclipse Scala project suddenly fails to compile

> It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the
> Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual.
> Anyone encountered this phenomenon before?
Yes, I encounter that occasionally. If yours is the same problem, you will find that under the error log it says "Build compiler crashed." The only way out I found was to back out carefully from what I was doing until it stops crashing and then narrow down the specific construct the compiler doesn't like. It tends to be something really esoteric and fairly easy to work around. Tracking it down and encircling it is time-consuming, but thankfully it does not happen often. This is 2.7.7, I cannot speak for 2.8 yet.

I don't think it's the plugin, I think it is the compiler. I never had the stomach (or time) to try to isolate it into a test case, but that would of course be the right thing to do.

Andreas

From: Lachlan Cotter <lach@lachlanc.id.au>
To: scala-tools@listes.epfl.ch
Sent: Sun, February 7, 2010 9:21:50 PM
Subject: [scala-tools] Eclipse Scala project suddenly fails to compile

Hi all,



I have a Scala project in Eclipse that I've been working with for some time without issues.
Yesterday however, something apparently changed, and Eclipse now fails to compile any of my Scala classes. 
It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual.
Tested it out with a completely fresh project which also failed to compile.
I re-installed the Scala plug-in and got managed to compile "Hello World", but my original project is still refusing to build.
Presumably something in the project config is corrupt, but I've no idea what to look for.

Anyone encountered this phenomenon before?




Many thanks,Lach
Lachlan Cotter
Joined: 2009-11-01,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse Scala project suddenly fails to compile

Thanks very much for the helpful and speedy reply, Andreas. This looks encouraging. Just before this issue cropped up, I had indeed made use of a somewhat esoteric construct: applying a package-scope qualifier to a protected member function. Hopefully that will turn out to be the cause of the grief.
I'll report back.

Best,Lach

On 08/02/2010, at 2:18 PM, Windemuth Andreas wrote:

> It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the 
> Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual.
> Anyone encountered this phenomenon before?
Yes, I encounter that occasionally. If yours is the same problem, you will find that under the error log it says "Build compiler crashed." The only way out I found was to back out carefully from what I was doing until it stops crashing and then narrow down the specific construct the compiler doesn't like. It tends to be something really esoteric and fairly easy to work around. Tracking it down and encircling it is time-consuming, but thankfully it does not happen often. This is 2.7.7, I cannot speak for 2.8 yet.

I don't think it's the plugin, I think it is the compiler. I never had the stomach (or time) to try to isolate it into a test case, but that would of course be the right thing to do.

Andreas

From: Lachlan Cotter <lach@lachlanc.id.au>
To: scala-tools@listes.epfl.ch
Sent: Sun, February 7, 2010 9:21:50 PM
Subject: [scala-tools] Eclipse Scala project suddenly fails to compile

Hi all,



I have a Scala project in Eclipse that I've been working with for some time without issues.
Yesterday however, something apparently changed, and Eclipse now fails to compile any of my Scala classes. 
It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual.
Tested it out with a completely fresh project which also failed to compile.
I re-installed the Scala plug-in and got managed to compile "Hello World", but my original project is still refusing to build.
Presumably something in the project config is corrupt, but I've no idea what to look for.

Anyone encountered this phenomenon before?




Many thanks,Lach


Andreas W
Joined: 2009-01-10,
User offline. Last seen 1 year 14 weeks ago.
Re: Eclipse Scala project suddenly fails to compile

Just in case Miles is listening, and this has not been addressed yet in 2.8, it would be really nice if build compiler crashes would be reported by the plugin less timidly. A similarly annoying but not critical problem is that the plugin will (sometimes, for me, at least) happily "Run" while there are still compile errors. Actually, it will run older code in that case, which causes confusion and has led me to always check the "Problems" list before trusting the "Run" command. Between checking the error log for compiler crashes and the problems list for compile errors the zippiness of interactive development suffers somewhat. Lastly, when there are errors in a project, downstream dependent projects and even downstream classes in the same project tend to report lots of secondary problems. This takes time, obscures the primary errors, and requires frequent rebuilds. On rare occasions it even freezes eclipse. It would be great if the compiler could somehow stop trying to make sense out of code that is depending on other code that already failed to compile, and only report the primary problems. For example, it could skip further parsing of source files found to have unresolved imports. Note: I love scala and the plugin and grouse only with extreme reluctance.

Andreas


From: Lachlan Cotter <lach@lachlanc.id.au>
To: Windemuth Andreas <windemut@yahoo.com>
Cc: scala-tools@listes.epfl.ch
Sent: Sun, February 7, 2010 10:37:46 PM
Subject: Re: [scala-tools] Eclipse Scala project suddenly fails to compile


Thanks very much for the helpful and speedy reply, Andreas. This looks encouraging. Just before this issue cropped up, I had indeed made use of a somewhat esoteric construct: applying a package-scope qualifier to a protected member function. Hopefully that will turn out to be the cause of the grief.
I'll report back.

Best,Lach

On 08/02/2010, at 2:18 PM, Windemuth Andreas wrote:

> It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the 
> Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual.
> Anyone encountered this phenomenon before?
Yes, I encounter that occasionally. If yours is the same problem, you will find that under the error log it says "Build compiler crashed." The only way out I found was to back out carefully from what I was doing until it stops crashing and then narrow down the specific construct the compiler doesn't like. It tends to be something really esoteric and fairly easy to work around. Tracking it down and encircling it is time-consuming, but thankfully it does not happen often. This is 2.7.7, I cannot speak for 2.8 yet.

I don't think it's the plugin, I think it is the compiler. I never had the stomach (or time) to try to isolate it into a test case, but that would of course be the right thing to do.

Andreas

From: Lachlan Cotter <lach [at] lachlanc [dot] id [dot] au" target="_blank" href="mailto:lach@lachlanc.id.au" rel="nofollow">lach@lachlanc.id.au>
To: scala-tools [at] listes [dot] epfl [dot] ch" target="_blank" href="mailto:scala-tools@listes.epfl.ch" rel="nofollow">scala-tools@listes.epfl.ch
Sent: Sun, February 7, 2010 9:21:50 PM
Subject: [scala-tools] Eclipse Scala project suddenly fails to compile

Hi all,



I have a Scala project in Eclipse that I've been working with for some time without issues.
Yesterday however, something apparently changed, and Eclipse now fails to compile any of my Scala classes. 
It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual.
Tested it out with a completely fresh project which also failed to compile.
I re-installed the Scala plug-in and got managed to compile "Hello World", but my original project is still refusing to build.
Presumably something in the project config is corrupt, but I've no idea what to look for.

Anyone encountered this phenomenon before?




Many thanks,Lach



ijuma
Joined: 2008-08-20,
User offline. Last seen 22 weeks 2 days ago.
Re: Eclipse Scala project suddenly fails to compile

On Mon, Feb 8, 2010 at 5:02 PM, Windemuth Andreas wrote:
> Just in case Miles is listening, and this has not been addressed yet in 2.8

As Miles will probably say soon, the plugin in 2.8 is a completely
different thing and reports about 2.7.x are not that useful. Not that
2.8 doesn't have issues, they just tend to be different ones.

Best,
Ismael

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Eclipse Scala project suddenly fails to compile

On Mon, Feb 8, 2010 at 5:02 PM, Windemuth Andreas wrote:
> Just in case Miles is listening, and this has not been addressed yet in 2.8,
> it would be really nice if build compiler crashes would be reported by the
> plugin less timidly.

Good suggestion ... would be very helpful if you'd create an
enhancement ticket for it in Trac.

Cheers,

Miles

Lachlan Cotter
Joined: 2009-11-01,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse Scala project suddenly fails to compile
Thanks a million, Andreas.
This was indeed the issue. I removed the suspect construct from the code and everything went back to normal. Fortunately, using TTD causes one to compile frequently.
You saved me a lot of pain there.

Cheers,Lach


On 08/02/2010, at 2:18 PM, Windemuth Andreas wrote:

> It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the 
> Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual.
> Anyone encountered this phenomenon before?
Yes, I encounter that occasionally. If yours is the same problem, you will find that under the error log it says "Build compiler crashed." The only way out I found was to back out carefully from what I was doing until it stops crashing and then narrow down the specific construct the compiler doesn't like. It tends to be something really esoteric and fairly easy to work around. Tracking it down and encircling it is time-consuming, but thankfully it does not happen often. This is 2.7.7, I cannot speak for 2.8 yet.

I don't think it's the plugin, I think it is the compiler. I never had the stomach (or time) to try to isolate it into a test case, but that would of course be the right thing to do.

Andreas
milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Eclipse Scala project suddenly fails to compile

On Mon, Feb 8, 2010 at 10:25 PM, Lachlan Cotter wrote:
> This was indeed the issue. I removed the suspect construct from the code and
> everything went back to normal. Fortunately, using TTD causes one to compile
> frequently.

So what was the offending code? Have created a ticket for it in Trac?

Cheers,

Miles

Andreas W
Joined: 2009-01-10,
User offline. Last seen 1 year 14 weeks ago.
Re: Eclipse Scala project suddenly fails to compile

I take it from this that this is still relevant for 2.8, and will see if I can figure out how to create a ticket. (There, that's what you get for whining...)

Andreas

Lachlan Cotter
Joined: 2009-11-01,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse Scala project suddenly fails to compile
Hi Miles,


Apparently the crash was caused by trying to add a package-scope qualifier to a protected member function. Like so:
protected[package] def foo = bar
I have not yet opened a ticket in Trac — just checking out how to do that. Not sure how reproducible this is at the moment. That is to say, it's reproducible in my project, but I have not yet tried to isolate it further.


Best,Lach



On 09/02/2010, at 9:35 AM, Miles Sabin wrote:
On Mon, Feb 8, 2010 at 10:25 PM, Lachlan Cotter <lach@lachlanc.id.au> wrote:
This was indeed the issue. I removed the suspect construct from the code and
everything went back to normal. Fortunately, using TTD causes one to compile
frequently.

So what was the offending code? Have created a ticket for it in Trac?

Cheers,


Miles

--
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://www.chuusai.com/
http://twitter.com/milessabin

exmbly
Joined: 2010-03-03,
User offline. Last seen 2 years 31 weeks ago.
Re: Eclipse Scala project suddenly fails to compile
I installed the latest Scala IDE for Eclipse but it keeps displaying compiler errors on class files in the Editor (not in the Project Explorer, however). I tried the "Troubleshooting" section at http://www.scala-lang.org/node/94, but that did not help. In fact, the Weaver was enabled all along. I tried disabling and then enabling it, but again, to no avail. Those pesky compiler errors keep showing up. By the way, I tried both plugins (uninstalling one before installing the other): http://www.scala-lang.org/scala-eclipse-plugin http://www.scala-lang.org/scala-eclipse-plugin-nightly No go. Neither works. If it helps, I'm using the latest build of Eclipse - Galileo. Glenn
Lachlan Cotter wrote: Hi all, I have a Scala project in Eclipse that I've been working with for some time without issues. Yesterday however, something apparently changed, and Eclipse now fails to compile any of my Scala classes. It acts like it's compiling, and produces no build errors, but when the 'build' is complete none of the Scala classes have made it into the bin directory. Java classes seem to be compiling as per usual. Tested it out with a completely fresh project which also failed to compile. I re-installed the Scala plug-in and got managed to compile "Hello World", but my original project is still refusing to build. Presumably something in the project config is corrupt, but I've no idea what to look for. Anyone encountered this phenomenon before? Many thanks, Lach

View this message in context: Re: [scala-tools] Eclipse Scala project suddenly fails to compile
Sent from the Scala - Tools mailing list archive at Nabble.com.
milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Eclipse Scala project suddenly fails to compile

On Wed, Mar 3, 2010 at 9:31 PM, exmbly wrote:
> I installed the latest Scala IDE for Eclipse but it keeps displaying
> compiler errors on class files in the Editor (not in the Project Explorer,
> however).

If you have a reproducible example, please create a ticket in Trac
with it attached.

Cheers,

Miles

exmbly
Joined: 2010-03-03,
User offline. Last seen 2 years 31 weeks ago.
Re: Eclipse Scala project suddenly fails to compile

It seems the problem I was having disappears as long as I don't install the
Weaver plugin along with the Scala IDE for Eclipse. I haven't done any
further investigation, but perhaps this plugin conflicts with another weaver
already in Eclipse.

Maybe some note about this should be included in the install documentation.

Glenn

exmbly wrote:
>
> I installed the latest Scala IDE for Eclipse but it keeps displaying
> compiler errors on class files in the Editor (not in the Project Explorer,
> however). I tried the "Troubleshooting" section at
> http://www.scala-lang.org/node/94, but that did not help. In fact, the
> Weaver was enabled all along. I tried disabling and then enabling it, but
> again, to no avail. Those pesky compiler errors keep showing up.
>
> By the way, I tried both plugins (uninstalling one before installing the
> other):
> http://www.scala-lang.org/scala-eclipse-plugin
> http://www.scala-lang.org/scala-eclipse-plugin-nightly
>
> No go. Neither works. If it helps, I'm using the latest build of Eclipse -
> Galileo.
>
> Glenn
>
>
>
> Lachlan Cotter wrote:
>>
>> Hi all,
>>
>>
>>
>>
>> I have a Scala project in Eclipse that I've been working with for some
>> time without issues.
>>
>> Yesterday however, something apparently changed, and Eclipse now fails
>> to compile any of my Scala classes.
>>
>> It acts like it's compiling, and produces no build errors, but when
>> the 'build' is complete none of the Scala classes have made it into
>> the bin directory. Java classes seem to be compiling as per usual.
>>
>> Tested it out with a completely fresh project which also failed to
>> compile.
>>
>> I re-installed the Scala plug-in and got managed to compile "Hello
>> World", but my original project is still refusing to build.
>>
>> Presumably something in the project config is corrupt, but I've no
>> idea what to look for.
>>
>>
>> Anyone encountered this phenomenon before?
>>
>>
>>
>>
>>
>> Many thanks,
>> Lach
>>
>
>

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Eclipse Scala project suddenly fails to compile

On Thu, Mar 4, 2010 at 3:44 PM, exmbly wrote:
> It seems the problem I was having disappears as long as I don't install the
> Weaver plugin along with the Scala IDE for Eclipse. I haven't done any
> further investigation, but perhaps this plugin conflicts with another weaver
> already in Eclipse.

Weaver plugin? You mean JDT Weaving? The Scala IDE won't work without
it, so you're presumably getting it from some other plugin ... what
(and what versions) do you have installed?

Cheers,

Miles

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland