From 6ed267a8368e6a0c34450dcc27018d9030863621 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 6 Nov 2019 16:40:22 +0000 Subject: [PATCH 1/4] Enable bincompat checking for 2.13 --- build.sbt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index 38f08cb4be..ed4c5cfa82 100644 --- a/build.sbt +++ b/build.sbt @@ -262,12 +262,9 @@ def mimaPrevious(moduleName: String, scalaVer: String, ver: String): List[Module // 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") - if (priorTo2_13(scalaVer)) { - (mimaVersions ++ extraVersions) - .filterNot(excludedVersions.contains(_)) - .map(v => "org.typelevel" %% moduleName % v) - } else List() - + (mimaVersions ++ (if (priorTo2_13(scalaVer)) extraVersions else Nil)) + .filterNot(excludedVersions.contains(_)) + .map(v => "org.typelevel" %% moduleName % v) } def mimaSettings(moduleName: String) = From d10e8a504281519a75ec2fb5cf7506373cb75314 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 6 Nov 2019 16:45:55 +0000 Subject: [PATCH 2/4] Check bincompat for 2.13 in CI --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1ca2bf0a42..1a2e18299c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,10 +60,13 @@ jobs: env: TEST="scalafix" script: cd scalafix && sbt tests/test - - stage: test + - &bincompat + stage: test env: TEST="binary compatibility" script: sbt ++$TRAVIS_SCALA_VERSION! validateBC scala: *scala_version_212 + - <<: *bincompat + scala: *scala_version_213 - stage: styling env: TEST="linting" From eac64a2c34f5804a889c2809182af6262f0484e8 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 6 Nov 2019 17:08:50 +0000 Subject: [PATCH 3/4] Fix bincompat breakage on 2.13 --- core/src/main/scala-2.13+/cats/instances/stream.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala-2.13+/cats/instances/stream.scala b/core/src/main/scala-2.13+/cats/instances/stream.scala index fb313600ee..65e8f072ce 100644 --- a/core/src/main/scala-2.13+/cats/instances/stream.scala +++ b/core/src/main/scala-2.13+/cats/instances/stream.scala @@ -161,7 +161,7 @@ trait StreamInstances extends cats.kernel.instances.StreamInstances { } @deprecated("Use catsStdParallelForZipLazyList", "2.0.0-RC2") - implicit val catsStdParallelForStreamZipStream: Parallel.Aux[Stream, ZipStream] = + implicit def catsStdParallelForStreamZipStream: Parallel.Aux[Stream, ZipStream] = new Parallel[Stream] { type F[x] = ZipStream[x] From 7b4fb0c51e2c912f2298d06dfc777795781470f0 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 6 Nov 2019 17:09:20 +0000 Subject: [PATCH 4/4] Enable bincompat checking for more published modules --- build.sbt | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/build.sbt b/build.sbt index ed4c5cfa82..98093ec787 100644 --- a/build.sbt +++ b/build.sbt @@ -226,7 +226,7 @@ lazy val docSettings = Seq( includeFilter in Jekyll := (includeFilter in makeSite).value ) -def mimaPrevious(moduleName: String, scalaVer: String, ver: String): List[ModuleID] = { +def mimaPrevious(moduleName: String, scalaVer: String, ver: String, includeCats1: Boolean = true): List[ModuleID] = { import sbtrelease.Version def semverBinCompatVersions(major: Int, minor: Int, patch: Int): List[(Int, Int, Int)] = { @@ -262,14 +262,14 @@ def mimaPrevious(moduleName: String, scalaVer: String, ver: String): List[Module // 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") - (mimaVersions ++ (if (priorTo2_13(scalaVer)) extraVersions else Nil)) + (mimaVersions ++ (if (priorTo2_13(scalaVer) && includeCats1) extraVersions else Nil)) .filterNot(excludedVersions.contains(_)) .map(v => "org.typelevel" %% moduleName % v) } -def mimaSettings(moduleName: String) = +def mimaSettings(moduleName: String, includeCats1: Boolean = true) = Seq( - mimaPreviousArtifacts := mimaPrevious(moduleName, scalaVersion.value, version.value).toSet, + mimaPreviousArtifacts := mimaPrevious(moduleName, scalaVersion.value, version.value, includeCats1).toSet, mimaBinaryIssueFilters ++= { import com.typesafe.tools.mima.core._ import com.typesafe.tools.mima.core.ProblemFilters._ @@ -514,7 +514,7 @@ lazy val kernelLaws = crossProject(JSPlatform, JVMPlatform) .settings(testingDependencies) .settings(scalacOptions in Test := (scalacOptions in Test).value.filter(_ != "-Xfatal-warnings")) .jsSettings(commonJsSettings) - .jvmSettings(commonJvmSettings) + .jvmSettings(commonJvmSettings ++ mimaSettings("cats-kernel-laws", includeCats1 = false)) .jsSettings(coverageEnabled := false) .dependsOn(kernel) @@ -537,7 +537,7 @@ lazy val laws = crossProject(JSPlatform, JVMPlatform) .settings(disciplineDependencies) .settings(testingDependencies) .jsSettings(commonJsSettings) - .jvmSettings(commonJvmSettings) + .jvmSettings(commonJvmSettings ++ mimaSettings("cats-laws", includeCats1 = false)) .jsSettings(coverageEnabled := false) lazy val free = crossProject(JSPlatform, JVMPlatform) @@ -568,7 +568,7 @@ lazy val testkit = crossProject(JSPlatform, JVMPlatform) .settings(catsSettings) .settings(disciplineDependencies) .jsSettings(commonJsSettings) - .jvmSettings(commonJvmSettings) + .jvmSettings(commonJvmSettings ++ mimaSettings("cats-testkit", includeCats1 = false)) .settings(scalacOptions := scalacOptions.value.filter(_ != "-Xfatal-warnings")) lazy val alleycatsCore = crossProject(JSPlatform, JVMPlatform) @@ -581,7 +581,7 @@ lazy val alleycatsCore = crossProject(JSPlatform, JVMPlatform) .settings(scoverageSettings) .settings(includeGeneratedSrc) .jsSettings(commonJsSettings) - .jvmSettings(commonJvmSettings) + .jvmSettings(commonJvmSettings ++ mimaSettings("alleycats-core", includeCats1 = false)) lazy val alleycatsLaws = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Pure) @@ -594,7 +594,7 @@ lazy val alleycatsLaws = crossProject(JSPlatform, JVMPlatform) .settings(disciplineDependencies) .settings(testingDependencies) .jsSettings(commonJsSettings) - .jvmSettings(commonJvmSettings) + .jvmSettings(commonJvmSettings ++ mimaSettings("alleycats-laws", includeCats1 = false)) .jsSettings(coverageEnabled := false) lazy val alleycatsTests = crossProject(JSPlatform, JVMPlatform) @@ -638,14 +638,7 @@ lazy val binCompatTest = project useCoursier := false, commonScalaVersionSettings, addCompilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full)), - libraryDependencies ++= List( - { - if (priorTo2_13(scalaVersion.value)) - mimaPrevious("cats-core", scalaVersion.value, version.value).last % Provided - else //We are not testing BC on Scala 2.13 yet. - "org.typelevel" %% "cats-core" % "2.0.0-M4" % Provided - } - ) + libraryDependencies += mimaPrevious("cats-core", scalaVersion.value, version.value).last % Provided ) .settings(testingDependencies) .dependsOn(core.jvm % Test)