typelevel / cats

Lightweight, modular, and extensible library for functional programming.
https://typelevel.org/cats/
Other
5.25k stars 1.21k forks source link

Upgrade scalacheck to 1.14.0 #2449

Closed avdv closed 5 years ago

avdv commented 6 years ago

I am using specs2 4.3.x and I want to use cats-laws with it.

Unfortunately, specs2-scalacheck >= 4.2.0 requires scalacheck 1.14.0 but cats-laws 1.2.0 is build with scalacheck 1.13.5 which is binary incompatible with each other.

This results in the following runtime exception:

[error] cannot create an instance for class com.rub.models.resources.ParamSpec
[error]   caused by java.lang.NoSuchMethodError: org.scalacheck.Cogen$.apply(Lorg/scalacheck/Cogen;Lorg/scalacheck/Cogen;)Lorg/scalacheck/Cogen;
[error]   sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error]   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[error]   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error]   java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[error]   org.specs2.reflect.Classes.$anonfun$createInstanceForConstructor$1(Classes.scala:69)
[error]   org.specs2.reflect.Classes.newInstance(Classes.scala:91)
johnynek commented 6 years ago

We can't do that until we break binary compatibility (cats 3.0 is our current plan, cats 2.0 will be binary compatible for scala 2.12, but not 2.11). scalacheck should ideally be using mima, and they should have bumped to scalacheck 2.0.0.

cc @non

SethTisue commented 6 years ago

is it necessary for the bincompat guarantees to extend even to test-only dependencies...? (I'm genuinely asking, not expressing an opinion)

rossabaker commented 6 years ago

There is a deeper discussion of this on https://github.com/typelevel/cats/pull/2312 with a possible solution for cats-1.x.

johnynek commented 6 years ago

@SethTisue cats-laws is not test-only, for that artifact, scalacheck is a regular dependency.

kailuowang commented 5 years ago

This has been done.