Skip to content

Commit 7eec9eb

Browse files
Backport "Upgrade Scala 2 to 2.13.14 (was 2.13.12)" to LTS (#21156)
Backports #20902 to the LTS branch. PR submitted by the release tooling.
2 parents c332e8f + 43e8873 commit 7eec9eb

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

Diff for: community-build/community-projects/stdLib213

Submodule stdLib213 updated 1814 files

Diff for: project/Build.scala

+20-4
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ object Build {
124124
* scala-library.
125125
*/
126126
def stdlibVersion(implicit mode: Mode): String = mode match {
127-
case NonBootstrapped => "2.13.12"
128-
case Bootstrapped => "2.13.12"
127+
case NonBootstrapped => "2.13.14"
128+
case Bootstrapped => "2.13.14"
129129
}
130130

131131
val dottyOrganization = "org.scala-lang"
@@ -1002,7 +1002,21 @@ object Build {
10021002
IO.createDirectory(trgDir)
10031003
IO.unzip(scalaLibrarySourcesJar, trgDir)
10041004

1005-
((trgDir ** "*.scala") +++ (trgDir ** "*.java")).get.toSet
1005+
val (ignoredSources, sources) =
1006+
((trgDir ** "*.scala") +++ (trgDir ** "*.java")).get.toSet
1007+
.partition{file =>
1008+
// sources from https://github.com/scala/scala/tree/2.13.x/src/library-aux
1009+
val path = file.getPath.replace('\\', '/')
1010+
path.endsWith("scala-library-src/scala/Any.scala") ||
1011+
path.endsWith("scala-library-src/scala/AnyVal.scala") ||
1012+
path.endsWith("scala-library-src/scala/AnyRef.scala") ||
1013+
path.endsWith("scala-library-src/scala/Nothing.scala") ||
1014+
path.endsWith("scala-library-src/scala/Null.scala") ||
1015+
path.endsWith("scala-library-src/scala/Singleton.scala")
1016+
}
1017+
// These sources should be never compiled, filtering them out was not working correctly sometimes
1018+
ignoredSources.foreach(_.delete())
1019+
sources
10061020
} (Set(scalaLibrarySourcesJar)).toSeq
10071021
}.taskValue,
10081022
(Compile / sourceGenerators) += Def.task {
@@ -1141,7 +1155,7 @@ object Build {
11411155
.exclude("org.eclipse.lsp4j","org.eclipse.lsp4j.jsonrpc"),
11421156
"org.eclipse.lsp4j" % "org.eclipse.lsp4j" % "0.20.1",
11431157
),
1144-
libraryDependencies += ("org.scalameta" % "mtags-shared_2.13.12" % mtagsVersion % SourceDeps),
1158+
libraryDependencies += ("org.scalameta" % "mtags-shared_2.13.14" % mtagsVersion % SourceDeps),
11451159
ivyConfigurations += SourceDeps.hide,
11461160
transitiveClassifiers := Seq("sources"),
11471161
Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Ysafe-init"),
@@ -1694,6 +1708,8 @@ object Build {
16941708
"-Dplugin.version=" + version.value,
16951709
"-Dplugin.scalaVersion=" + dottyVersion,
16961710
"-Dplugin.scala2Version=" + stdlibVersion(Bootstrapped),
1711+
// The last version of Scala 2 that's cross-published for Scala.js 1.12 (version used by LTS)
1712+
"-Dplugin.scala2ForJSVersion=2.13.13",
16971713
"-Dplugin.scalaJSVersion=" + scalaJSVersion,
16981714
"-Dsbt.boot.directory=" + ((ThisBuild / baseDirectory).value / ".sbt-scripted").getAbsolutePath // Workaround sbt/sbt#3469
16991715
),

Diff for: project/MiMaFilters.scala

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ object MiMaFilters {
1414
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"),
1515
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$relaxedExtensionImports$"),
1616
// end of New experimental features in 3.3.X
17-
18-
// New in 2.13.12 -- can be removed once scala/scala#10549 lands in 2.13.13
19-
// and we take the upgrade here
20-
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.MapNodeRemoveAllSetNodeIterator.next"),
2117
)
2218
val TastyCore: Seq[ProblemFilter] = Seq(
2319
)

Diff for: sbt-test/scala2-compat/erasure-scalajs/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
lazy val scala2Lib = project.in(file("scala2Lib"))
22
.enablePlugins(ScalaJSPlugin)
33
.settings(
4-
scalaVersion := sys.props("plugin.scala2Version")
4+
scalaVersion := sys.props("plugin.scala2ForJSVersion")
55
)
66

77
lazy val dottyApp = project.in(file("dottyApp"))

0 commit comments

Comments
 (0)