0

由于某种原因,mill 全局配置文件会导致 mill 崩溃。此处使用的文件在工厂文档中用作示例

cat /home/jk/.mill/ammonite/predef.sc 
val nexusUser = "myuser"
val nexusPassword = "mysecret"

cat /home/jk/.mill/ammonite/predefScript.sc 
val nexusUser = "myuser"
val nexusPassword = "mysecret"

当这些文件正在/home/jk/.mill/ammonite/运行时,例如mill resolve foomill -i将导致以​​下错误:

~/workspace.exp/hands-on-scala/example-0$ mill resolve foo
Compiling /home/jk/.mill/ammonite/predefScript.sc
java.lang.AssertionError: assertion failed
  scala.Predef$.assert(Predef.scala:265)
  mill.define.Segment$Label.<init>(Ctx.scala:13)
  mill.define.Segment$Label$.apply(Ctx.scala:12)
  mill.define.Segment$Label$.apply(Ctx.scala:12)
  scala.collection.immutable.ArraySeq.$anonfun$map$1(ArraySeq.scala:71)
  scala.collection.immutable.ArraySeq.$anonfun$map$1$adapted(ArraySeq.scala:71)
  scala.collection.immutable.ArraySeq$.tabulate(ArraySeq.scala:286)
  scala.collection.immutable.ArraySeq$.tabulate(ArraySeq.scala:265)
  scala.collection.ClassTagIterableFactory$AnyIterableDelegate.tabulate(Factory.scala:679)
  scala.collection.immutable.ArraySeq.map(ArraySeq.scala:71)
  scala.collection.immutable.ArraySeq.map(ArraySeq.scala:35)
  mill.define.Segments$.labels(Ctx.scala:56)
  ammonite.predef.predefScript$.<init>(predefScript.sc:41)
  ammonite.predef.predefScript$.<clinit>(predefScript.sc:40)


~/workspace.exp/hands-on-scala/example-0$ mill -i
WARNING: Starting a build REPL without --repl is deprecated
Loading...
Compiling /home/jk/.mill/ammonite/predef.sc
java.lang.AssertionError: assertion failed
  scala.Predef$.assert(Predef.scala:265)
  mill.define.Segment$Label.<init>(Ctx.scala:13)
  mill.define.Segment$Label$.apply(Ctx.scala:12)
  mill.define.Segment$Label$.apply(Ctx.scala:12)
  scala.collection.immutable.ArraySeq.$anonfun$map$1(ArraySeq.scala:71)
  scala.collection.immutable.ArraySeq.$anonfun$map$1$adapted(ArraySeq.scala:71)
  scala.collection.immutable.ArraySeq$.tabulate(ArraySeq.scala:286)
  scala.collection.immutable.ArraySeq$.tabulate(ArraySeq.scala:265)
  scala.collection.ClassTagIterableFactory$AnyIterableDelegate.tabulate(Factory.scala:679)
  scala.collection.immutable.ArraySeq.map(ArraySeq.scala:71)
  scala.collection.immutable.ArraySeq.map(ArraySeq.scala:35)
  mill.define.Segments$.labels(Ctx.scala:56)
  ammonite.predef.predef$.<init>(predef.sc:51)
  ammonite.predef.predef$.<clinit>(predef.sc:50)

Build.sc非常简单,尽管即使没有编译错误也会发生build.sc

cat build.sc 

import mill._, scalalib._

trait CommonModule extends ScalaModule {
  def scalaVersion = "2.12.4"
}

object foo extends CommonModule
object bar extends CommonModule {
  def moduleDeps = Seq(foo)
}

没有predef.sc并且predefScript.sc两个命令都运行正常:

~/workspace.exp/hands-on-scala/example-0$ mill resolve foo
Compiling /home/jk/workspace.exp/hands-on-scala/example-0/build.sc
[1/1] resolve 
foo
~/workspace.exp/hands-on-scala/example-0$ mill -i
WARNING: Starting a build REPL without --repl is deprecated
Loading...
Compiling /home/jk/workspace.exp/hands-on-scala/example-0/build.sc
Compiling /home/jk/workspace.exp/hands-on-scala/example-0/(console)
@ println("Hello") 
Hello

@ Bye!

这里有什么问题,我该如何解决?

磨机版本是 0.9.9

谢谢您的支持!

4

0 回答 0