Running `publishLocalAllModule` on SBT source says `crossScalaVersions is undefined` for `zinc`

时间:2018-09-22 22:44:45

标签: sbt

After downloading the SBT source and running the SBT shell:

$ mkdir sbt-modules
$ cd sbt-modules
$ for i in sbt io util librarymanagement zinc; do \
  git clone https://github.com/sbt/$i.git && (cd $i; git checkout -b develop origin/develop)
done
$ cd sbt
$ ./sbt-allsources.sh

When I publish, I get the following error:

sbt:sbtRoot> publishLocalAllModule
[error] java.lang.RuntimeException: ProjectRef(uri("file:/Users/nhooey/git/github/sbt/zinc/"), "compilerBridge") / ./ ./ crossScalaVersions is undefined.
[error]         at scala.sys.package$.error(package.scala:27)
[error]         at sbt.Extracted.$anonfun$getOrError$1(Extracted.scala:119)
[error]         at scala.Option.getOrElse(Option.scala:121)
[error]         at sbt.Extracted.getOrError(Extracted.scala:119)
[error]         at sbt.Extracted.getOrError(Extracted.scala:124)
[error]         at sbt.Extracted.get(Extracted.scala:34)
[error]         at $127b0bc6e7d0db0357c4$.$anonfun$customCommands$18(build.sbt:803)
[error]         at scala.Option.map(Option.scala:146)
[error]         at $127b0bc6e7d0db0357c4$.$anonfun$customCommands$10(build.sbt:801)
[error]         at sbt.Command$.$anonfun$command$2(Command.scala:91)
[error]         at sbt.Command$.process(Command.scala:181)
[error]         at sbt.MainLoop$.processCommand(MainLoop.scala:151)
[error]         at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
[error]         at sbt.State$$anon$1.runCmd$1(State.scala:246)
[error]         at sbt.State$$anon$1.process(State.scala:250)
[error]         at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.MainLoop$.next(MainLoop.scala:139)
[error]         at sbt.MainLoop$.run(MainLoop.scala:132)
[error]         at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
[error]         at sbt.io.Using.apply(Using.scala:22)
[error]         at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
[error]         at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
[error]         at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
[error]         at sbt.MainLoop$.runLogged(MainLoop.scala:35)
[error]         at sbt.StandardMain$.runManaged(Main.scala:138)
[error]         at sbt.xMain.run(Main.scala:89)
[error]         at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error]         at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error]         at xsbt.boot.Launch$.run(Launch.scala:109)
[error]         at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error]         at xsbt.boot.Launch$.launch(Launch.scala:117)
[error]         at xsbt.boot.Launch$.apply(Launch.scala:18)
[error]         at xsbt.boot.Boot$.runImpl(Boot.scala:56)
[error]         at xsbt.boot.Boot$.main(Boot.scala:18)
[error]         at xsbt.boot.Boot.main(Boot.scala)
[error] ProjectRef(uri("file:/Users/nhooey/git/github/sbt/zinc/"), "compilerBridge") / ./ ./ crossScalaVersions is undefined.
[error] Use 'last' for the full log.

This is after:

  1. Deleting my ~/.sbt directory recursively
  2. Running git clean -dfx to delete all untracked and ignored files in each SBT repository

This is the head of the branch for the sbt/sbt project that was checked out when I ran the for loop above, which I did just now:

*   commit 550c068b9829f8b691f046e87cd1023d87735973 (HEAD -> develop, origin/develop, origin/HEAD)
|\  Merge: a8e319e97 b47ca1b9e
| | Author: eugene yokota <eed3si9n@gmail.com>
| | Date:   Wed Sep 19 23:19:16 2018 -0400
| |
| |     Merge pull request #4369 from eed3si9n/wip/task-sequential
| |
| |     Implement sequential[B](tasks: Seq[Initialize[Task[B]]])

1 个答案:

答案 0 :(得分:0)

我相信zinc/pull/577违反了publishLocalAllModule。分析diff,我们发现它来自

- compilerBridge,

+ compilerBridge210,
+ compilerBridge211,
+ compilerBridge212,
+ compilerBridge213, 

但是publishLocalAllModule仍然仅指compilerBridge

  ...
  val csv = get(crossScalaVersions in ProjectRef(build, "compilerBridge")).toList
  (csv flatMap { bridgeSv =>
    s"++$bridgeSv" :: ("{" + build.toString + "}compilerBridge/publishLocal") :: Nil
  })
  ...

compilerBridge代替compilerBridge212,我们可以使publishLocalAllModule继续进行,但是以后仍然失败。我认为值得举一个官方issue来要求更新publishLocalAllModule