Rebased 现在面临 Scala 依赖问题

Rebased and now facing Scala dependency issues

我不太确定在 rebase 之前我的 rocket-chip 回购在哪里,但这是在转换为使用 Scala 2.12.4 之前(之前我在 2.11.12)。

在尝试重建之前,我已经重新定位并解决了几个 Chisel 文件和 运行 git submodule update rocket-chip 中的冲突。

我现在面临一个依赖问题,我认为它与 hardfloat 有关?

我的作品基于 25b5a25 (upstream/master) 2018-08-25 (2 days ago) Wesley W. Terpstra Merge pull request #1603 from freechipsproject/fix-regressions

我的编译解决了这个问题:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: edu.berkeley.cs#chisel3_2.12;3.2-SNAPSHOT: not found
[warn]  :: edu.berkeley.cs#hardfloat_2.12;1.2: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]          edu.berkeley.cs:chisel3_2.12:3.2-SNAPSHOT
[warn]            +- edu.berkeley.cs:rocketchip_2.12:1.2
[warn]          edu.berkeley.cs:hardfloat_2.12:1.2
[warn]            +- edu.berkeley.cs:rocketchip_2.12:1.2
[error] sbt.librarymanagement.ResolveException: unresolved dependency: edu.berkeley.cs#chisel3_2.12;3.2-SNAPSHOT: not found
[error] unresolved dependency: edu.berkeley.cs#hardfloat_2.12;1.2: not found
[error]         at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:331)
[error]         at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither(IvyActions.scala:205)
[error]         at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule(Ivy.scala:243)
[error]         at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy(Ivy.scala:204)
[error]         at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action(Ivy.scala:70)
[error]         at sbt.internal.librarymanagement.IvySbt$$anon.call(Ivy.scala:77)
[error]         at xsbt.boot.Locks$GlobalLock.withChannel(Locks.scala:95)
[error]         at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries(Locks.scala:80)
[error]         at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock.apply(Locks.scala:99)
[error]         at xsbt.boot.Using$.withResource(Using.scala:10)
[error]         at xsbt.boot.Using$.apply(Using.scala:9)
[error]         at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error]         at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error]         at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error]         at xsbt.boot.Locks$.apply(Locks.scala:28)
[error]         at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error]         at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199)
[error]         at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196)
[error]         at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:242)
[error]         at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:190)
[error]         at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error]         at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error]         at sbt.internal.LibraryManagement$.resolve(LibraryManagement.scala:46)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:99)
[error]         at sbt.util.Tracked$.$anonfun$lastOutput(Tracked.scala:68)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:112)
[error]         at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:112)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$adapted(LibraryManagement.scala:95)
[error]         at sbt.util.Tracked$.$anonfun$inputChanged(Tracked.scala:149)
[error]         at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:126)
[error]         at sbt.Classpaths$.$anonfun$updateTask(Defaults.scala:2383)
[error]         at scala.Function1.$anonfun$compose(Function1.scala:44)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219(TypeFunctions.scala:39)
[error]         at sbt.std.Transform$$anon.work(System.scala:66)
[error]         at sbt.Execute.$anonfun$submit(Execute.scala:262)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.Execute.work(Execute.scala:271)
[error]         at sbt.Execute.$anonfun$submit(Execute.scala:262)
[error]         at sbt.ConcurrentRestrictions$$anon.$anonfun$submitValid(ConcurrentRestrictions.scala:174)
[error]         at sbt.CompletionService$$anon.call(CompletionService.scala:36)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (ProjectRef(uri("file:/work/dig/rocket-chip/"), "rocketchip") / update) sbt.librarymanagement.ResolveException: unresolved dependency: edu.berkeley.cs#chisel3_2.12;3.2-SNAPSHOT: not found
[error] unresolved dependency: edu.berkeley.cs#hardfloat_2.12;1.2: not found

我已经尝试将 hardfloat 的头部移动到 Jack Koenig 的提交 7903547 中,它添加了一些 crossScalaVersions 设置以支持 2.12.14,但没有帮助。

这是升级到 2.12 的已知不幸副作用。据我所知,这是由于 SBT 中对多项目构建的支持有些参差不齐,但无论如何,都可以解决。

如果你看一下我将 rocket-chip 升级到 2.12 (https://github.com/freechipsproject/rocket-chip/pull/1431) 的 PR,你会发现我必须在命令行上的每个 SBT 调用中添加 ++2.12.4 .这是在告诉 SBT 强制所有项目(包括子项目)使用 Scala 版本。到目前为止,我一直无法弄清楚如何在 build.sbt 文件中执行此操作(如果阅读本文的任何人知道更好的解决方案,请告诉我们!)。

如果您使用 SBT 交互 shell,您需要输入 ++2.12.4 作为第一个命令,例如

jack@myhost:/home/jack/rocket-chip$ java -Xmx2G -Xss8M -XX:MaxPermSize=256M -jar sbt-launch.jar
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /home/jack/rocket-chip/project
[info] Loading settings from build.sbt ...
[info] Loading settings from build.sbt ...
[info] Loading settings from build.sbt ...
Using addons: 
[info] Set current project to rocketchip (in build file:/home/jack/rocket-chip)
[info] sbt server started at local:///home/jack/.sbt/1.0/server/7022d9528c895b61c51d/sock
sbt:rocketchip> ++2.12.4
[info] Setting Scala version to 2.12.4 on 6 projects.
[info] Reapplying settings...
Using addons: 
[info] Set current project to rocketchip (in build file:/home/jack/rocket-chip)
sbt:rocketchip> compile
[success] Total time: 3 s, completed Aug 27, 2018 9:04:07 PM
sbt:rocketchip>