From 038772c99dfe03003d8f49e2a4f318e2df2a2dff Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:05:54 +0000 Subject: [PATCH 1/7] Update nscplugin, sbt-scala-native to 0.5.1 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 7e7e1ae8e0..8217b3cae5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,5 +4,5 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.10.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") From 9162bd81545a28c693f5bb4c0eb941c80a4485e3 Mon Sep 17 00:00:00 2001 From: satorg Date: Wed, 1 May 2024 11:10:43 -0700 Subject: [PATCH 2/7] Update discipline-munit to 2.0.0-M4 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 147808991a..186b27ab50 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ val scalaCheckVersion = "1.17.1" val disciplineVersion = "1.6.0" -val disciplineMunitVersion = "2.0.0-M3" +val disciplineMunitVersion = "2.0.0-M4" val munitVersion = "1.0.0-RC1" From f03a4434925627ff3f1422096bc5607bceaddff4 Mon Sep 17 00:00:00 2001 From: satorg Date: Wed, 1 May 2024 11:13:18 -0700 Subject: [PATCH 3/7] Update scalacheck to 1.18.0 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 186b27ab50..03401e2bd7 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ ThisBuild / tlBaseVersion := "2.11" -val scalaCheckVersion = "1.17.1" +val scalaCheckVersion = "1.18.0" val disciplineVersion = "1.6.0" From ac3d1b0bb4c98a8fc915cf814078af98786e52b0 Mon Sep 17 00:00:00 2001 From: satorg Date: Wed, 1 May 2024 11:15:04 -0700 Subject: [PATCH 4/7] Update discipline-core to 1.7.0 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 03401e2bd7..d25a00f157 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ ThisBuild / tlBaseVersion := "2.11" val scalaCheckVersion = "1.18.0" -val disciplineVersion = "1.6.0" +val disciplineVersion = "1.7.0" val disciplineMunitVersion = "2.0.0-M4" From 3660c1c5dedfe3a0467f0100e741f433f7135280 Mon Sep 17 00:00:00 2001 From: satorg Date: Wed, 1 May 2024 11:25:17 -0700 Subject: [PATCH 5/7] Apply sbt githubWorkflowGenerate --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8223cdc2b..afe8ec200b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -360,7 +360,7 @@ jobs: - name: Submit Dependencies uses: scalacenter/sbt-dependency-submission@v2 with: - modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 docs_2.12 docs_2.13 docs_3 cats-tests_sjs1_2.12 cats-tests_sjs1_2.13 cats-tests_sjs1_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 cats-tests_2.12 cats-tests_2.13 cats-tests_3 bincompattest_2.12 bincompattest_2.13 bincompattest_3 cats-tests_native0.4_2.12 cats-tests_native0.4_2.13 cats-tests_native0.4_3 cats-bench_2.12 cats-bench_2.13 cats-bench_3 + modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 docs_2.12 docs_2.13 docs_3 cats-tests_sjs1_2.12 cats-tests_sjs1_2.13 cats-tests_sjs1_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 cats-tests_2.12 cats-tests_2.13 cats-tests_3 bincompattest_2.12 bincompattest_2.13 bincompattest_3 cats-tests_native0.5_2.12 cats-tests_native0.5_2.13 cats-tests_native0.5_3 cats-bench_2.12 cats-bench_2.13 cats-bench_3 configs-ignore: test scala-tool scala-doc-tool test-internal validate-steward: From a4068f4f05857752040c40f83f8fae39f4244570 Mon Sep 17 00:00:00 2001 From: satorg Date: Wed, 1 May 2024 17:20:37 -0700 Subject: [PATCH 6/7] fix `tlVersionIntroduced` for native cross-projects --- build.sbt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index d25a00f157..e7e8d789b3 100644 --- a/build.sbt +++ b/build.sbt @@ -65,9 +65,14 @@ lazy val commonJsSettings = Seq( ) Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1) -lazy val commonNativeSettings = Seq( + +// Cats 2.11.0 switches to Scala Native 0.5. +// Therefore `tlVersionIntroduced` should be reset to 2.11.0 for all scala versions in all native cross-projects. +val commonNativeTlVersionIntroduced = List("2.12", "2.13", "3").map(_ -> "2.11.0").toMap + +lazy val commonNativeSettings = Seq[Setting[?]]( doctestGenTests := Seq.empty, - tlVersionIntroduced ++= List("2.12", "2.13").map(_ -> "2.4.0").toMap + ("3" -> "2.8.0") + tlVersionIntroduced := commonNativeTlVersionIntroduced ) lazy val disciplineDependencies = Seq( @@ -127,8 +132,10 @@ lazy val algebraSettings = Seq[Setting[?]]( ) lazy val algebraNativeSettings = Seq[Setting[?]]( - tlMimaPreviousVersions ~= (_ - "2.2.3"), - tlVersionIntroduced += ("3" -> "2.8.0") + // Reset to auto-populate from `tlVersionIntroduced` below. + tlMimaPreviousVersions := Set.empty, + // Should be reset to the common setting value, because `algebraSettings` re-defines it. + tlVersionIntroduced := commonNativeTlVersionIntroduced ) lazy val algebra = crossProject(JSPlatform, JVMPlatform, NativePlatform) From ea519d48dc5c4f6c4c17c7dfd20476bb59d148b8 Mon Sep 17 00:00:00 2001 From: Paul J Thordarson Date: Sun, 12 May 2024 10:08:33 -0400 Subject: [PATCH 7/7] Remove special ExecutionContextExecutor A special synchronous executor for scala-native is no longer needed for FutureSuite as scala-native 0.5.x is multi-threaded. FutureSuite is now shared between JVM and Native. --- .../test/scala/cats/tests/FutureSuite.scala | 0 .../scala/cats/native/tests/FutureSuite.scala | 83 ------------------- 2 files changed, 83 deletions(-) rename tests/{jvm => jvm-native}/src/test/scala/cats/tests/FutureSuite.scala (100%) delete mode 100644 tests/native/src/test/scala/cats/native/tests/FutureSuite.scala diff --git a/tests/jvm/src/test/scala/cats/tests/FutureSuite.scala b/tests/jvm-native/src/test/scala/cats/tests/FutureSuite.scala similarity index 100% rename from tests/jvm/src/test/scala/cats/tests/FutureSuite.scala rename to tests/jvm-native/src/test/scala/cats/tests/FutureSuite.scala diff --git a/tests/native/src/test/scala/cats/native/tests/FutureSuite.scala b/tests/native/src/test/scala/cats/native/tests/FutureSuite.scala deleted file mode 100644 index 205ec7a205..0000000000 --- a/tests/native/src/test/scala/cats/native/tests/FutureSuite.scala +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2015 Typelevel - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cats.native.tests - -import cats.kernel.laws.discipline.{MonoidTests => MonoidLawTests, SemigroupTests => SemigroupLawTests} -import cats.kernel.{Eq, Semigroup} -import cats.laws.discipline._ -import cats.laws.discipline.arbitrary._ -import cats.syntax.either._ -import cats.tests.{CatsSuite, ListWrapper} -import org.scalacheck.Arbitrary.arbitrary -import org.scalacheck.rng.Seed -import org.scalacheck.{Arbitrary, Cogen} - -import scala.concurrent.{Await, ExecutionContextExecutor, Future} -import scala.concurrent.duration._ - -class FutureSuite extends CatsSuite { - val timeout = 3.seconds - - // TODO: We shouldn't do this! See: https://github.com/scala-js/scala-js/issues/2102 - implicit private object SynchronousExecutor extends ExecutionContextExecutor { - def execute(runnable: Runnable): Unit = - try { - runnable.run() - } catch { - case t: Throwable => reportFailure(t) - } - - def reportFailure(t: Throwable): Unit = - t.printStackTrace() - } - - def futureEither[A](f: Future[A]): Future[Either[Throwable, A]] = - f.map(Either.right[Throwable, A]).recover { case t => Either.left(t) } - - implicit def eqfa[A: Eq]: Eq[Future[A]] = { (fx, fy) => - val fz = futureEither(fx).zip(futureEither(fy)) - Await.result(fz.map { case (tx, ty) => tx === ty }, timeout) - } - - implicit def cogen[A: Cogen]: Cogen[Future[A]] = - Cogen[Future[A]] { (seed: Seed, t: Future[A]) => - Cogen[A].perturb(seed, Await.result(t, timeout)) - } - - implicit val throwableEq: Eq[Throwable] = - Eq.by[Throwable, String](_.toString) - - // Need non-fatal Throwables for Future recoverWith/handleError - implicit val nonFatalArbitrary: Arbitrary[Throwable] = - Arbitrary(arbitrary[Exception].map(identity)) - - checkAll("Future with Throwable", MonadErrorTests[Future, Throwable].monadError[Int, Int, Int]) - checkAll("Future", MonadTests[Future].monad[Int, Int, Int]) - checkAll("Future", CoflatMapTests[Future].coflatMap[Int, Int, Int]) - - { - implicit val F: Semigroup[ListWrapper[Int]] = ListWrapper.semigroup[Int] - checkAll("Future[ListWrapper[Int]]", SemigroupLawTests[Future[ListWrapper[Int]]].semigroup) - } - - checkAll("Future[Int]", MonoidLawTests[Future[Int]].monoid) -}