From cc2dd1ec43f0f6cef282033a1754c506cd417ad7 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 26 Feb 2024 14:32:18 -0800 Subject: [PATCH 1/3] use Scala 2.13.13 stdlib (was .12) --- community-build/community-projects/stdLib213 | 2 +- project/Build.scala | 8 ++++---- project/Scala2LibraryBootstrappedMiMaFilters.scala | 3 --- 3 files changed, 5 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 cc24940de67c..9e5ca1d59881 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -144,8 +144,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" } /** Version of the scala-library for which we will generate TASTy. @@ -155,7 +155,7 @@ object Build { * We can use nightly versions to tests the future compatibility in development. * Nightly versions: https://scala-ci.typesafe.com/ui/native/scala-integration/org/scala-lang */ - val stdlibBootstrappedVersion = "2.13.12" + val stdlibBootstrappedVersion = "2.13.13" val dottyOrganization = "org.scala-lang" val dottyGithubUrl = "https://github.com/scala/scala3" @@ -1361,7 +1361,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"), scalacOptions ++= Seq("-source", "3.3"), // To avoid fatal migration warnings diff --git a/project/Scala2LibraryBootstrappedMiMaFilters.scala b/project/Scala2LibraryBootstrappedMiMaFilters.scala index bd149d5a910b..0d2b5a7fd945 100644 --- a/project/Scala2LibraryBootstrappedMiMaFilters.scala +++ b/project/Scala2LibraryBootstrappedMiMaFilters.scala @@ -78,9 +78,6 @@ object Scala2LibraryBootstrappedMiMaFilters { "scala.collection.IterableOnceOps#Maximized.this", // New in 2.13.11: private inner class "scala.util.Properties.", "scala.util.Sorting.scala$util$Sorting$$mergeSort$default$5", - // New in 2.13.12 -- can be removed once scala/scala#10549 lands in 2.13.13 - // and we take the upgrade here - "scala.collection.immutable.MapNodeRemoveAllSetNodeIterator.next", ).map(ProblemFilters.exclude[DirectMissingMethodProblem]) } ) From e81b4a3b7c88223af8d262c86d5c798a20f0d0eb Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Mon, 1 Jul 2024 13:03:41 +0200 Subject: [PATCH 2/3] Upgrade Scala 2 to 2.13.14 --- project/Build.scala | 8 ++++---- project/Scala2LibraryBootstrappedMiMaFilters.scala | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 9e5ca1d59881..4a5f1609aa24 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -144,8 +144,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" } /** Version of the scala-library for which we will generate TASTy. @@ -155,7 +155,7 @@ object Build { * We can use nightly versions to tests the future compatibility in development. * Nightly versions: https://scala-ci.typesafe.com/ui/native/scala-integration/org/scala-lang */ - val stdlibBootstrappedVersion = "2.13.13" + val stdlibBootstrappedVersion = "2.13.14" val dottyOrganization = "org.scala-lang" val dottyGithubUrl = "https://github.com/scala/scala3" @@ -1361,7 +1361,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"), scalacOptions ++= Seq("-source", "3.3"), // To avoid fatal migration warnings diff --git a/project/Scala2LibraryBootstrappedMiMaFilters.scala b/project/Scala2LibraryBootstrappedMiMaFilters.scala index 0d2b5a7fd945..102a2a50e9d4 100644 --- a/project/Scala2LibraryBootstrappedMiMaFilters.scala +++ b/project/Scala2LibraryBootstrappedMiMaFilters.scala @@ -172,6 +172,10 @@ object Scala2LibraryBootstrappedMiMaFilters { "scala.collection.mutable.LinkedHashSet.defaultLoadFactor", // private[collection] final def "scala.collection.mutable.LinkedHashSet.defaultinitialSize", // private[collection] final def "scala.collection.mutable.OpenHashMap.nextPositivePowerOfTwo", // private[mutable] def + // 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]) ++ Seq( // MissingFieldProblem: static field ... in object ... does not have a correspondent in other version "scala.Array.UnapplySeqWrapper", From 2a142cd5d49a050cee78b860d1428679cee0a2a1 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Mon, 1 Jul 2024 13:05:24 +0200 Subject: [PATCH 3/3] 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) --- project/Build.scala | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 4a5f1609aa24..df90a3e2bc31 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1126,19 +1126,23 @@ 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 / sources) ~= (_.filterNot { 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") - }), (Compile / sources) := { val files = (Compile / sources).value val overwrittenSourcesDir = (Compile / scalaSource).value