-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enable MiMa for Scala 3 #4063
Enable MiMa for Scala 3 #4063
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ ThisBuild / githubWorkflowBuild := Seq( | |
WorkflowStep.Sbt( | ||
List("clean", "validateBC"), // cleaning here to avoid issues with codecov | ||
name = Some("Binary compatibility ${{ matrix.scala }}"), | ||
cond = Some(JvmCond + " && " + Scala2Cond) | ||
cond = Some(JvmCond) | ||
) | ||
) | ||
|
||
|
@@ -339,18 +339,21 @@ def mimaPrevious(moduleName: String, scalaVer: String, ver: String, includeCats1 | |
Version(ver) match { | ||
case Some(Version(major, Seq(minor, patch), _)) => | ||
semverBinCompatVersions(major, minor, patch) | ||
.map { case (maj, min, pat) => s"$maj.$min.$pat" } | ||
.collect { case (maj, min, pat) if !scalaVer.startsWith("3.") || (maj >= 2 && min >= 7) => s"$maj.$min.$pat" } | ||
case _ => | ||
List.empty[String] | ||
} | ||
} | ||
// Safety Net For Exclusions | ||
lazy val excludedVersions: List[String] = List() | ||
lazy val excludedVersions: List[String] = List("2.7.0") // cursed bincompat on Scala 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2.7.0 is cursed right? Unless we only want to curse it for Scala 3. |
||
|
||
// Safety Net for Inclusions | ||
lazy val extraVersions: List[String] = List("1.0.1", "1.1.0", "1.2.0", "1.3.1", "1.4.0", "1.5.0", "1.6.1") | ||
lazy val extraCats1Versions: List[String] = List("1.0.1", "1.1.0", "1.2.0", "1.3.1", "1.4.0", "1.5.0", "1.6.1") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw checking so old versions doesn't cover new definitions (added since). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are, these are just extras :) in sbt try There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh ok I see 👍 - why do we add the extras? To be extra sure? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /shrug :) |
||
|
||
(mimaVersions ++ (if (priorTo2_13(scalaVer) && includeCats1) extraVersions else Nil)) | ||
// Safety Net, starting with Scala 3 introduction in 2.6.1 | ||
lazy val extraVersions: List[String] = List("2.6.1") | ||
|
||
(mimaVersions ++ extraVersions ++ (if (priorTo2_13(scalaVer) && includeCats1) extraCats1Versions else Nil)) | ||
.filterNot(excludedVersions.contains(_)) | ||
.map(v => "org.typelevel" %% moduleName % v) | ||
} | ||
|
@@ -521,7 +524,13 @@ def mimaSettings(moduleName: String, includeCats1: Boolean = true) = | |
exclude[DirectAbstractMethodProblem]("cats.free.ContravariantCoyoneda.k"), | ||
exclude[ReversedAbstractMethodProblem]("cats.free.ContravariantCoyoneda.k"), | ||
exclude[DirectAbstractMethodProblem]("cats.free.Coyoneda.k"), | ||
exclude[ReversedAbstractMethodProblem]("cats.free.Coyoneda.k") | ||
exclude[ReversedAbstractMethodProblem]("cats.free.Coyoneda.k"), | ||
exclude[DirectMissingMethodProblem]("cats.free.ContravariantCoyoneda.unsafeApply"), | ||
exclude[DirectMissingMethodProblem]("cats.free.ContravariantCoyoneda.ks"), | ||
exclude[DirectMissingMethodProblem]("cats.free.ContravariantCoyoneda.unsafeApply"), | ||
exclude[DirectMissingMethodProblem]("cats.free.Coyoneda.unsafeApply"), | ||
exclude[DirectMissingMethodProblem]("cats.free.Coyoneda.ks"), | ||
exclude[DirectMissingMethodProblem]("cats.free.Coyoneda.unsafeApply") | ||
) | ||
} | ||
) | ||
|
@@ -876,9 +885,16 @@ lazy val binCompatTest = project | |
// see https://github.com/typelevel/cats/pull/3079#discussion_r327181584 | ||
// see https://github.com/typelevel/cats/pull/3026#discussion_r321984342 | ||
useCoursier := false, | ||
addCompilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full)), | ||
libraryDependencies ++= { | ||
if (isDotty.value) Nil | ||
else | ||
Seq( | ||
compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full)) | ||
) | ||
}, | ||
libraryDependencies += mimaPrevious("cats-core", scalaVersion.value, version.value).last % Provided, | ||
scalacOptions ++= (if (priorTo2_13(scalaVersion.value)) Seq("-Ypartial-unification") else Nil) | ||
scalacOptions ++= (if (priorTo2_13(scalaVersion.value)) Seq("-Ypartial-unification") else Nil), | ||
scalacOptions ++= (if (isDotty.value) Seq("-Ykind-projector") else Nil) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this the right order? isn't it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure TBH, but this works for 2.x and 3 locally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
) | ||
.settings(testingDependencies) | ||
.dependsOn(core.jvm % Test) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,12 @@ package object cats { | |
|
||
type Endo[A] = A => A | ||
|
||
val catsInstancesForId: Bimonad[Id] with CommutativeMonad[Id] with NonEmptyTraverse[Id] with Distributive[Id] = | ||
@deprecated("retained for binary compatibility", "2.7.1") | ||
private[cats] def catsInstancesForId | ||
: Bimonad[Id] with CommutativeMonad[Id] with Comonad[Id] with NonEmptyTraverse[Id] with Distributive[Id] = | ||
catsInstancesForIdBinCompat1 | ||
val catsInstancesForIdBinCompat1 | ||
: Bimonad[Id] with CommutativeMonad[Id] with NonEmptyTraverse[Id] with Distributive[Id] = | ||
Comment on lines
+73
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this change? 🤔 - I thought only the forwarder in |
||
new Bimonad[Id] with CommutativeMonad[Id] with NonEmptyTraverse[Id] with Distributive[Id] { | ||
def pure[A](a: A): A = a | ||
def extract[A](a: A): A = a | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone know anything about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a macro which is not implemented for Scala 3:
https://github.com/typelevel/cats/blob/main/core/src/main/scala-2.x/src/main/scala/cats/arrow/FunctionKMacros.scala
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay to disable, or maybe we should split this test into Scala 2 / Scala 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this is testing TBH