3

我正在使用 SBT (0.7.4) 和 Scala(2.7.7) 来构建我的 Scala 项目,有时在构建项目时会出现以下错误。

到目前为止,唯一的补救措施似乎是重试它或clean在 SBT shell 上执行,这会增加构建过程的延迟。没有出现明确的错误发生模式,但是当我使用触发执行测试用例时,它发生了很多:~test

请注意代码库没有错误。如果我在没有任何源代码更改的情况下进行清理并再次构建,则构建不会出错。有时,构建工作甚至无需清理代码库。

java.lang.AssertionError: assertion failed: List(class Old, class Old)
        at scala.Predef$.assert(Predef.scala:92)
        at scala.tools.nsc.symtab.Symbols$Symbol.suchThat(Symbols.scala:820)
        at scala.tools.nsc.symtab.Symbols$Symbol.linkedClassOfModule(Symbols.scala:962)
        at xsbt.Analyzer$Compat$.linkedClass(Analyzer.scala:225)
        at xsbt.Analyzer$AnalyzerPhase$$anonfun$run$1$$anonfun$apply$7.apply(Analyzer.scala:96)
        at xsbt.Analyzer$AnalyzerPhase$$anonfun$run$1$$anonfun$apply$7.apply(Analyzer.scala:85)
        at scala.Iterator$class.foreach(Iterator.scala:414)
        at scala.collection.mutable.FlatHashTable$$anon$1.foreach(FlatHashTable.scala:113)
        at scala.Iterable$class.foreach(Iterable.scala:256)
        at scala.collection.mutable.HashSet.foreach(HashSet.scala:31)
        at xsbt.Analyzer$AnalyzerPhase$$anonfun$run$1.apply(Analyzer.scala:85)
        at xsbt.Analyzer$AnalyzerPhase$$anonfun$run$1.apply(Analyzer.scala:37)
        at scala.Iterator$class.foreach(Iterator.scala:414)
        at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:266)
        at xsbt.Analyzer$AnalyzerPhase.run(Analyzer.scala:37)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:574)
        at scala.tools.nsc.Global$Run.compile(Global.scala:667)
        at xsbt.CompilerInterface.run(CompilerInterface.scala:81)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at xsbt.AnalyzingCompiler.call(AnalyzingCompiler.scala:40)
        at xsbt.AnalyzingCompiler.apply(AnalyzingCompiler.scala:18)
        at sbt.Compile.processScala(Compile.scala:76)
        at sbt.CompilerCore$$anonfun$1.apply(Compile.scala:27)
        at sbt.CompilerCore$$anonfun$1.apply(Compile.scala:27)
        at sbt.CompilerCore$$anonfun$process$1$1.apply(Compile.scala:22)
        at sbt.CompilerCore$$anonfun$process$1$1.apply(Compile.scala:22)
        at sbt.CompilerCore$$anonfun$doCompile$3.apply(Compile.scala:45)
        at sbt.CompilerCore$$anonfun$doCompile$3.apply(Compile.scala:42)
        at scala.Option.orElse(Option.scala:102)
        at sbt.CompilerCore.doCompile(Compile.scala:41)
        at sbt.CompilerCore.apply(Compile.scala:29)
        at sbt.AbstractCompileConditional.run$1(Conditional.scala:341)
        at sbt.AbstractCompileConditional$$anonfun$3.apply(Conditional.scala:344)
        at sbt.AbstractCompileConditional$$anonfun$3.apply(Conditional.scala:344)
        at sbt.classfile.Analyze$.apply(Analyze.scala:110)
        at sbt.AbstractCompileConditional.execute(Conditional.scala:344)
        at sbt.Conditional$class.run(Conditional.scala:43)
        at sbt.AbstractCompileConditional.run(Conditional.scala:231)
        at sbt.BasicScalaProject.sbt$BasicScalaProject$$doCompile(DefaultProject.scala:259)
        at sbt.BasicScalaProject$$anonfun$compileAction$1.apply(DefaultProject.scala:273)
        at sbt.BasicScalaProject$$anonfun$compileAction$1.apply(DefaultProject.scala:273)
        at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
        at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
        at sbt.impl.RunTask.runTask(RunTask.scala:85)
        at sbt.impl.RunTask.sbt$impl$RunTask$$runIfNotRoot(RunTask.scala:60)
        at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
        at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
        at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
        at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
        at sbt.Control$.trapUnit(Control.scala:19)
        at sbt.Distributor$Run$Worker.run(ParallelRunner.scala:131)
4

0 回答 0