Incremental compiler bug

53 views
Skip to first unread message

Mirco Dotta

unread,
Sep 25, 2013, 8:34:30 AM9/25/13
to zi...@typesafe.com, Scala IDE
I'm trying to isolate what looks like a fairly nasty incremental compiler bug.

In short, I can make the builder fail on perfectly fine Scala code by commenting and uncommenting a method.

This can be currently reproduced using scala-ide master branch (I am using this commit).

Steps to reproduce it:

1. Comment Cached.initialized, save and let the builder compiling the project
2. Uncomment the above method, save and let the builder compiling the project

Now, if you repeat the above two steps for a few times, you'll eventually get in the state where the build compiler reports 
a compilation error after step 2, which of course should never happen. In my tests, it looks like this happens cyclically, i.e., 
one time it works fine, and the other it breaks, and so on.

The reported error is: value initialized is not a member of scala.tools.eclipse.util.Cached[Option[scala.tools.eclipse.ScalaPresentationCompiler]]

Note that when the error is reported, the Cached classfile indeed does NOT contain the `initialized` method. And this, despite step 2 was performed. 
So, how come we uncommented Cached.initialized, and still that method is not in the produced binary? That made me wonder if compilation fails because one 
of the classes calling on Cached.initialized is being compiled with a not up-to-date Cached source file. Just a shoot in the air, but that's my best guess at the moment.

Another interesting fact is that when the build compiler reports the erroneous compilation error (i.e., we are after step 2), if you execute again step 1, i.e., 
commenting Cached.initialized, nothing happens. No entry in the log, nothing, just like the method was never there...

And finally, here is a link to a folder containing the IDE log after running step 2 alone, with `debugIncremental` flag enabled. 'good-compilation' is for 
the project compiles fine, while 'bad-compilation' is for the buggy scenario.

I'll try to dig deeper and see if I can isolate the issue, but I thought it was good to start a discussion around this. By the way, all the above is happening 
with the latest Scala IDE nightly for Scala 2.10.x. Or, more specifically, Scala IDE 4.0.0.nightly-2_10-201309240521-ec13fb7 (which ships with the incremental compiler of sbt v0.13.0).

-- Mirco

---------------
Mirco Dotta
PSE-D, 1015 Lausanne, Switzerland
Twitter: @mircodotta


Mirco Dotta

unread,
Nov 7, 2013, 5:24:21 AM11/7/13
to scala-...@googlegroups.com, scala-i...@googlegroups.com
Here is a ticket https://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1001953

This issue is also present in the latest v3.0.2 release.

-- Mirco

virtualeyes

unread,
Nov 8, 2013, 1:07:47 AM11/8/13
to scala-i...@googlegroups.com, scala-...@googlegroups.com
Sounds like another RC of SBT will be required in order for the proposed fix (discussed in SBT issue tracker) to be possible for the IDE

Guinea pig alert, I'll try it when you guys release next applicable nightly ;-)
Reply all
Reply to author
Forward
0 new messages