Skip to content

Commit

Permalink
Upgrade Scala 2 to 2.13.14 (was 2.13.12) (#20902)
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur authored Jul 2, 2024
2 parents b481932 + 2a142cd commit 0e60d36
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion community-build/community-projects/stdLib213
Submodule stdLib213 updated 1814 files
34 changes: 19 additions & 15 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.14"
case Bootstrapped => "2.13.14"
}

/** Version of the scala-library for which we will generate TASTy.
Expand All @@ -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.14"

val dottyOrganization = "org.scala-lang"
val dottyGithubUrl = "https://github.com/scala/scala3"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1361,7 +1365,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.14" % mtagsVersion % SourceDeps),
ivyConfigurations += SourceDeps.hide,
transitiveClassifiers := Seq("sources"),
scalacOptions ++= Seq("-source", "3.3"), // To avoid fatal migration warnings
Expand Down
7 changes: 4 additions & 3 deletions project/Scala2LibraryBootstrappedMiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ object Scala2LibraryBootstrappedMiMaFilters {
"scala.collection.IterableOnceOps#Maximized.this", // New in 2.13.11: private inner class
"scala.util.Properties.<clinit>",
"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])
}
)
Expand Down Expand Up @@ -175,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",
Expand Down

0 comments on commit 0e60d36

Please sign in to comment.