Problems related to SBT build manager and ticket #1000607 Java incremental compiler not triggered

14 views
Skip to first unread message

Frode Nerbråten

unread,
Nov 10, 2011, 3:09:06 AM11/10/11
to Scala IDE User
Hi,

I'm having some problems using the SBT based build manager and I
believe it is the same as issue #1000607 but the setup is different
from the one in the ticket:

I have a pretty large java maven project with only a few tests written
in Scala (scala depends on java only).
After a clean build everything builds and runs smoothly. If I change
any of the scala sources AnalysisCompile lists the modified scala
class and a bunch of java classes to compile (the java files are not
modified). The JavaEclipseCompiler is invoked but none of the java-
classes gets compiled. AnalysisCompile outputs "Compilation was
successful" but all the .class files for the java-classes are missing.
Eclipse does not report any build errors in the other java-classes
that depends on the missing classes. But if I try to run a test that
uses one of the classes I get a runtime error that the class is
missing.

What is worse is that the same thing happens if I modify any java
source file without touching the scala code. The same class files are
listed, removed but not recompiled. I haven't figured out why the
build manager thinks that these classes need to be recompiled every
time, but it seems that the java compiler does not agree because it
does not detect any change. Unfortunately the project is closed
source, but I tried to set up the simple example from the ticket, and
it seems to be the same problem: That java class C.java is not
compiled when the scala source changes. I will try to figure out why
this happens, but it takes me a while to get familiar with the eclipse-
ide source :) If you have the time to look into it, that would be
great!

Switching to the refined build manager makes the problem go away. I
still have to clean the project from time to time, but this does not
seem to be related. So unfortunately I'm not able to use the SBT build
manager at all in our project.

Eclipse Indigo Service Release 1
m2-eclipse 1.0.100.20110804-1717
scala-ide tried several: trunk, nightly-2.9.2-SNAPSHOT and RC1 (all
have the same issue)

Best regards,
Frode

Hubert Plociniczak

unread,
Nov 10, 2011, 5:07:50 AM11/10/11
to Scala IDE User


On Nov 10, 9:09 am, Frode Nerbråten <fr...@nerbraten.no> wrote:
> Hi,
>
> I'm having some problems using the SBT based build manager and I
> believe it is the same as issue #1000607 but the setup is different
> from the one in the ticket:
>
> I have a pretty large java maven project with only a few tests written
> in Scala (scala depends on java only).
> After a clean build everything builds and runs smoothly. If I change
> any of the scala sources AnalysisCompile lists the modified scala
> class and a bunch of java classes to compile (the java files are not
> modified). The JavaEclipseCompiler is invoked but none of the java-
> classes gets compiled. AnalysisCompile outputs "Compilation was
> successful" but all the .class files for the java-classes are missing.
> Eclipse does not report any build errors in the other java-classes
> that depends on the missing classes. But if I try to run a test that
> uses one of the classes I get a runtime error that the class is
> missing.

That looks like #1000388 which I managed to reduce to a smallish
example. Iulian thinks it might be a refreshing issue.

>
> What is worse is that the same thing happens if I modify any java
> source file without touching the scala code. The same class files are
> listed, removed but not recompiled. I haven't figured out why the
> build manager thinks that these classes need to be recompiled every
> time, but it seems that the java compiler does not agree because it
> does not detect any change. Unfortunately the project is closed
> source, but I tried to set up the simple example from the ticket, and
> it seems to be the same problem: That java class C.java is not
> compiled when the scala source changes. I will try to figure out why
> this happens, but it takes me a while to get familiar with the eclipse-
> ide source :) If you have the time to look into it, that would be
> great!

That one should definitely be fixed. See the same test class as for
#1000388 which exactly checks for that. This was fixed in recent sbt
release.

>
> Switching to the refined build manager makes the problem go away. I
> still have to clean the project from time to time, but this does not
> seem to be related. So unfortunately I'm not able to use the SBT build
> manager at all in our project.
>
> Eclipse Indigo Service Release 1
> m2-eclipse 1.0.100.20110804-1717
> scala-ide tried several: trunk, nightly-2.9.2-SNAPSHOT and RC1 (all
> have the same issue)

Hmmm. You seem to be changing a lot between the versions. Could this
be the infamous caching issue on the Eclipse side where it doesn't
update the sbt libraries of the plugin?
Building shouldn't really matter between the versions of scala. We use
exactly the same sources, just compile them with different compiler
versions.

>
> Best regards,
> Frode

hubert

Frode Nerbråten

unread,
Nov 10, 2011, 9:30:34 AM11/10/11
to Scala IDE User
Thank you for the reply!

On Nov 10, 11:07 am, Hubert Plociniczak <hubert.plocinic...@gmail.com>
wrote:
>
> That looks like #1000388 which I managed to reduce to a smallish
> example. Iulian thinks it might be a refreshing issue.

Ok. I missed the last comments in that one. I assumed it was the other
issue since the fix with sbt didn't seem to have any affect in my
project.

> That one should definitely be fixed. See the same test class as for
> #1000388 which exactly checks for that. This was fixed in recent sbt
> release.

Ok thanks, I will have a look at the test. I can see that the ticket
has been reopened now.

> Hmmm. You seem to be changing a lot between the versions. Could this
> be the infamous caching issue on the Eclipse side where it doesn't
> update the sbt libraries of the plugin?
> Building shouldn't really matter between the versions of scala. We use
> exactly the same sources, just compile them with different compiler
> versions.

Ok, I guess I was really hoping that the problem would go away with
one of the build combinations :) I will stick with one version. I will
definitely check if the sbt libraries doesn't update. But the last
couple of times I have uninstalled scala-ide before installing a new
version.

Frode
Reply all
Reply to author
Forward
0 new messages