Merge pull request #7760 from Friendseeker/bump-ci-JDK-21

[1.x] Bump CI to JDK 21
This commit is contained in:
eugene yokota 2024-10-18 00:32:28 -04:00 committed by GitHub
commit 65a87acb18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 73 additions and 71 deletions

View File

@ -13,23 +13,23 @@ jobs:
matrix:
include:
- os: ubuntu-20.04
java: 17
java: 21
distribution: temurin
jobtype: 1
- os: ubuntu-latest
java: 17
java: 21
distribution: temurin
jobtype: 2
- os: ubuntu-latest
java: 17
java: 21
distribution: temurin
jobtype: 3
- os: ubuntu-latest
java: 17
java: 21
distribution: temurin
jobtype: 4
- os: ubuntu-latest
java: 17
java: 21
distribution: temurin
jobtype: 5
- os: ubuntu-latest
@ -143,7 +143,7 @@ jobs:
if: ${{ matrix.jobtype == 5 }}
shell: bash
run: |
./sbt -v "++2.13.x; all utilControl/test utilRelation/test utilPosition/test; ++$SCALA_3!; all utilControl/test utilRelation/test utilPosition/test"
./sbt -v "++2.13.x; all utilControl/test utilRelation/test utilPosition/test"
- name: Build and test (6)
if: ${{ matrix.jobtype == 6 }}
shell: bash

View File

@ -1 +1 @@
sbt.version=1.10.0
sbt.version=1.10.1

View File

@ -2,13 +2,13 @@ scalaVersion := "2.12.20"
lazy val core = project
.settings(
crossScalaVersions := Seq("2.12.20", "3.0.2", "3.1.2")
crossScalaVersions := Seq("2.12.20", "3.3.1", "3.5.1")
)
lazy val subproj = project
.dependsOn(core)
.settings(
crossScalaVersions := Seq("2.12.20", "3.1.2"),
crossScalaVersions := Seq("2.12.20", "3.5.1"),
// a random library compiled against Scala 3.1
libraryDependencies += "org.http4s" %% "http4s-core" % "0.23.12"
libraryDependencies += "org.http4s" %% "http4s-core" % "0.23.28"
)

View File

@ -1,14 +1,14 @@
> ++3.0.2 compile
> ++3.3.1 compile
$ exists core/target/scala-3.0.2
-$ exists core/target/scala-3.1.2
-$ exists subproj/target/scala-3.0.2
-$ exists subproj/target/scala-3.1.2
$ exists core/target/scala-3.3.1
-$ exists core/target/scala-3.5.1
-$ exists subproj/target/scala-3.3.1
-$ exists subproj/target/scala-3.5.1
> clean
> ++3.1.2 compile
> ++3.5.1 compile
-$ exists core/target/scala-3.0.2
$ exists core/target/scala-3.1.2
-$ exists subproj/target/scala-3.0.2
$ exists subproj/target/scala-3.1.2
-$ exists core/target/scala-3.3.1
$ exists core/target/scala-3.5.1
-$ exists subproj/target/scala-3.3.1
$ exists subproj/target/scala-3.5.1

View File

@ -1,7 +1,7 @@
TaskKey[Unit]("checkJavaFailures") := {
val reporter = savedReporter.value
val ignore = (compile in Compile).failure.value
val ps = reporter.problems
val ps = reporter.problems.filter(_.severity() != xsbti.Severity.Info)
assert(!ps.isEmpty, "Failed to report any problems!")
// First error should be on a specific line/file
val first = ps(0)

View File

@ -1,16 +1,24 @@
import scala.quoted.* // imports Quotes, Expr
package scala.collection {
object Exp:
// added in 2.13.10, not available in 2.13.8
def m(i: Int) = IterableOnce.checkArraySizeWithinVMLimit(i)
package scala.collection.immutable {
object Exp {
// Access RedBlackTree.validate and Tree class added in Scala 2.13.13
// Scala 3.3.4 uses Scala 2.13.14 library
// Scala 3.3.2 uses Scala 2.13.12 library
// Hence RedBlackTree.validate is available in 3.3.4 but not in 3.3.2
// c.c. https://mvnrepository.com/artifact/org.scala-lang/scala3-library_3/3.3.2
// c.c. https://mvnrepository.com/artifact/org.scala-lang/scala3-library_3/3.3.4
def validateTree[A](tree: RedBlackTree.Tree[A, _])(implicit ordering: Ordering[A]): tree.type = {
RedBlackTree.validate(tree)
}
}
}
object Mac:
inline def inspect(inline x: Any): Any = ${ inspectCode('x) }
def inspectCode(x: Expr[Any])(using Quotes): Expr[Any] =
scala.collection.Exp.m(42)
scala.collection.immutable.Exp.validateTree(null)(null)
println(x.show)
x

View File

@ -1,26 +1,26 @@
import sbt.librarymanagement.InclExclRule
lazy val a = project.settings(
scalaVersion := "2.13.6",
scalaVersion := "2.13.11",
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
TaskKey[Unit]("checkLibs") := checkLibs("2.13.6", (Compile/dependencyClasspath).value, ".*scala-(library|reflect).*"),
TaskKey[Unit]("checkLibs") := checkLibs("2.13.11", (Compile/dependencyClasspath).value, ".*scala-(library|reflect).*"),
)
lazy val b = project.dependsOn(a).settings(
scalaVersion := "2.13.8",
TaskKey[Unit]("checkLibs") := checkLibs("2.13.8", (Compile/dependencyClasspath).value, ".*scala-(library|reflect).*"),
scalaVersion := "2.13.12",
TaskKey[Unit]("checkLibs") := checkLibs("2.13.12", (Compile/dependencyClasspath).value, ".*scala-(library|reflect).*"),
)
lazy val a3 = project.settings(
scalaVersion := "3.2.2", // 2.13.10 library
scalaVersion := "3.3.4", // 2.13.14 library
)
lazy val b3 = project.dependsOn(a3).settings(
scalaVersion := "3.2.0", // 2.13.8 library
scalaVersion := "3.3.2", // 2.13.12 library
TaskKey[Unit]("checkScala") := {
val i = scalaInstance.value
i.libraryJars.filter(_.toString.contains("scala-library")).toList match {
case List(l) => assert(l.toString.contains("2.13.10"), i.toString)
case List(l) => assert(l.toString.contains("2.13.14"), i.toString)
}
assert(i.compilerJars.filter(_.toString.contains("scala-library")).isEmpty, i.toString)
assert(i.otherJars.filter(_.toString.contains("scala-library")).isEmpty, i.toString)

View File

@ -2,17 +2,17 @@
> b/checkLibs
> b/run
$ exists s2.13.8.txt
$ delete s2.13.8.txt
$ exists s2.13.12.txt
$ delete s2.13.12.txt
# don't crash when expanding the macro
> b3/run
$ exists s2.13.10.txt
$ delete s2.13.10.txt
$ exists s2.13.14.txt
$ delete s2.13.14.txt
> b3/checkScala
# without the default `csrSameVersions`, scala-reflect in b stays at 2.13.6
# without the default `csrSameVersions`, scala-reflect in b stays at 2.13.11
> set b/csrSameVersions := Nil
> b/update
-> b/checkLibs

View File

@ -1,4 +1,4 @@
val scala3Version = "3.0.1-RC1-bin-20210525-8f3fdf5-NIGHTLY"
val scala3Version = "3.3.4"
enablePlugins(ScalaJSPlugin)

View File

@ -1 +1 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")

View File

@ -1,15 +1,15 @@
ThisBuild / scalaVersion := "2.13.12"
ThisBuild / scalaVersion := "2.13.15"
ThisBuild / scalacOptions += "-Ytasty-reader"
lazy val scala3code = project
.enablePlugins(ScalaJSPlugin)
.settings(scalaVersion := "3.1.3")
.settings(scalaVersion := "3.3.4")
lazy val app = project
.enablePlugins(ScalaJSPlugin)
.dependsOn(scala3code)
.settings(
libraryDependencies ~= (_.filterNot(_.name.contains("scalajs-compiler"))),
addCompilerPlugin("org.scala-js" % "scalajs-compiler_2.13.8" % scalaJSVersion),
addCompilerPlugin("org.scala-js" % "scalajs-compiler_2.13.15" % scalaJSVersion),
scalaJSUseMainModuleInitializer := true,
)

View File

@ -1 +1 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")

View File

@ -1,7 +1,7 @@
ThisBuild / scalaVersion := "3.1.3"
ThisBuild / scalaVersion := "3.3.4"
ThisBuild / scalacOptions += "-Ytasty-reader"
lazy val scala213 = "2.13.12"
lazy val scala213 = "2.13.15"
lazy val root = (project in file("."))
.aggregate(fooApp, fooCore, barApp, barCore)

View File

@ -1 +1 @@
ThisBuild / scalaVersion := "3.1.3"
ThisBuild / scalaVersion := "3.3.4"

View File

@ -1,4 +1,4 @@
ThisBuild / scalaVersion := "2.13.1"
ThisBuild / scalaVersion := "2.13.15"
lazy val root = (project in file("."))
.aggregate(macroProvider, macroClient)

View File

@ -1 +1 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")

View File

@ -1,3 +1,3 @@
scalaVersion := "3.0.0-RC2-bin-20210328-cca5f8f-NIGHTLY"
scalaVersion := "3.3.4"
name := "foo"
version := "1.0.0"

View File

@ -1,7 +1,7 @@
> compile
$ exists target/scala-3.0.0-RC2-bin-20210328-cca5f8f-NIGHTLY/classes/Foo$.class
$ exists target/scala-3.3.4/classes/Foo$.class
> package
$ exists target/scala-3.0.0-RC2-bin-20210328-cca5f8f-NIGHTLY/foo_3.0.0-RC2-1.0.0.jar
$ exists target/scala-3.3.4/foo_3-1.0.0.jar

View File

@ -1,15 +1,15 @@
ThisBuild / scalaVersion := "2.13.6"
ThisBuild / scalaVersion := "2.13.15"
ThisBuild / scalacOptions += "-Ytasty-reader"
lazy val scala3code = project
.enablePlugins(ScalaJSPlugin)
.settings(scalaVersion := "3.0.0")
.settings(scalaVersion := "3.3.4")
lazy val app = project
.enablePlugins(ScalaJSPlugin)
.dependsOn(scala3code)
.settings(
scalaVersion := "2.13.6",
scalaVersion := "2.13.15",
scalacOptions += "-Ytasty-reader",
scalaJSUseMainModuleInitializer := true
)

View File

@ -1 +1 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")

View File

@ -1,6 +1,6 @@
ThisBuild / scalaVersion := "3.0.0"
ThisBuild / scalaVersion := "3.3.4"
lazy val scala213 = "2.13.6"
lazy val scala213 = "2.13.15"
lazy val root = (project in file("."))
.aggregate(fooApp, fooCore, barApp, barCore)

View File

@ -1,6 +1,6 @@
# This tests that this sbt scripted plugin can launch the previous one
> ^^0.13.18
> ^^1.10.1
$ copy-file changes/A.scala src/sbt-test/a/b/A.scala
> scripted

View File

@ -16,11 +16,8 @@ class ZincComponentCompilerSpec extends IvyBridgeProviderSpecification {
val scala2106 = "2.10.6"
val scala2118 = "2.11.8"
val scala21111 = "2.11.11"
val scala2121 = "2.12.1"
val scala2122 = "2.12.2"
val scala2123 = "2.12.3"
val scala2130 = "2.13.0"
val scala2131 = "2.13.1"
val scala21220 = "2.12.20"
val scala21311 = "2.13.11"
def isJava8: Boolean = sys.props("java.specification.version") == "1.8"
@ -40,14 +37,11 @@ class ZincComponentCompilerSpec extends IvyBridgeProviderSpecification {
} else ()
}
it should "compile the bridge for Scala 2.12.2" in { implicit td =>
IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2121) should exist)
IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2122) should exist)
IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2123) should exist)
it should "compile the bridge for Scala 2.12.20" in { implicit td =>
IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala21220) should exist)
}
it should "compile the bridge for Scala 2.13" in { implicit td =>
IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2130) should exist)
IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2131) should exist)
it should "compile the bridge for Scala 2.13.11" in { implicit td =>
IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala21311) should exist)
}
}