Skip to content

Commit 7fb1d8b

Browse files
committed
Strengthen the MiMa filters for TastyCore and Interfaces
1 parent a340da3 commit 7fb1d8b

File tree

2 files changed

+42
-10
lines changed

2 files changed

+42
-10
lines changed

project/Build.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ object Build {
531531
settings(commonMiMaSettings).
532532
settings(
533533
versionScheme := Some("semver-spec"),
534-
mimaBinaryIssueFilters ++= MiMaFilters.Interfaces,
534+
mimaForwardIssueFilters := MiMaFilters.Interfaces.ForwardsBreakingChanges,
535+
mimaBackwardIssueFilters := MiMaFilters.Interfaces.BackwardsBreakingChanges,
535536
customMimaReportBinaryIssues("MiMaFilters.Interfaces"),
536537
)
537538

@@ -1118,7 +1119,7 @@ object Build {
11181119
mimaCheckDirection := "both",
11191120
mimaBackwardIssueFilters := Scala2LibraryBootstrappedMiMaFilters.BackwardsBreakingChanges,
11201121
mimaForwardIssueFilters := Scala2LibraryBootstrappedMiMaFilters.ForwardsBreakingChanges,
1121-
customMimaReportBinaryIssues("Scala2LibraryBootstrappedMiMaFilters.{BackwardsBreakingChanges, ForwardsBreakingChanges}"),
1122+
customMimaReportBinaryIssues("Scala2LibraryBootstrappedMiMaFilters"),
11221123
mimaPreviousArtifacts += "org.scala-lang" % "scala-library" % stdlibBootstrappedVersion,
11231124
mimaExcludeAnnotations ++= Seq(
11241125
"scala.annotation.experimental",
@@ -2107,7 +2108,7 @@ object Build {
21072108
private def customMimaReportBinaryIssues(issueFilterLocation: String) = mimaReportBinaryIssues := {
21082109
mimaReportBinaryIssues.result.value match {
21092110
case Inc(inc: Incomplete) =>
2110-
streams.value.log.error(s"\n$issueFilterLocation are used as filters\n ")
2111+
streams.value.log.error(s"\nFilers in $issueFilterLocation are used in this check.\n ")
21112112
throw inc
21122113
case Value(v) => v
21132114
}
@@ -2179,7 +2180,7 @@ object Build {
21792180
},
21802181
mimaForwardIssueFilters := MiMaFilters.Scala3Library.ForwardsBreakingChanges,
21812182
mimaBackwardIssueFilters := MiMaFilters.Scala3Library.BackwardsBreakingChanges,
2182-
customMimaReportBinaryIssues("MiMaFilters.Scala3Library.{ForwardsBreakingChanges, BackwardsBreakingChanges}"),
2183+
customMimaReportBinaryIssues("MiMaFilters.Scala3Library"),
21832184
)
21842185
} else base
21852186
}
@@ -2193,7 +2194,8 @@ object Build {
21932194
versionScheme := Some("semver-spec"),
21942195
if (mode == Bootstrapped) Def.settings(
21952196
commonMiMaSettings,
2196-
mimaBinaryIssueFilters ++= MiMaFilters.TastyCore,
2197+
mimaForwardIssueFilters := MiMaFilters.TastyCore.ForwardsBreakingChanges,
2198+
mimaBackwardIssueFilters := MiMaFilters.TastyCore.BackwardsBreakingChanges,
21972199
customMimaReportBinaryIssues("MiMaFilters.TastyCore"),
21982200
) else {
21992201
Nil

project/MiMaFilters.scala

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ object MiMaFilters {
4141
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"),
4242
),
4343
)
44+
4445
val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
4546
// In general we should never have backwards incompatible changes in the library.
4647
// Only exceptional cases should be added here.
4748

4849
// Breaking changes since last reference version
49-
Build.previousDottyVersion -> Seq.empty,
50+
Build.previousDottyVersion -> Seq.empty, // We should never break backwards compatibility
5051

5152
// Breaking changes since last LTS
5253
Build.ltsDottyVersion -> Seq(
@@ -66,9 +67,38 @@ object MiMaFilters {
6667
)
6768
}
6869

69-
val TastyCore: Seq[ProblemFilter] = Seq(
70-
)
71-
val Interfaces: Seq[ProblemFilter] = Seq(
72-
)
70+
object TastyCore {
71+
val ForwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
72+
// Additions that require a new minor version of tasty core
73+
Build.previousDottyVersion -> Seq(
74+
),
75+
76+
// Additions since last LTS
77+
Build.ltsDottyVersion -> Seq(
78+
)
79+
)
80+
81+
val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
82+
// Breaking changes since last LTS
83+
Build.ltsDottyVersion -> Seq.empty // We should never break backwards compatibility
84+
)
85+
}
86+
87+
object Interfaces {
88+
val ForwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
89+
// Additions that require a new minor version of interfaces
90+
Build.previousDottyVersion -> Seq(
91+
),
92+
93+
// Additions since last LTS
94+
Build.ltsDottyVersion -> Seq(
95+
)
96+
)
97+
98+
val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
99+
// Breaking changes since last LTS
100+
Build.ltsDottyVersion -> Seq.empty // We should never break backwards compatibility
101+
)
102+
}
73103

74104
}

0 commit comments

Comments
 (0)