Skip to content

Commit

Permalink
Backport "Upgrade Scala 2 to 2.13.14 (was 2.13.12)" to LTS (#21156)
Browse files Browse the repository at this point in the history
Backports #20902 to the LTS branch.

PR submitted by the release tooling.
  • Loading branch information
WojciechMazur committed Jul 10, 2024
2 parents c332e8f + 43e8873 commit 7eec9eb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion community-build/community-projects/stdLib213
Submodule stdLib213 updated 1814 files
24 changes: 20 additions & 4 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.14"
case Bootstrapped => "2.13.14"
}

val dottyOrganization = "org.scala-lang"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1141,7 +1155,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"),
Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Ysafe-init"),
Expand Down Expand Up @@ -1694,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
),
Expand Down
4 changes: 0 additions & 4 deletions project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
)
Expand Down
2 changes: 1 addition & 1 deletion sbt-test/scala2-compat/erasure-scalajs/build.sbt
Original file line number Diff line number Diff line change
@@ -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"))
Expand Down

0 comments on commit 7eec9eb

Please sign in to comment.