-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update Cats and dependent projects #22949
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
Conversation
It seems cats v.2.13.0 fails to compile with the latest version of Scala: [error] -- [E134] Type Error: /__w/scala3/scala3/community-build/community-projects/cats/kernel/src/main/scala/cats/kernel/Eq.scala:259:36
[error] 259 | cats.kernel.instances.sortedSet.catsKernelStdHashForSortedSet[A](Hash[A])
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] |None of the overloaded alternatives of method catsKernelStdHashForSortedSet in trait SortedSetInstances with types
[error] | [A]
[error] | (using evidence$1: cats.kernel.Hash[A]):
[error] | cats.kernel.Hash[scala.collection.immutable.SortedSet[A]]
[error] | [A]
[error] | (using evidence$1: cats.kernel.Order[A], evidence$2: cats.kernel.Hash[A]):
[error] | cats.kernel.Hash[scala.collection.immutable.SortedSet[A]]
[error] |match type arguments [A²] and arguments (cats.kernel.Hash[A²])
[error] |
[error] |where: A is a type variable
[error] | A² is a type in method catsKernelHashForSortedSet
[error] one error found
[error] (kernelJVM / Compile / compileIncremental) Compilation failed
[error] Total time: 31 s, completed Apr 9, 2025 6:36:58 PM Log: https://github.com/scala/scala3/actions/runs/14361375561/job/40263508857#step:9:6448. |
So fwiw, taking a look at the fix diff, I think it's pretty accurate to characterize these issues as things that users will hit if they're writing similar code. Like, the patch does fix it, but anyone trying to straddle 2.x and 3.x is likely to hit these types of problems, and the fix is incompatible with 2.13 syntax and semantics. If the community build is meant to be a canary on issues likely to be found in user code, then I think these failures should probably be treated as meaningful. Btw the very practical consequence of this is that it's likely Cats will end up frozen on an old version of Scala 3.x more or less indefinitely, since we cannot abandon Scala 2.x in the near-term. |
It seems only fixing the compilation errors (my first commit: dotty-staging/cats@f5a5867) doesn't break compilation with 2.13 and 2.12. However the automatic rewrites to fix the warnings (my second commit: dotty-staging/cats@5ea50ee) indeed do break compatibility with 2.13 and 2.12. |
I confirm cats successfully compiles after my patch! I will make a PR to the cats repo. Now, some dependent projects are not compiling, I will probably need to update them as well:
|
32042b3
to
9f1b403
Compare
When I try to test the build locally, I get an error about a name clash for Seems to be the same issue as #22890.
|
That does not happen on the CI. Not sure why. |
The local classpath, as displayed in the error message above, with one item per line, is:
So maybe the clash comes from having both the Scala JS library 3.7, and the JVM library 3.3? |
0a70cb7
to
5d7a74c
Compare
Fixed after rebasing on top of |
Updated projects: cats cats-effect-3 cats-mtl coops discipline discipline-munit discipline-specs2 fs2 http4s munit munit-cats-effect scalacheck scalacheck-effect scalatest Added project: munit-scalacheck
5d7a74c
to
783bd79
Compare
Currently failing on the CI:
Locally, I only have |
Oh, it's again #22890. Thanks to the fix, a warning is emitted on the CI instead of an error, but because [info] compiling 2 Scala sources to /__w/scala3/scala3/community-build/community-projects/discipline/core/.js/target/scala-3.7.1-RC1-bin-SNAPSHOT/classes ...
[warn] package scala contains object and package with same name: caps.
[warn] This indicates that there are several versions of the Scala standard library on the classpath.
[warn] The build should be reconfigured so that only one version of the standard library is on the classpath.
[error] No warnings can be incurred under -Werror (or -Xfatal-warnings)
[warn] one warning found
[error] one error found
[error] (coreJS / Compile / compileIncremental) Compilation failed
[error] Total time: 3 s, completed Apr 15, 2025 2:15:01 PM
[error] Test dotty.communitybuild.CommunityBuildTestB.disciplineSpecs2 failed: java.lang.RuntimeException: Publish command exited with code 1 for project discipline. Project details:
Error: SbtCommunityProject(discipline,coreJVM/test;coreJS/test,List(),List(SbtCommunityProject(scalacheck,coreJVM/test;coreJS/test,List(),List(),dotty.communitybuild.SbtCommunityProject$$$Lambda$21/1754348815@645067ff,coreJVM/publishLocal;coreJS/publishLocal,null,List(-Xcheck-macros, -Wsafe-init))),dotty.communitybuild.SbtCommunityProject$$$Lambda$21/1754348815@645067ff,set every credentials := Nil;coreJVM/publishLocal;coreJS/publishLocal,null,List(-Xcheck-macros)), took 28.037 sec
Error: at dotty.communitybuild.CommunityProject.publish(projects.scala:59)
Error: at dotty.communitybuild.CommunityProject.publish$(projects.scala:32)
Error: at dotty.communitybuild.SbtCommunityProject.publish(projects.scala:93)
Error: at dotty.communitybuild.CommunityBuildRunner$.run$$anonfun$1(CommunityBuildRunner.scala:20)
Error: at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
Error: at scala.runtime.function.JProcedure1.apply(JProcedure1.java A quick fix can be to disable fatal warnings for But I'd also like to understand why I am now getting this warning on the CI, and not locally. |
Update Cats (and dependent projects), hopping to fix #22897.
Updated projects:
Added project: