Skip to content

Backport "Upgrade Scala 2 to 2.13.14 (was 2.13.12)" to LTS #21156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading