Skip to content

Update stdlib-bootstrapped to 2.13.11 and then 2.13.12 nightly #18136

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
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
22 changes: 17 additions & 5 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ object Build {
case Bootstrapped => "2.13.10"
}

/** Version of the scala-library for which we will generate TASTy.
*
* We should never use a nightly version here to release.
*
* 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-bin-364ee69"

val dottyOrganization = "org.scala-lang"
val dottyGithubUrl = "https://github.com/lampepfl/dotty"
val dottyGithubRawUserContentUrl = "https://raw.githubusercontent.com/lampepfl/dotty"
Expand Down Expand Up @@ -261,6 +270,9 @@ object Build {
// sbt will complain if we don't exclude them here.
Keys.scalaSource, Keys.javaSource
),

// This is used to download nightly builds of the Scala 2 library in `stdlib-bootstrapped`
resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/",
)

lazy val disableDocSetting =
Expand Down Expand Up @@ -948,7 +960,7 @@ object Build {
ivyConfigurations += SourceDeps.hide,
transitiveClassifiers := Seq("sources"),
libraryDependencies +=
("org.scala-lang" % "scala-library" % stdlibVersion(Bootstrapped) % "sourcedeps"),
("org.scala-lang" % "scala-library" % stdlibBootstrappedVersion % "sourcedeps"),
(Compile / sourceGenerators) += Def.task {
val s = streams.value
val cacheDir = s.cacheDirectory
Expand Down Expand Up @@ -991,18 +1003,18 @@ object Build {
files.filterNot(_.relativeTo(reference).exists(overwritenSources))
},
(Test / managedClasspath) ~= {
_.filterNot(file => file.data.getName == s"scala-library-${stdlibVersion(Bootstrapped)}.jar")
_.filterNot(file => file.data.getName == s"scala-library-$stdlibBootstrappedVersion.jar")
},
mimaCheckDirection := "both",
mimaBackwardIssueFilters := MiMaFilters.StdlibBootstrappedBackwards,
mimaForwardIssueFilters := MiMaFilters.StdlibBootstrappedForward,
mimaPreviousArtifacts += "org.scala-lang" % "scala-library" % stdlibVersion(Bootstrapped),
mimaPreviousArtifacts += "org.scala-lang" % "scala-library" % stdlibBootstrappedVersion,
mimaExcludeAnnotations ++= Seq(
"scala.annotation.experimental",
"scala.annotation.specialized",
"scala.annotation.unspecialized",
),
tastyMiMaPreviousArtifacts += "org.scala-lang" % "scala-library" % stdlibVersion(Bootstrapped),
tastyMiMaPreviousArtifacts += "org.scala-lang" % "scala-library" % stdlibBootstrappedVersion,
tastyMiMaCurrentClasspath := {
val javaBootCp = tastyMiMaJavaBootClasspath.value
val classDir = (Compile / classDirectory).value.toPath()
Expand Down Expand Up @@ -1109,7 +1121,7 @@ object Build {
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
Test / javaOptions += "-Ddotty.scala.library=" + (`stdlib-bootstrapped` / Compile / packageBin).value.getAbsolutePath,
Compile / compile / fullClasspath ~= {
_.filterNot(file => file.data.getName == s"scala-library-${stdlibVersion(Bootstrapped)}.jar")
_.filterNot(file => file.data.getName == s"scala-library-$stdlibBootstrappedVersion.jar")
},
Compile / compile / dependencyClasspath := {
// make sure that the scala2-library (tasty of `stdlib-bootstrapped-tasty`) is listed before the scala-library (classfiles)
Expand Down
65 changes: 10 additions & 55 deletions project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,11 @@ object MiMaFilters {
)

val StdlibBootstrappedBackwards: Map[String, Seq[ProblemFilter]] = Map(
"2.13.10" -> {
Build.stdlibBootstrappedVersion -> {
Seq(
// Files that are not compiled in the bootstrapped library
ProblemFilters.exclude[MissingClassProblem]("scala.AnyVal"),

// Inferred result type of non-private member differs (fix in Scala 2)
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#IteratorWrapper.remove"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JCollectionWrapper.iterableFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JDictionaryWrapper.mapFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JIterableWrapper.iterableFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JListWrapper.iterableFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JPropertiesWrapper.mapFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.BitSet.bitSetFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.TreeSet.sortedIterableFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.BitSet.bitSetFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.TreeMap.sortedMapFactory"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.View#LeftPartitionMapped.iterator"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.View#RightPartitionMapped.iterator"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.concurrent.duration.FiniteDuration.unary_-"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.math.BigDecimal.underlying"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.math.Ordering.tryCompare"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.convert.JavaCollectionWrappers#JConcurrentMapWrapper.empty"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.convert.JavaCollectionWrappers#JMapWrapper.empty"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.convert.JavaCollectionWrappers#JPropertiesWrapper.empty"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.LinkedHashMap.newBuilder"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.LinkedHashSet.newBuilder"),

// Scala language features
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.language.<clinit>"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.language#experimental.<clinit>"),
Expand All @@ -61,18 +39,13 @@ object MiMaFilters {

// Value class extension methods
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*$extension"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.*$extension"),

// Companion module class
ProblemFilters.exclude[FinalClassProblem]("scala.*$"),

// Scala 2 intrinsic macros
ProblemFilters.exclude[FinalMethodProblem]("scala.StringContext.s"),

// scala.math.Ordering.tryCompare
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*.tryCompare"),


// Specialization?
ProblemFilters.exclude[MissingFieldProblem]("scala.Tuple1._1"), // field _1 in class scala.Tuple1 does not have a correspondent in current version
ProblemFilters.exclude[MissingFieldProblem]("scala.Tuple2._1"), // field _1 in class scala.Tuple2 does not have a correspondent in current version
Expand Down Expand Up @@ -102,7 +75,6 @@ object MiMaFilters {
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.NoPositioner"),
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.RelaxedPosition"),
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.RelaxedPositioner"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.RedBlackTree#EqualsIterator.nextResult"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.SortedMapOps.coll"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.TreeMap.empty"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.TreeMap.fromSpecific"),
Expand All @@ -111,73 +83,49 @@ object MiMaFilters {
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.TreeMap.fromSpecific"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NothingManifest.newArray"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NullManifest.newArray"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.StringContext.unapplySeq"),
ProblemFilters.exclude[MissingFieldProblem]("scala.collection.ArrayOps#ReverseIterator.xs"),
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.NonLocalReturnControl.value"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.collection.immutable.SortedMapOps.coll"),
) ++
Seq( // DirectMissingMethodProblem
"scala.collection.immutable.ArraySeq#*.elemTag",
"scala.collection.immutable.HashCollisionSetNode.copy",
"scala.collection.immutable.MapKeyValueTupleHashIterator.next",
"scala.collection.LinearSeqIterator#LazyCell.this",
"scala.collection.mutable.AnyRefMap#ToBuildFrom.newBuilder",
"scala.collection.mutable.ArraySeq#*.elemTag",
"scala.collection.mutable.LinkedHashMap.newBuilder", "scala.collection.mutable.LinkedHashSet.newBuilder",
"scala.collection.mutable.LongMap#ToBuildFrom.newBuilder",
"scala.collection.mutable.PriorityQueue#ResizableArrayAccess.this",
"scala.concurrent.BatchingExecutor#AbstractBatch.this",
"scala.concurrent.Channel#LinkedList.this",
"scala.Enumeration#ValueOrdering.this",
"scala.io.Source#RelaxedPosition.this",
"scala.PartialFunction#OrElse.andThen", "scala.PartialFunction#OrElse.orElse",
"scala.runtime.Rich*.num", "scala.runtime.Rich*.ord",
"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",
).map(ProblemFilters.exclude[DirectMissingMethodProblem])
}
)

val StdlibBootstrappedForward: Map[String, Seq[ProblemFilter]] = Map(
"2.13.10" -> {
Build.stdlibBootstrappedVersion -> {
Seq(
// Scala language features
ProblemFilters.exclude[FinalClassProblem]("scala.languageFeature$*$"),
ProblemFilters.exclude[MissingFieldProblem]("scala.language.experimental"),
ProblemFilters.exclude[MissingFieldProblem]("scala.languageFeature*"),

// Inferred result type of non-private member differs (fix in Scala 2)
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.convert.JavaCollectionWrappers#JConcurrentMapWrapper.empty"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.convert.JavaCollectionWrappers#JMapWrapper.empty"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.convert.JavaCollectionWrappers#JPropertiesWrapper.empty"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.math.Ordering.tryCompare"),

// https://github.com/scala/scala/blob/v2.13.10/src/library/scala/collection/immutable/Range.scala#LL155C1-L156C1
// Issue #17519: we do not set final on the default methods of final copy method.
ProblemFilters.exclude[FinalMethodProblem]("scala.collection.immutable.Range.copy$default$*"),

// Value class extension methods
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*$extension"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.*$extension"),

// Companion module class: Missing type java.io.Serializable
ProblemFilters.exclude[MissingTypesProblem]("scala.*$"),

// abstract method elemTag()scala.reflect.ClassTag in class scala.collection.mutable.ArraySeq does not have a correspondent in other version
ProblemFilters.exclude[DirectAbstractMethodProblem]("scala.collection.immutable.ArraySeq.elemTag"),
ProblemFilters.exclude[DirectAbstractMethodProblem]("scala.collection.mutable.ArraySeq.elemTag"),

// Non-categorized
ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.collection.mutable.ArrayBuilder#ofUnit.addAll"),

// Non-categorized
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.RedBlackTree#EqualsIterator.nextResult"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.SortedMapOps.coll"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.LinkedHashMap.newBuilder"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.LinkedHashSet.newBuilder"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NothingManifest.newArray"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NullManifest.newArray"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.StringContext.unapplySeq"),

// the type hierarchy of class scala.Array is different in other version. Missing types {java.io.Serializable,java.lang.Cloneable}
ProblemFilters.exclude[MissingTypesProblem]("scala.Array"),
Expand Down Expand Up @@ -236,6 +184,13 @@ object MiMaFilters {
"scala.util.Properties.coloredOutputEnabled",
"scala.util.Properties.isAvian",
"scala.util.Properties.versionFor",
// New problem in 2.13.11
"scala.collection.IterableOnceOps#Maximized.this", // private inner class
"scala.collection.mutable.LinkedHashMap.defaultLoadFactor", // private[collection] final def
"scala.collection.mutable.LinkedHashMap.defaultinitialSize", // private[collection] final def
"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
).map(ProblemFilters.exclude[DirectMissingMethodProblem]) ++
Seq( // MissingFieldProblem: static field ... in object ... does not have a correspondent in other version
"scala.Array.UnapplySeqWrapper",
Expand Down
Loading