[2.x] Scala 3.9.0 (#9439)

Use Scala 3.9.0 for metabuild.
This commit is contained in:
eugene yokota
2026-08-27 01:44:57 -04:00
committed by GitHub
parent 9595cd4204
commit a62c3d62f4
66 changed files with 89 additions and 76 deletions
+7
View File
@@ -436,6 +436,13 @@ lazy val utilScripted = (project in file("internal") / "util-scripted")
name := "Util Scripted",
libraryDependencies += scalaParsers,
mimaSettings,
mimaBinaryIssueFilters ++= Vector(
exclude[DirectMissingMethodProblem](
"sbt.internal.scripted.BasicStatementHandler.initialState"
),
exclude[IncompatibleResultTypeProblem]("sbt.internal.scripted.CommentHandler.initialState"),
exclude[IncompatibleResultTypeProblem]("sbt.internal.scripted.FileCommands.initialState"),
),
)
.configure(addSbtIO)
/* **** Intermediate-level Modules **** */
@@ -108,8 +108,9 @@ class Eval(
val header =
imports.strings.mkString("\n") +
s"""
|object $moduleName {
| def $WrapValName${returnType} = {""".stripMargin
|@scala.annotation.nowarn("name=IllegalIdentifier")
|object `$moduleName` {
| def `$WrapValName`${returnType} = {""".stripMargin
val contents = s"""$header
|$expression
| }
@@ -171,7 +172,8 @@ class Eval(
val header =
imports.strings.mkString("\n") +
s"""
|object $moduleName {""".stripMargin
|@scala.annotation.nowarn("name=IllegalIdentifier")
|object `$moduleName` {""".stripMargin
val contents =
s"""$header
|${definitions.map(_._1).mkString("\n")}
+2 -2
View File
@@ -28,7 +28,7 @@ Create an initial build in `something`. Like a real build using sbt. I'm sure yo
```scala
name := "foo"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
```
I also have `Hello.scala`:
@@ -107,7 +107,7 @@ import scala.sys.process.Process
lazy val check = taskKey[Unit]("check")
name := "foo"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
check := {
val pkg = (Compile / packageBin).value
val conv = fileConverter.value
@@ -19,7 +19,7 @@ trait StatementHandler {
trait BasicStatementHandler extends StatementHandler {
final type State = Unit
final def initialState = ()
final def initialState: State = ()
final def apply(command: String, arguments: List[String], state: Unit): Unit =
apply(command, arguments)
@@ -87,7 +87,7 @@ object WorkerExchange:
inputRef.success(out)
val scanner = Scanner(in, "UTF-8")
while scanner.hasNextLine() do notifyListeners(scanner.nextLine())
val (connArgs, closer): (Seq[String], Option[AutoCloseable]) = connectionType match
val (connArgs, closer) = connectionType match
case WorkerConnection.Tcp =>
val serverSocket = Retry(ServerSocket(0, 1, loopback))
val accepter = Thread(() => {
+1 -1
View File
@@ -3,7 +3,7 @@ import Keys.*
object Dependencies {
// WARNING: Please Scala update versions in PluginCross.scala too
val scala3 = "3.8.4"
val scala3 = "3.9.0"
val scala212 = "2.12.21"
val baseScalaVersion = scala3
def nightlyVersion: Option[String] =
+1 -1
View File
@@ -5,7 +5,7 @@ lazy val checkMiss = inputKey[Unit]("")
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
checkMiss := {
val expected: Int = (Space ~> NatBasic).parsed
val s = streams.value
+1 -1
View File
@@ -5,7 +5,7 @@ lazy val verify = "com.eed3si9n.verify" %% "verify" % "1.0.0"
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
libraryDependencies += verify % Test
testFrameworks += new TestFramework("verify.runner.Framework")
@@ -13,7 +13,7 @@ Global / localCacheDirectory := baseDirectory.value / "diskcache"
lazy val compileClassesRestore = project
.in(file("."))
.settings(
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
)
delClasses := Def.uncached {
+1 -1
View File
@@ -1,5 +1,5 @@
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
val denyClassDir = taskKey[Unit]("Remove write permission from the compile output dir")
denyClassDir := {
@@ -31,7 +31,7 @@ def recorded(kind: String) = Def.task {
}
Global / localCacheDirectory := (ThisBuild / baseDirectory).value / "diskcache"
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
ThisBuild / exportJars := true
lazy val a = project.in(file("a"))
+1 -1
View File
@@ -14,7 +14,7 @@ Global / localCacheDirectory := baseDirectory.value / "diskcache"
lazy val inputOrder = project
.in(file("."))
.settings(
scalaVersion := "3.8.4",
scalaVersion := "3.9.0",
// Reversing stands in for a second filesystem's readdir order, which is the only part of
// this that cannot be reproduced on a single machine.
Compile / sources := {
@@ -1,6 +1,6 @@
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
// packageInternal is used for the Compile/Test-time internal classpath (what app compiles
// against), so a dependency's version bump alone doesn't bust downstream compile caches.
+1 -1
View File
@@ -3,7 +3,7 @@ import complete.DefaultParsers.*
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
lazy val checkMiss = inputKey[Unit]("Assert the exact onsite/miss count of the previous run")
@@ -3,7 +3,7 @@ ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-c
name := "lib1"
organization := "com.example"
version := "0.1.0-SNAPSHOT"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
val publishRepoBase = settingKey[File]("Base directory for publish repo (HTTP server writes here)")
publishRepoBase := baseDirectory.value / "repo"
@@ -3,7 +3,7 @@ ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-c
name := "lib1"
organization := "com.example"
version := "0.1.0-SNAPSHOT"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
// Use a fixed path for local ivy repo to avoid sbt 2.x output sharding
val ivyLocalBase = settingKey[File]("Local Ivy repository base")
@@ -1,7 +1,7 @@
ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-cache"
ThisBuild / organization := "com.example"
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
val publishRepoBase = settingKey[File]("Base directory for Maven publish repo (HTTP server writes here)")
ThisBuild / publishRepoBase := (ThisBuild / baseDirectory).value / "repo"
@@ -3,7 +3,7 @@ ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-c
name := "lib1"
organization := "com.example"
version := "0.1.0-SNAPSHOT"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
publishMavenStyle := true
val publishRepoBase = settingKey[File]("Base directory for Maven publish repo")
@@ -3,7 +3,7 @@ ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-c
name := "lib1"
organization := "com.example"
version := "0.1.0-SNAPSHOT"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
// Publish to a file repo (tests ivyless publish without HTTP server)
val publishRepoBase = settingKey[File]("Base directory for publish repo")
@@ -1,7 +1,7 @@
ThisBuild / organization := "com.example"
name := "testproj"
version := "0.1.0-SNAPSHOT"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
platform := "native0.5"
crossVersion := CrossVersion.binary
@@ -3,7 +3,7 @@
ThisBuild / organization := "com.example"
ThisBuild / version := "0.1.0"
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-cache"
lazy val mavenRepo = settingKey[File]("shared local Maven repo for the consume round-trip")
@@ -2,7 +2,7 @@ import java.nio.file.Files
name := "clean-symlinks-test"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
TaskKey[Unit]("createSymlinkedDirectory") := {
IO.createDirectory(target.value)
@@ -1,4 +1,4 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
organization := "com.example"
+1 -1
View File
@@ -3,7 +3,7 @@ Global / pgpSecretRing := baseDirectory.value / "secring.pgp"
Global / pgpPublicRing := baseDirectory.value / "pubring.pgp"
Global / useGpg := false
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
organization := "com.example"
name := "app"
version := "1.0"
@@ -19,4 +19,4 @@ lazy val plugin = (projectMatrix in file("plugin"))
case _ => "2.0.0-RC3"
},
)
.jvmPlatform(scalaVersions = Seq("3.8.4", "2.12.21"))
.jvmPlatform(scalaVersions = Seq("3.9.0", "2.12.21"))
@@ -1,4 +1,4 @@
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
name := "hello"
enablePlugins(JavaAppPackaging)
@@ -10,7 +10,7 @@ enablePlugins(UniversalDeployPlugin)
lazy val check = taskKey[Unit]("")
check := {
val cmd = "target/out/jvm/scala-3.8.4/hello/universal/stage/bin/hello"
val cmd = "target/out/jvm/scala-3.9.0/hello/universal/stage/bin/hello"
val cmd0 =
if (sys.props("os.name").toLowerCase(java.util.Locale.ROOT).contains("windows"))
cmd + ".bat"
@@ -11,4 +11,4 @@
[error] 3 |case class A()
[error] |^^^^^^^^^^^^^^
[error] |Defining types in *.sbt file is not supported
[error] an error in expression: class dotty.tools.dotc.reporting.Diagnostic$Error at BASE/build.sbt:[980..991..994] L3: Defining types in *.sbt file is not supported
[error] an error in expression: class dotty.tools.dotc.reporting.Diagnostic$Error at BASE/build.sbt:[OFFSET] L3: Defining types in *.sbt file is not supported
@@ -1,3 +1,3 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
class A
@@ -1,3 +1,3 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
case class A()
@@ -1,4 +1,4 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
enum A:
case B
@@ -1,7 +1,7 @@
import complete.DefaultParsers.{ *, given }
LocalRootProject / name := "hello"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
autoScalaLibrary := false
crossPaths := false
@@ -36,7 +36,11 @@ exportFailedSessionLog := Def.uncached {
logLines(lastLog :: Nil)
.foldLeft(List(List.empty[String])) { (acc, line) =>
if line.contains("welcome to sbt") then Nil :: acc
else (line.replace(b, "BASE").replaceAll(" -{4,}$", "") :: acc.head) :: acc.tail
else
(line
.replace(b, "BASE")
.replaceAll(" -{4,}$", "")
.replaceAll("""\[\d+\.\.\d+\.\.\d+\]""", "[OFFSET]") :: acc.head) :: acc.tail
}
.map(_.reverse)
.reverse
@@ -11,4 +11,4 @@
[error] 3 |class A
[error] |^^^^^^^
[error] |Defining types in *.sbt file is not supported
[error] an error in expression: class dotty.tools.dotc.reporting.Diagnostic$Error at BASE/build.sbt:[980..986..987] L3: Defining types in *.sbt file is not supported
[error] an error in expression: class dotty.tools.dotc.reporting.Diagnostic$Error at BASE/build.sbt:[OFFSET] L3: Defining types in *.sbt file is not supported
@@ -13,4 +13,4 @@
[error] |Defining types in *.sbt file is not supported
[error] |
[error] 4 | case B
[error] an error in expression: class dotty.tools.dotc.reporting.Diagnostic$Error at BASE/build.sbt:[980..985..996] L3: Defining types in *.sbt file is not supported
[error] an error in expression: class dotty.tools.dotc.reporting.Diagnostic$Error at BASE/build.sbt:[OFFSET] L3: Defining types in *.sbt file is not supported
@@ -3,7 +3,7 @@ lazy val foo = project
@transient
lazy val check = taskKey[Unit]("")
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
LocalRootProject / check := {
assert((foo / Compile / scalacOptions).value == List("-Xmacro-settings:a:a"),
s"${(foo / Compile / scalacOptions).value}")
@@ -1,4 +1,4 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
@deprecated
def foo = true
@@ -1,4 +1,4 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
@deprecated
def foo = true
@@ -1,5 +1,5 @@
lazy val scala3_LTS = "3.3.5"
lazy val scala3_current = "3.8.4"
lazy val scala3_current = "3.9.0"
lazy val check = taskKey[Unit]("")
organization := "com.example"
@@ -1,4 +1,4 @@
> packageBin
$ exists target/**/app_3.3.5-0.1.0-SNAPSHOT.jar
$ exists target/**/app_3.8.4-0.1.0-SNAPSHOT.jar
> core3_8_4/check
$ exists target/**/app_3.9.0-0.1.0-SNAPSHOT.jar
> core3_9_0/check
@@ -1,5 +1,5 @@
// https://github.com/sbt/sbt/issues/8971
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
lazy val extLib = ProjectRef(file("ext/lib"), "lib")
@@ -1,7 +1,7 @@
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
lazy val lib = (projectMatrix in file("."))
.settings(
name := "lib",
)
.jvmPlatform(scalaVersions = Seq("3.8.4"))
.jvmPlatform(scalaVersions = Seq("3.9.0"))
@@ -1,4 +1,4 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
crossPaths := false
name := "definition-lib-forname-test"
version := "1.0"
@@ -1,4 +1,4 @@
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
ThisBuild / organization := "com.example"
libraryDependencies += "com.typesafe" % "config" % "1.4.5"
@@ -1,6 +1,6 @@
lazy val a1 = settingKey[Boolean]("")
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
a1 := true
Compile / sourceGenerators += {
@@ -1 +1 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
@@ -11,7 +11,7 @@ lazy val intsSetting2 = Def.setting {
Seq(1, 2, 3)
}
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
intsTask := Seq(1, 2, 3, 4, 5, 6, 7)
intsTask -= 3
@@ -30,10 +30,10 @@ intsSetting -= intSetting2.value
intsSetting --= intsSetting2.value
intsFromScalaV := Seq(1, 2, 3, 4, 5, 6, 7)
intsFromScalaV -= { if scalaVersion.value == "3.8.4" then 3 else 5 }
intsFromScalaV --= { if scalaVersion.value == "3.8.4" then Seq(1, 2) else Seq(4) }
intsFromScalaV -= { if scalaVersion.value == "3.8.4" then Option(6) else None }
intsFromScalaV --= { if scalaVersion.value == "3.8.4" then Option(7) else None }
intsFromScalaV -= { if scalaVersion.value == "3.9.0" then 3 else 5 }
intsFromScalaV --= { if scalaVersion.value == "3.9.0" then Seq(1, 2) else Seq(4) }
intsFromScalaV -= { if scalaVersion.value == "3.9.0" then Option(6) else None }
intsFromScalaV --= { if scalaVersion.value == "3.9.0" then Option(7) else None }
intsSetSetting := Set(1, 2, 3, 4, 5, 6, 7)
intsSetSetting -= 3
@@ -1,4 +1,4 @@
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
lazy val markerFile = settingKey[java.io.File]("marker file written by consoleProject REPL when bindings resolve")
@@ -1 +1 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
@@ -1,7 +1,7 @@
// Regression test for #8921: pipelining flags must not leak into console/scalacOptions.
ThisBuild / usePipelining := true
ThisBuild / scalaVersion := "3.8.1"
ThisBuild / scalaVersion := "3.9.0"
val checkConsoleScalacOptions = taskKey[Unit](
"Fails if console/scalacOptions still contains pipelining flags (-Ypickle-java / -Ypickle-write)"
@@ -1,6 +1,6 @@
import sbt.internal.util.CacheEventSummary
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
Global / remoteCache := Some(new java.net.URI("grpc://127.0.0.1:2024"))
Global / localCacheDirectory := baseDirectory.value / "diskcache"
@@ -1,4 +1,4 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
@transient
lazy val check = taskKey[Unit]("")
@@ -1,4 +1,4 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
@transient
lazy val check = taskKey[Unit]("")
@@ -1,6 +1,6 @@
import sbt.internal.bsp.OutputPathsItem
ThisBuild / scalaVersion := "3.8.2"
ThisBuild / scalaVersion := "3.9.0"
name := "bsp-output-paths-cache"
@@ -1,6 +1,6 @@
val scalatest = "org.scalatest" %% "scalatest" % "3.2.19"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
Test / fork := true
libraryDependencies += scalatest % Test
@@ -1,6 +1,6 @@
val munit = "org.scalameta" %% "munit" % "1.0.4"
scalaVersion := "3.8.2"
scalaVersion := "3.9.0"
libraryDependencies += munit % Test
Test / fork := true
@@ -1,5 +1,5 @@
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
Test / fork := true
@@ -1,6 +1,6 @@
val scalatest = "org.scalatest" %% "scalatest" % "3.2.19"
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
lazy val root = (project in file("."))
+1 -1
View File
@@ -12,7 +12,7 @@ def groupId(idx: Int) = "group_" + (idx + 1)
def groupPrefix(idx: Int) = groupId(idx) + "_file_"
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
organization := "com.example"
lazy val root = rootProject
+1 -1
View File
@@ -1,5 +1,5 @@
val scalatest = "org.scalatest" %% "scalatest" % "3.2.19"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
fork := true
libraryDependencies += scalatest % Test
@@ -1,3 +1,3 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
libraryDependencies += "com.eed3si9n.verify" %% "verify" % "1.0.0" % Test
testFrameworks += new TestFramework("verify.runner.Framework")
+1 -1
View File
@@ -1,5 +1,5 @@
val munit = "org.scalameta" %% "munit" % "1.0.4"
scalaVersion := "3.8.2"
scalaVersion := "3.9.0"
lazy val root = rootProject
.settings(
@@ -1,3 +1,3 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
val munit = "org.scalameta" %% "munit" % "1.0.4"
libraryDependencies += munit % Test
+1 -1
View File
@@ -6,7 +6,7 @@ val marker = new File("marker")
val check = TaskKey[Unit]("check", "Check correct error has been returned.")
val scalatest = "org.scalatest" %% "scalatest" % "3.2.19"
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
lazy val root = (project in file(".")).
settings(
@@ -1,2 +1,2 @@
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test
@@ -1,5 +1,5 @@
val munit = "org.scalameta" %% "munit" % "1.0.4"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
lazy val root = rootProject
.settings(
@@ -2,7 +2,7 @@ import sbt.*
import sbt.Tests.Output
import sbt.util.Logger
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / scalaVersion := "3.9.0"
val marker = file("test-result-logger-ran")
val verify = "com.eed3si9n.verify" %% "verify" % "1.0.0"
@@ -1,6 +1,6 @@
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.8.4"
scalaVersion := "3.9.0"
val munit = "org.scalameta" %% "munit" % "1.0.4"