Skip to content

Commit

Permalink
Fix some hardcoded scala versions (#2768)
Browse files Browse the repository at this point in the history
The Scala version used in `MillBuildBootstrapModule` to compile the
`build.sc` was hardcoded to `2.13.10`. Instead, we want to always use
the same version we used to build that Mill version.

As an side effect, Mill is now compatible with new Java 21, due to the
use of a newer Scala version in the bootstrap process.

Pull request: #2768
  • Loading branch information
lefou authored Sep 20, 2023
1 parent e9bc504 commit 83d8be1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,14 @@ object main extends MillStableScalaModule with BuildInfo {
trait CaseModule extends ScalaModule with Cross.Module[String] {
def caseName = crossValue
object external extends ScalaModule {
def scalaVersion = "2.13.10"
def scalaVersion = Deps.scalaVersion
}

def moduleDeps = Seq(external)

val Array(prefix, suffix, rest) = caseName.split("-", 3)
def millSourcePath = super.millSourcePath / prefix / suffix / rest
def scalaVersion = "2.13.10"
def scalaVersion = Deps.scalaVersion
def ivyDeps = T {
if (!caseName.contains("realistic") && !caseName.contains("sourcecode")) super.ivyDeps()
else Agg(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ object WatchSourceInputTests extends IntegrationTestSuite {
val res = f(expectedOut, expectedErr, expectedShows)
val (shows, out) = res.out.linesIterator.toVector.partition(_.startsWith("\""))
val err = res.err.linesIterator.toVector
.filter(!_.contains("Compiling compiler interface..."))
.filter(!_.contains("Watching for changes"))
.filter(!_.contains("[info] compiling"))
.filter(!_.contains("[info] done compiling"))
Expand Down
4 changes: 2 additions & 2 deletions runner/src/mill/runner/MillBuildRootModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import coursier.Repository
import mill._
import mill.api.{PathRef, Result, internal}
import mill.define.{Discover, Task}
import mill.scalalib.{BoundDep, Dep, DepSyntax, Lib, ScalaModule}
import mill.scalalib.{Dep, DepSyntax, Lib, ScalaModule}
import mill.util.CoursierSupport
import mill.util.Util.millProjectModule
import mill.scalalib.api.Versions
Expand Down Expand Up @@ -41,7 +41,7 @@ class MillBuildRootModule()(implicit
override def millSourcePath = millBuildRootModuleInfo.projectRoot / os.up / "mill-build"
override def intellijModulePath: os.Path = millSourcePath / os.up

override def scalaVersion: T[String] = "2.13.10"
override def scalaVersion: T[String] = BuildInfo.scalaVersion

/**
* All script files (that will get wrapped later)
Expand Down

0 comments on commit 83d8be1

Please sign in to comment.