FSC dies on Rebuild Project

Hi.

If I do a "Rebuild Project" halfway through it will fail. If I restart FSC and then do a make it continues to the end fine.

This started happening when we moved from 2.8 to 2.9 so I'm temped to say it is a problem with the FSC and nothing to do with idea. However, our project does a clean build in SBT without failing and SBT uses a similar mechanism to FSC.

Also, in the stack trace from the FSC, it does mention some jetbrain classes (see below).

Do you think this could be a problem with idea?

Thanks, Nick.

Scalac internal error: class java.lang.reflect.InvocationTargetException [sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25), java.lang.reflect.Method.invoke(Method.java:597), org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:66)][java.lang.ProcessBuilder.start(ProcessBuilder.java:460), scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68), scala.sys.process.ProcessBuilderImpl$DaemonBuilder.run(ProcessBuilderImpl.scala:22), scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:97), scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:96), scala.tools.nsc.CompileSocket.startNewServer(CompileSocket.scala:101), scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala:127), scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala:166), scala.tools.nsc.CompileSocket.getOrCreateSocket(CompileSocket.scala:184), scala.tools.nsc.StandardCompileClient.process(CompileClient.scala:46), scala.tools.nsc.CompileClient.process(CompileClient.scala), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25), java.lang.reflect.Method.invoke(Method.java:597), org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:66)]sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:66)
Caused by java.io.IOException: Cannot run program "scala": java.io.IOException: error=2, No such file or directory
java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68)
scala.sys.process.ProcessBuilderImpl$DaemonBuilder.run(ProcessBuilderImpl.scala:22)
scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:97)
scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:96)
scala.tools.nsc.CompileSocket.startNewServer(CompileSocket.scala:101)
scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala:127)
scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala:166)
scala.tools.nsc.CompileSocket.getOrCreateSocket(CompileSocket.scala:184)
scala.tools.nsc.StandardCompileClient.process(CompileClient.scala:46)
scala.tools.nsc.CompileClient.process(CompileClient.scala)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:66)
Caused by java.io.IOException: java.io.IOException: error=2, No such file or directory
java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
java.lang.ProcessImpl.start(ProcessImpl.java:65)
java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68)
scala.sys.process.ProcessBuilderImpl$DaemonBuilder.run(ProcessBuilderImpl.scala:22)
scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:97)
scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:96)
scala.tools.nsc.CompileSocket.startNewServer(CompileSocket.scala:101)
scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala:127)
scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala:166)
scala.tools.nsc.CompileSocket.getOrCreateSocket(CompileSocket.scala:184)
scala.tools.nsc.StandardCompileClient.process(CompileClient.scala:46)
scala.tools.nsc.CompileClient.process(CompileClient.scala)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:66)

5 comments
Comment actions Permalink

I've narrowed this down to a particular module.

If I right click on the module and then click compile, FSC always exits whilst compiling it.

Is there anyway I can get additional information about which file is causing the failure? I try to read the text in the Make dialog but it whizzes by too quickly.

Thanks, Nick.

EDIT:

The log file just has this in it:


2011-08-18 16:25:17,539 [  57852]   INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED
2011-08-18 16:25:17,597 [  57910]   INFO - lij.compiler.impl.CompilerUtil - Clearing output dirs took 1 ms: 0 min 0sec
2011-08-18 16:25:17,597 [  57910]   INFO - lij.compiler.impl.CompilerUtil - Refreshing output directories took 49 ms: 0 min 0sec
2011-08-18 16:25:18,498 [  58811]   INFO - lij.compiler.impl.CompilerUtil - Initial VFS refresh took 858 ms: 0 min 0sec
2011-08-18 16:26:03,475 [ 103788]   INFO - lij.compiler.impl.CompilerUtil -  COMPILATION FINISHED; Errors: 0; warnings: 0 took 45936 ms: 0 min 45sec


no errors are reported, it's just FSC that closes down.

edit 2:

FSC closes with this:

[Loaded scala.tools.nsc.symtab.Types$adaptToNewRunMap$$anonfun$25 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.Typers$Typer$$anonfun$35 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.Typers$Typer$$anonfun$36 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedAnnotation$1 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedAnnotation$2 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.Typers$Typer$$anonfun$34 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.Typers$Typer$$anonfun$trees2ConstArg$1$1 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.Typers$Typer$$anonfun$trees2ConstArg$1$2 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.Infer$Inferencer$$anonfun$isAsSpecific$2 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.TypeDiagnostics$$anonfun$withDisambiguation$2$$anonfun$apply$9$$anonfun$apply$10 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.TypeDiagnostics$TypeDiag$$anonfun$postQualify$1 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.TypeDiagnostics$$anonfun$withDisambiguation$2$$anonfun$apply$9$$anonfun$apply$11 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.TypeDiagnostics$$anonfun$withDisambiguation$2$$anonfun$apply$9$$anonfun$apply$12 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.typechecker.TypeDiagnostics$$anonfun$forString$1$2 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.symtab.Types$ExistentialType$$anonfun$safeToString$4 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.symtab.Types$adaptToNewRunMap$$anonfun$24 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.symtab.Symbols$Symbol$$anonfun$infoString$1 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.symtab.classfile.Pickler$Pickle$$anonfun$putClassfileAnnotArg$1$1 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded scala.tools.nsc.symtab.classfile.Pickler$Pickle$$anonfun$writeBody$1$1 from file:/home/nick/workspace/dev/services/starling/lib/scala/scala-2.9.0.1.final/lib/scala-compiler.jar]
[Loaded java.lang.Shutdown from /home/nick/apps/java/jdk1.6.0_24/jre/lib/rt.jar]
[Loaded java.lang.Shutdown$Lock from /home/nick/apps/java/jdk1.6.0_24/jre/lib/rt.jar]

Process finished with exit code 1

0
Comment actions Permalink

You may check Real FSC support blog post.

0
Comment actions Permalink

Hi.

The real FSC support is good and we are now using it.

However, I'm still seeing the same behaviour. I do a rebuild, it fails, but then if I do a make it continues to the end and everything works fine.

The new FSC support does narrow it down though. This is the output now:


error: not found: type TestMarketTest
class AtomicDatumKeyUtilsTests extends TestMarketTest {


Here I have AtomicDatumKeyUtilsTests which is in a test directory in one module (module a), extending TestMarketTest that is in a test directory in another module (module b).

module a depends on module b  (scope compile) so I don't know why it can't find TestMarketTest. In fact, if I look in the output directory I can see the class file.

I'll try and reproduce the problem in a small project but do you have any idea what it could be?

Thanks, Nick.

edit - if I do a clean and then just make module a, it fails and the class file isn't there, so what I said before about it being there could be wrong.

0
Comment actions Permalink

I've spent the last hour producing a test project similar to the real project but I can't get it to fail.

Is there any debug I can put in so I can see which order it thinks it needs to compile files?

Thanks, Nick.

0
Comment actions Permalink

I know that fsc sometimes does strange things, however it's not stable reproducible and it seems that it can be strange things from fsc (however it also can be our problem).
Currently you can debug compiler support only using debug from plugin sources. So I created appropriate issue to add different possibility for debug  http://youtrack.jetbrains.net/issue/SCL-3709.

Best regards,
Alexander Podkhalyuzin.

0

Please sign in to leave a comment.