From 3e54140316ec6db06e63b049afadc07f7701b5b9 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 26 Feb 2024 14:32:18 -0800 Subject: [PATCH 1/6] use Scala 2.13.13 stdlib (was .12) --- community-build/community-projects/stdLib213 | 2 +- project/Build.scala | 6 +++--- project/MiMaFilters.scala | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/community-build/community-projects/stdLib213 b/community-build/community-projects/stdLib213 index 6243e902928c..fcc67cd56c67 160000 --- a/community-build/community-projects/stdLib213 +++ b/community-build/community-projects/stdLib213 @@ -1 +1 @@ -Subproject commit 6243e902928c344fb0e82e21120bb257f08a2af2 +Subproject commit fcc67cd56c67851bf31019ec25ccb09d08b9561b diff --git a/project/Build.scala b/project/Build.scala index b4e9989a2e9c..8ccac07159a5 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -124,8 +124,8 @@ object Build { * scala-library. */ def stdlibVersion(implicit mode: Mode): String = mode match { - case NonBootstrapped => "2.13.12" - case Bootstrapped => "2.13.12" + case NonBootstrapped => "2.13.13" + case Bootstrapped => "2.13.13" } val dottyOrganization = "org.scala-lang" @@ -1141,7 +1141,7 @@ object Build { .exclude("org.eclipse.lsp4j","org.eclipse.lsp4j.jsonrpc"), "org.eclipse.lsp4j" % "org.eclipse.lsp4j" % "0.20.1", ), - libraryDependencies += ("org.scalameta" % "mtags-shared_2.13.12" % mtagsVersion % SourceDeps), + libraryDependencies += ("org.scalameta" % "mtags-shared_2.13.13" % mtagsVersion % SourceDeps), ivyConfigurations += SourceDeps.hide, transitiveClassifiers := Seq("sources"), Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Ysafe-init"), diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 03b8e93639bc..112a5601615c 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -14,10 +14,6 @@ object MiMaFilters { ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"), ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$relaxedExtensionImports$"), // end of New experimental features in 3.3.X - - // New in 2.13.12 -- can be removed once scala/scala#10549 lands in 2.13.13 - // and we take the upgrade here - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.MapNodeRemoveAllSetNodeIterator.next"), ) val TastyCore: Seq[ProblemFilter] = Seq( ) From 5394674b673ecb137fd10d9c9a9a907ce29af88b Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Wed, 10 Jul 2024 09:17:29 +0200 Subject: [PATCH 2/6] use Scala 2.13.13 stdlib (was .12) [Cherry-picked cc2dd1ec43f0f6cef282033a1754c506cd417ad7][modified] From 5ffd8de77a4e6d08f61071587578b3ffd57ff149 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Wed, 10 Jul 2024 09:18:34 +0200 Subject: [PATCH 3/6] Upgrade Scala 2 to 2.13.14 [Cherry-picked e81b4a3b7c88223af8d262c86d5c798a20f0d0eb][modified] --- project/Build.scala | 6 +++--- project/MiMaFilters.scala | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 8ccac07159a5..72f51a680f22 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -124,8 +124,8 @@ object Build { * scala-library. */ def stdlibVersion(implicit mode: Mode): String = mode match { - case NonBootstrapped => "2.13.13" - case Bootstrapped => "2.13.13" + case NonBootstrapped => "2.13.14" + case Bootstrapped => "2.13.14" } val dottyOrganization = "org.scala-lang" @@ -1141,7 +1141,7 @@ object Build { .exclude("org.eclipse.lsp4j","org.eclipse.lsp4j.jsonrpc"), "org.eclipse.lsp4j" % "org.eclipse.lsp4j" % "0.20.1", ), - libraryDependencies += ("org.scalameta" % "mtags-shared_2.13.13" % mtagsVersion % SourceDeps), + libraryDependencies += ("org.scalameta" % "mtags-shared_2.13.14" % mtagsVersion % SourceDeps), ivyConfigurations += SourceDeps.hide, transitiveClassifiers := Seq("sources"), Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Ysafe-init"), diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 112a5601615c..65dfb895054e 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -14,6 +14,12 @@ object MiMaFilters { ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"), ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$relaxedExtensionImports$"), // end of New experimental features in 3.3.X + + // New in 2.13.13 + "scala.collection.mutable.ArrayBuffer.resizeUp", // private[mutable] def + // New in 2.13.14 + "scala.util.Properties.consoleIsTerminal", // private[scala] lazy val + // end of new in Scala 2 ) val TastyCore: Seq[ProblemFilter] = Seq( ) From 5f9126f79bf5236a13b2f0e185efe174b8aefd17 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Wed, 10 Jul 2024 09:25:37 +0200 Subject: [PATCH 4/6] Phiscally remove the ignored Scala 2 library-aux files instead of filtering them out in `Compile / sources` (not reliable, for some reasone the AnyRef.scala was still compiled) [Cherry-picked 2a142cd5d49a050cee78b860d1428679cee0a2a1][modified] --- project/Build.scala | 16 +++++++++++++++- project/MiMaFilters.scala | 13 ++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 72f51a680f22..9c3b13a01fc6 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1002,7 +1002,21 @@ object Build { IO.createDirectory(trgDir) IO.unzip(scalaLibrarySourcesJar, trgDir) - ((trgDir ** "*.scala") +++ (trgDir ** "*.java")).get.toSet + val (ignoredSources, sources) = + ((trgDir ** "*.scala") +++ (trgDir ** "*.java")).get.toSet + .partition{file => + // sources from https://github.com/scala/scala/tree/2.13.x/src/library-aux + val path = file.getPath.replace('\\', '/') + path.endsWith("scala-library-src/scala/Any.scala") || + path.endsWith("scala-library-src/scala/AnyVal.scala") || + path.endsWith("scala-library-src/scala/AnyRef.scala") || + path.endsWith("scala-library-src/scala/Nothing.scala") || + path.endsWith("scala-library-src/scala/Null.scala") || + path.endsWith("scala-library-src/scala/Singleton.scala") + } + // These sources should be never compiled, filtering them out was not working correctly sometimes + ignoredSources.foreach(_.delete()) + sources } (Set(scalaLibrarySourcesJar)).toSeq }.taskValue, (Compile / sourceGenerators) += Def.task { diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 65dfb895054e..24d3c8cedbdb 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -14,13 +14,12 @@ object MiMaFilters { ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"), ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$relaxedExtensionImports$"), // end of New experimental features in 3.3.X - - // New in 2.13.13 - "scala.collection.mutable.ArrayBuffer.resizeUp", // private[mutable] def - // New in 2.13.14 - "scala.util.Properties.consoleIsTerminal", // private[scala] lazy val - // end of new in Scala 2 - ) + ) ++ Seq( + // New in 2.13.13 + "scala.collection.mutable.ArrayBuffer.resizeUp", // private[mutable] def + // New in 2.13.14 + "scala.util.Properties.consoleIsTerminal", // private[scala] lazy val + ).map(ProblemFilters.exclude[DirectMissingMethodProblem]) val TastyCore: Seq[ProblemFilter] = Seq( ) val Interfaces: Seq[ProblemFilter] = Seq( From 6f2dba59a80955d7aeaf68fa16719380c459c203 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Wed, 10 Jul 2024 09:31:56 +0200 Subject: [PATCH 5/6] Remove redundant MiMa filters --- project/MiMaFilters.scala | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 24d3c8cedbdb..112a5601615c 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -14,12 +14,7 @@ object MiMaFilters { ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"), ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$relaxedExtensionImports$"), // end of New experimental features in 3.3.X - ) ++ Seq( - // New in 2.13.13 - "scala.collection.mutable.ArrayBuffer.resizeUp", // private[mutable] def - // New in 2.13.14 - "scala.util.Properties.consoleIsTerminal", // private[scala] lazy val - ).map(ProblemFilters.exclude[DirectMissingMethodProblem]) + ) val TastyCore: Seq[ProblemFilter] = Seq( ) val Interfaces: Seq[ProblemFilter] = Seq( From 43e8873487e7294a2a235a2b7c38d54a5d4d5e73 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Wed, 10 Jul 2024 11:37:09 +0200 Subject: [PATCH 6/6] Use a fixed 2.13.13 version for sbt scripted tests using Scala.js --- project/Build.scala | 2 ++ sbt-test/scala2-compat/erasure-scalajs/build.sbt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index 9c3b13a01fc6..c65c5bc06fab 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1708,6 +1708,8 @@ object Build { "-Dplugin.version=" + version.value, "-Dplugin.scalaVersion=" + dottyVersion, "-Dplugin.scala2Version=" + stdlibVersion(Bootstrapped), + // The last version of Scala 2 that's cross-published for Scala.js 1.12 (version used by LTS) + "-Dplugin.scala2ForJSVersion=2.13.13", "-Dplugin.scalaJSVersion=" + scalaJSVersion, "-Dsbt.boot.directory=" + ((ThisBuild / baseDirectory).value / ".sbt-scripted").getAbsolutePath // Workaround sbt/sbt#3469 ), diff --git a/sbt-test/scala2-compat/erasure-scalajs/build.sbt b/sbt-test/scala2-compat/erasure-scalajs/build.sbt index 342c32fc4cdc..5414046d0919 100644 --- a/sbt-test/scala2-compat/erasure-scalajs/build.sbt +++ b/sbt-test/scala2-compat/erasure-scalajs/build.sbt @@ -1,7 +1,7 @@ lazy val scala2Lib = project.in(file("scala2Lib")) .enablePlugins(ScalaJSPlugin) .settings( - scalaVersion := sys.props("plugin.scala2Version") + scalaVersion := sys.props("plugin.scala2ForJSVersion") ) lazy val dottyApp = project.in(file("dottyApp"))