Skip to content

Commit 72f2da6

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 2ba368d commit 72f2da6

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

project/Build.scala

Lines changed: 16 additions & 11 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
105-
* 3.0.x release.
102+
* This must be the earliest published release in the same versioning line.
103+
* For a baseVersion `3.M.P` the mimaPreviousDottyVersion should be set to:
104+
* - `3.M.0` if `P > 0`
105+
* - `3.(M-1).0` if `P = 0`
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 {
@@ -1149,7 +1154,7 @@ object Build {
11491154
},
11501155
tastyMiMaConfig ~= { _.withMoreProblemFilters(TastyMiMaFilters.StdlibBootstrapped) },
11511156
tastyMiMaReportIssues := tastyMiMaReportIssues.dependsOn(Def.task {
1152-
val minorVersion = previousDottyVersion.split('.')(1)
1157+
val minorVersion = mimaPreviousDottyVersion.split('.')(1)
11531158
// TODO find a way around this and test in the CI
11541159
streams.value.log.warn(
11551160
s"""To allow TASTy-MiMa to read TASTy files generated by this version of the compile you must:
@@ -2183,7 +2188,7 @@ object Build {
21832188
case cv: Disabled => thisProjectID.name
21842189
case cv: Binary => s"${thisProjectID.name}_${cv.prefix}3${cv.suffix}"
21852190
}
2186-
(thisProjectID.organization % crossedName % ltsDottyVersion)
2191+
(thisProjectID.organization % crossedName % mimaPreviousLTSDottyVersion)
21872192
},
21882193
mimaForwardIssueFilters := MiMaFilters.Scala3Library.ForwardsBreakingChanges,
21892194
mimaBackwardIssueFilters := MiMaFilters.Scala3Library.BackwardsBreakingChanges,

project/MiMaFilters.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ 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
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.annotation.experimental.this"),
1212
),
1313

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

5050
// Breaking changes since last reference version
51-
Build.previousDottyVersion -> Seq.empty, // We should never break backwards compatibility
51+
Build.mimaPreviousDottyVersion -> Seq.empty, // We should never break backwards compatibility
5252

5353
// Breaking changes since last LTS
54-
Build.ltsDottyVersion -> Seq(
54+
Build.mimaPreviousLTSDottyVersion -> Seq(
5555
// Quotes is assumed to only be implemented by the compiler and on the same version of the library.
5656
// It is exceptionally OK to break this compatibility. In these cases, there add new abstract methods that would
5757
// potentially not be implemented by others. If some other library decides to implement these,
@@ -71,35 +71,35 @@ object MiMaFilters {
7171
object TastyCore {
7272
val ForwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map(
7373
// Additions that require a new minor version of tasty core
74-
Build.previousDottyVersion -> Seq(
74+
Build.mimaPreviousDottyVersion -> Seq(
7575
ProblemFilters.exclude[DirectMissingMethodProblem]("dotty.tools.tasty.TastyFormat.FLEXIBLEtype")
7676
),
7777

7878
// Additions since last LTS
79-
Build.ltsDottyVersion -> Seq(
79+
Build.mimaPreviousLTSDottyVersion -> Seq(
8080
)
8181
)
8282

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

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

9595
// Additions since last LTS
96-
Build.ltsDottyVersion -> Seq(
96+
Build.mimaPreviousLTSDottyVersion -> Seq(
9797
)
9898
)
9999

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

0 commit comments

Comments
 (0)