SpinalHDL / SpinalTemplateSbt

A basic SpinalHDL project
77 stars 64 forks source link

update mill and sbt version #42

Closed samuelgruetter closed 3 weeks ago

samuelgruetter commented 4 weeks ago

When trying to start sbt, I got the following error:

...
https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.10.2/sbt-launch-1.10.2.jar
  100.0% [##########] 3.7 MiB (20.4 MiB / s)
[info] [launcher] getting org.scala-sbt sbt 1.6.0  (this may take some time)...
[info] [launcher] getting Scala 2.12.15 (for sbt)...
[info] welcome to sbt 1.6.0 (Ubuntu Java 21.0.4)
error:
  bad constant pool index: 0 at pos: 48454
     while compiling: <no file>
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.12.15
    compiler version: version 2.12.15
  reconstructed args: -classpath /home/sam/.sbt/boot/scala-2.12.15/lib/scala-library.jar -Yrangepos
...

And when running mill resolve _:

Compiling /home/sam/ethz-git/SpinalHDLTests/TestSpinalProject/build.sc
scala.reflect.internal.FatalError: 
  bad constant pool index: 0 at pos: 48454
     while compiling: <no file>
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.13.5
    compiler version: version 2.13.5
  reconstructed args: -nowarn -Xmaxwarns 0 -Yresolve-term-conflict:object

  last tree to typer: EmptyTree
       tree position: <unknown>
            tree tpe: <notype>
              symbol: null
           call site: <none> in <none>
...

Googling this error suggests that Scala versions 2.12.15 and 2.13.5 are too old and using a more recent Scala version would fix the problem. The project's Scala version is already quite recent (2.13.14), so why are there still such old Scala versions being run? It turns out that these old Scala versions are used in order to run old sbt and mill versions: project/build.properties says sbt.version=1.6.0, which is from 2021, and .mill-version refers to mill 0.9.8, which is also from 2021.

In this PR, I updated the sbt and mill version to the most recent one, and with this change, the two errors above don't occur any more for me.

Dolu1990 commented 3 weeks ago

Thanks :D