Build compiler (scalac) crashed with linked source
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/1839
Reporter djb
Using Eclipse Version: 3.4.1 Build id: M20080911-1700 and Scala plugin 2.7.3.final,
create a new Scala project. Add a package named test
and in the test package, add a simple Scala class, Test:
with a Java source test2.Test2 in c:\temp\aux_java\src\test2\Test2.java
When you close the properties, the Scala plug-in tries to compile
and gives the following errors.
the exception
Reporter djb
Using Eclipse Version: 3.4.1 Build id: M20080911-1700 and Scala plugin 2.7.3.final,
create a new Scala project. Add a package named test
and in the test package, add a simple Scala class, Test:
package test
class Test {}
Outside this project, create a source folder c:\temp\aux_javawith a Java source test2.Test2 in c:\temp\aux_java\src\test2\Test2.java
package test2;
public class Test2 { }
In the Scala project, open the project properties and select the Java Build Path. Click on Link Source and add the folder c:\temp\aux_java\srcWhen you close the properties, the Scala plug-in tries to compile
and gives the following errors.
!ENTRY ch.epfl.lamp.sdt.core 4 4 2009-03-30 09:46:54.689
!MESSAGE Build compiler (scalac) crashed
!STACK 0
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:150)
at scala.None$.get(Option.scala:148)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.nscToLampion(ScalaPlugin.scala:377)
at scala.tools.eclipse.Driver$Project.nscToLampion(Driver.scala:16)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.nscToEclipse(ScalaPlugin.scala:380)
at scala.tools.eclipse.Driver$Project.nscToEclipse(Driver.scala:16)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.charSet(ScalaPlugin.scala:177)
at scala.tools.eclipse.Driver$Project.charSet(Driver.scala:16)
at scala.tools.eclipse.BuildCompiler.getSourceFile(BuildCompiler.scala:53)
at scala.tools.nsc.Global.getSourceFile(Global.scala:217)
at scala.tools.nsc.Global$Run$$anonfun$compile$1.apply(Global.scala:667)
at scala.tools.nsc.Global$Run$$anonfun$compile$1.apply(Global.scala:667)
at scala.List.map(List.scala:805)
at scala.tools.nsc.Global$Run.compile(Global.scala:667)
at scala.tools.eclipse.BuildCompiler.build(BuildCompiler.scala:114)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.build(ScalaPlugin.scala:405)
at scala.tools.eclipse.Driver$Project.build(Driver.scala:16)
at lampion.eclipse.Builder.build(Builder.scala:87)
at scala.tools.eclipse.Builder.build(Builder.scala:32)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!ENTRY org.eclipse.core.resources 4 2 2009-03-30 09:46:54.689
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:150)
at scala.None$.get(Option.scala:148)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.nscToLampion(ScalaPlugin.scala:377)
at scala.tools.eclipse.Driver$Project.nscToLampion(Driver.scala:16)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$$anonfun$build$2.apply(ScalaPlugin.scala:409)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$$anonfun$build$2.apply(ScalaPlugin.scala:409)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.collection.jcl.MutableIterator$Wrapper.foreach(MutableIterator.scala:14)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.collection.jcl.LinkedHashSet.foreach(LinkedHashSet.scala:18)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.build(ScalaPlugin.scala:409)
at scala.tools.eclipse.Driver$Project.build(Driver.scala:16)
at lampion.eclipse.Builder.build(Builder.scala:87)
at scala.tools.eclipse.Builder.build(Builder.scala:32)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!ENTRY org.eclipse.core.resources 2 75 2009-03-30 09:46:54.704
!MESSAGE Errors during build.
!SUBENTRY 1 ch.epfl.lamp.sdt.core 2 75 2009-03-30 09:46:54.704
!MESSAGE Errors running builder 'Scala Builder' on project 'build_compiler_scalac_crashed'.
!SUBENTRY 1 ch.epfl.lamp.sdt.core 2 75 2009-03-30 09:46:54.704
!MESSAGE None.get
!STACK 0
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:150)
at scala.None$.get(Option.scala:148)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.nscToLampion(ScalaPlugin.scala:377)
at scala.tools.eclipse.Driver$Project.nscToLampion(Driver.scala:16)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$$anonfun$build$2.apply(ScalaPlugin.scala:409)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$$anonfun$build$2.apply(ScalaPlugin.scala:409)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.collection.jcl.MutableIterator$Wrapper.foreach(MutableIterator.scala:14)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.collection.jcl.LinkedHashSet.foreach(LinkedHashSet.scala:18)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.build(ScalaPlugin.scala:409)
at scala.tools.eclipse.Driver$Project.build(Driver.scala:16)
at lampion.eclipse.Builder.build(Builder.scala:87)
at scala.tools.eclipse.Builder.build(Builder.scala:32)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
in another (more complex) project, doing a similar operation yieldsthe exception
java.lang.Error
at lampion.core.Nodes$class.assert(Nodes.scala:25)
at scala.tools.eclipse.Driver$Project.assert(Driver.scala:16)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.nscToLampion(ScalaPlugin.scala:374)
at scala.tools.eclipse.Driver$Project.nscToLampion(Driver.scala:16)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.nscToEclipse(ScalaPlugin.scala:380)
at scala.tools.eclipse.Driver$Project.nscToEclipse(Driver.scala:16)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.charSet(ScalaPlugin.scala:177)
at scala.tools.eclipse.Driver$Project.charSet(Driver.scala:16)
at scala.tools.eclipse.BuildCompiler.getSourceFile(BuildCompiler.scala:53)
at scala.tools.nsc.Global.getSourceFile(Global.scala:217)
at scala.tools.nsc.Global$Run$$anonfun$compile$1.apply(Global.scala:667)
at scala.tools.nsc.Global$Run$$anonfun$compile$1.apply(Global.scala:667)
at scala.List.map(List.scala:805)
at scala.tools.nsc.Global$Run.compile(Global.scala:667)
at scala.tools.eclipse.BuildCompiler.build(BuildCompiler.scala:114)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.build(ScalaPlugin.scala:405)
at scala.tools.eclipse.Driver$Project.build(Driver.scala:16)
at lampion.eclipse.Builder.build(Builder.scala:87)
at scala.tools.eclipse.Builder.build(Builder.scala:32)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Leave a comment
on 2009-04-26 10:22 *
By tracImporter
Trac author: jrudolph
CC Change: johannes.rudolph@…
CC Change: johannes.rudolph@…
on 2009-04-27 03:21 *
By tracImporter
Trac author: jrudolph
This is actually a eclipse bug:
#128801 The problem is that IWorkspaceRoot.findFilesForLocation is broken, since it converts the file to search for into a canonical URL but when looping through all projects doesn't convert the projects base URI into canonical form as well.
The code in question is in FileSystemResourceManager.allPathsForLocation.
Instead, the project's URI is only converted into canonical form at the time a project is created in or imported into the workspace.
In my case it occurs since I changed my harddisk and now all the projects' folders have a link somewhere in their path and canonicalizing resolves all links somewhere in the path. Another problem I found reported on the internet, that the problem may occur in Windows because of subtle case sensitivity differences somewhere in the path.
I haven't tried yet, but the obvious workaround for now is to delete and reimport the project in question.
Another thing to try is to override Project.getLocationURI and make it always return the canonicalized form.
This is actually a eclipse bug:
#128801 The problem is that IWorkspaceRoot.findFilesForLocation is broken, since it converts the file to search for into a canonical URL but when looping through all projects doesn't convert the projects base URI into canonical form as well.
The code in question is in FileSystemResourceManager.allPathsForLocation.
Instead, the project's URI is only converted into canonical form at the time a project is created in or imported into the workspace.
In my case it occurs since I changed my harddisk and now all the projects' folders have a link somewhere in their path and canonicalizing resolves all links somewhere in the path. Another problem I found reported on the internet, that the problem may occur in Windows because of subtle case sensitivity differences somewhere in the path.
I haven't tried yet, but the obvious workaround for now is to delete and reimport the project in question.
Another thing to try is to override Project.getLocationURI and make it always return the canonicalized form.
on 2009-04-27 03:49 *
By tracImporter
Trac author: jrudolph
I forgot to mention that I'm only talking about the second stack trace.
I forgot to mention that I'm only talking about the second stack trace.
Updating tickets (#1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408, #2459, #2499, #2523, #2572, #2582, #2602, #2614, #2615, #2675, #2710, #2745, #2763, #2816, #2830, #2834, #2878, #2879, #2887, #2888, #2901, #2911, #2912, #2922, #2937, #2938, #2942, #2951, #2955, #2957, #2961, #2964, #2965, #2974, #2975, #2989, #2990, #3002, #3055, #3070, #3087, #3135, #3139, #3173, #3182, #3184, #3200, #3213, #3214, #3221, #3243, #3251)
on 2011-03-24 10:18 *
By Iulian Dragos
Updating tickets (#1000199, #1000200, #1000201, #1000204, #1000205, #1000209, #1000210, #1000211, #1000212, #1000215, #1000217, #1000218, #1000220, #1000222, #1000226, #1000227, #1000228, #1000230, #1000231, #1000232, #1000233, #1000235, #1000236, #1000237, #1000239, #1000240, #1000241, #1000242, #1000243, #1000244, #1000248, #1000249, #1000252, #1000253, #1000254, #1000255, #1000256, #1000258, #1000259, #1000032, #1000059, #1000062, #1000163, #1000197, #1000216, #1000221, #1000224, #1000121, #1000175, #1000219, #1000251, #1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408)