Skip to content

Commit ee052d7

Browse files
committed
Strengthen MiMa checks
Using the latest patch release of the current minor version may lead to some breakages that are not properly checked/tagged in the MiMa filers. For example, if we accidentally introduce a breaking change in 3.M.1 but check against 3.M.2, we would lose this braking change before the next minor release. If we would check against 3.M.0, we would catch this. In general we need to track all the changes that have happened in the current minor version. There should not be any breaking changes unless the PR needs a minor release.
1 parent 6bb6b43 commit ee052d7

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

project/Build.scala

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,22 @@ object Build {
9797
val publishedDottyVersion = referenceVersion
9898
val sbtDottyVersion = "0.5.5"
9999

100-
/** Version against which we check binary compatibility.
100+
/** Minor version against which we check binary compatibility.
101101
*
102-
* This must be the latest published release in the same versioning line.
103-
* For example, if the next version is going to be 3.1.4, then this must be
104-
* set to 3.1.3. If it is going to be 3.1.0, it must be set to the latest
102+
* This must be the earliest published release in the same versioning line.
103+
* For example, if the next version is going to be 3.M.4, then this must be
104+
* set to 3.1.0. If it is going to be 3.1.0, it must be set to the earliest
105105
* 3.0.x release.
106106
*/
107-
val previousDottyVersion = "3.4.1"
107+
val mimaPreviousDottyVersion = "3.4.0"
108108

109-
/** Version against which we check binary compatibility. */
110-
val ltsDottyVersion = "3.3.0"
109+
/** LTS version against which we check binary compatibility.
110+
*
111+
* This must be the earliest published release in the LTS versioning line.
112+
* For example, if the latest LTS release is be 3.3.4, then this must be
113+
* set to 3.3.0.
114+
*/
115+
val mimaPreviousLTSDottyVersion = "3.3.0"
111116

112117
object CompatMode {
113118
final val BinaryCompatible = 0
@@ -500,7 +505,7 @@ object Build {
500505
case cv: Disabled => thisProjectID.name
501506
case cv: Binary => s"${thisProjectID.name}_${cv.prefix}3${cv.suffix}"
502507
}
503-
(thisProjectID.organization % crossedName % previousDottyVersion)
508+
(thisProjectID.organization % crossedName % mimaPreviousDottyVersion)
504509
},
505510

506511
mimaCheckDirection := (compatMode match {
@@ -1141,7 +1146,7 @@ object Build {
11411146
},
11421147
tastyMiMaConfig ~= { _.withMoreProblemFilters(TastyMiMaFilters.StdlibBootstrapped) },
11431148
tastyMiMaReportIssues := tastyMiMaReportIssues.dependsOn(Def.task {
1144-
val minorVersion = previousDottyVersion.split('.')(1)
1149+
val minorVersion = mimaPreviousDottyVersion.split('.')(1)
11451150
// TODO find a way around this and test in the CI
11461151
streams.value.log.warn(
11471152
s"""To allow TASTy-MiMa to read TASTy files generated by this version of the compile you must:
@@ -2171,7 +2176,7 @@ object Build {
21712176
case cv: Disabled => thisProjectID.name
21722177
case cv: Binary => s"${thisProjectID.name}_${cv.prefix}3${cv.suffix}"
21732178
}
2174-
(thisProjectID.organization % crossedName % ltsDottyVersion)
2179+
(thisProjectID.organization % crossedName % mimaPreviousLTSDottyVersion)
21752180
},
21762181
mimaForwardIssueFilters := MiMaFilters.Scala3Library.ForwardsBreakingChanges,
21772182
mimaBackwardIssueFilters := MiMaFilters.Scala3Library.BackwardsBreakingChanges,

project/MiMaFilters.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ object MiMaFilters {
77

88
val ForwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
99
// Additions that require a new minor version of the library
10-
Build.previousDottyVersion -> Seq(
10+
Build.mimaPreviousDottyVersion -> Seq(
1111
),
1212

1313
// Additions since last LTS
14-
Build.ltsDottyVersion -> Seq(
14+
Build.mimaPreviousLTSDottyVersion -> Seq(
1515
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefMethods"),
1616
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefTypeTest"),
1717
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.FunctionClass"),
@@ -47,10 +47,10 @@ object MiMaFilters {
4747
// Only exceptional cases should be added here.
4848

4949
// Breaking changes since last reference version
50-
Build.previousDottyVersion -> Seq.empty, // We should never break backwards compatibility
50+
Build.mimaPreviousDottyVersion -> Seq.empty, // We should never break backwards compatibility
5151

5252
// Breaking changes since last LTS
53-
Build.ltsDottyVersion -> Seq(
53+
Build.mimaPreviousLTSDottyVersion -> Seq(
5454
// Quotes is assumed to only be implemented by the compiler and on the same version of the library.
5555
// It is exceptionally OK to break this compatibility. In these cases, there add new abstract methods that would
5656
// potentially not be implemented by others. If some other library decides to implement these,
@@ -70,34 +70,34 @@ object MiMaFilters {
7070
object TastyCore {
7171
val ForwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
7272
// Additions that require a new minor version of tasty core
73-
Build.previousDottyVersion -> Seq(
73+
Build.mimaPreviousDottyVersion -> Seq(
7474
),
7575

7676
// Additions since last LTS
77-
Build.ltsDottyVersion -> Seq(
77+
Build.mimaPreviousLTSDottyVersion -> Seq(
7878
)
7979
)
8080

8181
val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
8282
// Breaking changes since last LTS
83-
Build.ltsDottyVersion -> Seq.empty // We should never break backwards compatibility
83+
Build.mimaPreviousLTSDottyVersion -> Seq.empty // We should never break backwards compatibility
8484
)
8585
}
8686

8787
object Interfaces {
8888
val ForwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
8989
// Additions that require a new minor version of interfaces
90-
Build.previousDottyVersion -> Seq(
90+
Build.mimaPreviousDottyVersion -> Seq(
9191
),
9292

9393
// Additions since last LTS
94-
Build.ltsDottyVersion -> Seq(
94+
Build.mimaPreviousLTSDottyVersion -> Seq(
9595
)
9696
)
9797

9898
val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
9999
// Breaking changes since last LTS
100-
Build.ltsDottyVersion -> Seq.empty // We should never break backwards compatibility
100+
Build.mimaPreviousLTSDottyVersion -> Seq.empty // We should never break backwards compatibility
101101
)
102102
}
103103

0 commit comments

Comments
 (0)