-
-
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
Conversation
@@ -348,9 +348,12 @@ def mimaPrevious(moduleName: String, scalaVer: String, ver: String, includeCats1 | |||
lazy val excludedVersions: List[String] = List() | |||
|
|||
// 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Btw checking so old versions doesn't cover new definitions (added since).
IMO we should check against the latest previous version.
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.
We are, these are just extras :) in sbt try show coreJVM/mimaPreviousArtifacts
to see the list.
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
/shrug :)
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 comment
The reason will be displayed to describe this comment to others. Learn more.
is this the right order? isn't it if (!isDotty.value)
?
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
FunctionK.lift(headOption), | ||
// FunctionK.lift(headOption), // Doesn't work in 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.
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
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 comment
The 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.
How do we feel about static methods for Java? @johnynek you pushed for conservatism in typelevel/cats-effect#2343 (comment).
|
That's the issue in #4062 we were discussing though - the issue is that the type signature changed. |
Yes, except it's now fixed for Scala. However, by marking the old method |
@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] = |
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.
Why do we need this change? 🤔 - I thought only the forwarder in Invariant
needs a change
Here is another suggestion - add one more forwarder of type Edit: I think it should be in |
I wonder if bincompat with both cats-2.6.1_3 and cats-2.7.0_3 could be kept using import scala.annotation.targetName
// ...
// 2.6.1 compat
private[cats] def catsInstancesForId: Distributive[Id] with Comonad[Id] = ...
// 2.7.0 compat
private[cats] @targetName("catsInstancesForId") def catsInstancesForIdCompat270:
: Distributive[Id] with Bimonad[Id] with CommutativeMonad[Id] with NonEmptyTraverse[Id] = ...
// new method
implicit def catsInstancesForIdBinCompat1
: Distributive[Id] with Bimonad[Id] with CommutativeMonad[Id] with NonEmptyTraverse[Id] = ... |
But this annotation only exists in Scala3's library, right? |
Yes, that would be in a scala-3/ version of the file, the scala-2/ version only needs one version of catsInstancesForId to keep compat with 2.6.1 and 2.7.0. |
So, while main has moved on to |
@armanbilge just curious – is this PR still in progress? |
This PR needs feedback on the following to proceed: |
I would say no need to patch 2.7.x unless there're complains from people who use it in some prod-ish projects and encountered issues with. But I guess if there were such issues we would already know about it. |
From my prospective, if it is possible to maintain bin.compatibility without spitting sources into Scala2 and Scala3 versions then it would be the best bet. But I realize that in some cases it may not be feasible – then |
Superseded by #4160. |
Will also fix #4062. First commit should fail to demonstrate MiMa is running.