No classfiles when building mixed Scala Java project
(from a customer).
Sometimes, Eclipse gets into a state where class files that the Scala compiler should generate are not present in the output folder. Unfortunately the problem is very difficult to reproduce, so there is no reliable repro project I can send, but I have two observations that may help: one, in the failure case, the progress window indicates a normal build process, which is then unexpectedly followed by a "Cleaning output folder for ..." stage that wipes out the previously (correctly) built class files.
Captured stacktrace in the debugger:
Sometimes, Eclipse gets into a state where class files that the Scala compiler should generate are not present in the output folder. Unfortunately the problem is very difficult to reproduce, so there is no reliable repro project I can send, but I have two observations that may help: one, in the failure case, the progress window indicates a normal build process, which is then unexpectedly followed by a "Cleaning output folder for ..." stage that wipes out the previously (correctly) built class files.
Captured stacktrace in the debugger:
Thread [Worker-23] (Suspended (entry into method delete in File))
File.delete() line: 1028 [local variables unavailable]
LocalFile.internalDelete(File, String, MultiStatus, IProgressMonitor) line: 221
LocalFile.internalDelete(File, String, MultiStatus, IProgressMonitor) line: 241
LocalFile.internalDelete(File, String, MultiStatus, IProgressMonitor) line: 241
LocalFile.internalDelete(File, String, MultiStatus, IProgressMonitor) line: 241
LocalFile.delete(int, IProgressMonitor) line: 129
DeleteVisitor.delete(UnifiedTreeNode, boolean) line: 63
DeleteVisitor.visit(UnifiedTreeNode) line: 150
UnifiedTree.accept(IUnifiedTreeVisitor, int) line: 109
FileSystemResourceManager.delete(IResource, int, IProgressMonitor) line: 349
ResourceTree.internalDeleteFolder(IFolder, int, IProgressMonitor) line: 352
ResourceTree.standardDeleteFolder(IFolder, int, IProgressMonitor) line: 798
Folder(Resource).unprotectedDelete(ResourceTree, int, IProgressMonitor) line: 1977
Folder(Resource).delete(int, IProgressMonitor) line: 803
BatchImageBuilder.cleanOutputFolders(boolean) line: 116
BatchImageBuilder.build() line: 48
GeneralScalaJavaBuilder(JavaBuilder).buildAll() line: 254
GeneralScalaJavaBuilder(JavaBuilder).build(int, Map, IProgressMonitor) line: 178
GeneralScalaJavaBuilder(ScalaJavaBuilder).build(int, Map, IProgressMonitor) line: 27
JavaEclipseCompiler.compile(File[], File[], Output, String[], Logger) line: 47
AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$1.apply$mcV$sp() line: 126
AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$1.apply() line: 126
AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$1.apply() line: 126
AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(String, Logger, Function0<T>) line: 159
AggressiveCompile$$anonfun$3.compileJava$1(AnalysisCallback, Seq) line: 125
AggressiveCompile$$anonfun$3.apply(Set<File>, DependencyChanges, AnalysisCallback) line: 142
AggressiveCompile$$anonfun$3.apply(Object, Object, Object) line: 86
IncrementalCompile$$anonfun$doCompile$1.apply(Set<File>, DependencyChanges) line: 38
IncrementalCompile$$anonfun$doCompile$1.apply(Object, Object) line: 36
Incremental$.cycle(Set<File>, Set<File>, DependencyChanges, Analysis, Function2<Set<File>,DependencyChanges,Analysis>, ClassfileManager, int, Logger, IncOptions) line: 73
Incremental$$anonfun$1.apply(ClassfileManager) line: 33
Incremental$$anonfun$1.apply(Object) line: 32
Incremental$.manageClassfiles(IncOptions, Function1<ClassfileManager,T>) line: 41
Incremental$.compile(Set<File>, Function1<String,Option<File>>, Analysis, ReadStamps, Function1<File,Option<Analysis>>, Function2<Set<File>,DependencyChanges,Analysis>, Logger, IncOptions, Equiv<Stamp>) line: 32
IncrementalCompile$.apply(Set<File>, Function1<String,Option<File>>, Function3<Set<File>,DependencyChanges,AnalysisCallback,BoxedUnit>, Analysis, Function1<File,Option<Analysis>>, Output, Logger, IncOptions) line: 26
AggressiveCompile.compile2(CompileConfiguration, Logger, Equiv<CompileSetup>) line: 150
AggressiveCompile.compile1(Seq<File>, Seq<File>, CompileSetup, Option<CompileProgress>, AnalysisStore, Function1<File,Option<Analysis>>, Function1<File,Function1<String,Object>>, AnalyzingCompiler, JavaCompiler, Reporter, boolean, GlobalsCache, IncOptions, Logger) line: 70
AggressiveCompile.apply(AnalyzingCompiler, JavaCompiler, Seq<File>, Seq<File>, Output, GlobalsCache, Option<CompileProgress>, Seq<String>, Seq<String>, Function1<File,Option<Analysis>>, Function1<File,Function1<String,Object>>, Reporter, CompileOrder, boolean, IncOptions, Logger) line: 45
IC$.compile(Inputs<Analysis,AnalyzingCompiler>, Logger) line: 22
EclipseSbtBuildManager.runCompiler(Seq<File>) line: 133
EclipseSbtBuildManager.update(Set<AbstractFile>, Set<AbstractFile>) line: 124
EclipseSbtBuildManager.build(Set<IFile>, Set<IFile>, SubMonitor) line: 178
ScalaProject.build(Set<IFile>, Set<IFile>, SubMonitor) line: 666
ScalaBuilder.build(int, Map<String,String>, IProgressMonitor) line: 119
BuildManager$3.run() line: 783
SafeRunner.run(ISafeRunnable) line: 42
BuildManager.basicBuild(int, IncrementalProjectBuilder, Map<String,String>, MultiStatus, IProgressMonitor) line: 212
BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext, ICommand[], MultiStatus, IProgressMonitor) line: 257
BuildManager$1.run() line: 310
SafeRunner.run(ISafeRunnable) line: 42
BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext, MultiStatus, IProgressMonitor) line: 313
BuildManager.basicBuildLoop(IBuildConfiguration[], IBuildConfiguration[], int, MultiStatus, IProgressMonitor) line: 369
BuildManager.build(IBuildConfiguration[], IBuildConfiguration[], int, IProgressMonitor) line: 422
Workspace.buildInternal(IBuildConfiguration[], int, boolean, IProgressMonitor) line: 513
Workspace.build(IBuildConfiguration[], int, boolean, IProgressMonitor) line: 432
BuildAction$1.runInWorkspace(IProgressMonitor) line: 305
BuildAction$1(InternalWorkspaceJob).run(IProgressMonitor) line: 38
Worker.run() line: 54
Leave a comment
on 2013-12-13 10:29 *
By huitseeker
Assigned to set to Iulian Dragos
Status changed from New to Accepted
In scala-ide:dd73ba36aa7fd42f1ede7193da227b1cf597aca7 Make pointcut pick up subclasses of ScalaJavaBuilder.
This fixes a problem at a customer (cleaning output folders, leading to
empty output folders after successful builds), but I could not reproduce
locally. Confirmed it works for said customer, so rolling back to main
project.
Fixed #1001995
(cherry picked from commit bcd85b3a3af3b00b3cb195b2561c1c880feac0b9)