diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 406baf9a9..013eb7e21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: java: [ 8, 11 ] # WARN: build.sbt depends on this key path, as scalaVersion and # crossScalaVersions is determined from it - scala: [ 2.12.15, 2.13.8, 3.1.2 ] + scala: [ 2.12.20, 2.13.16, 3.3.5 ] env: CI: true @@ -63,9 +63,9 @@ jobs: # WARN: build.sbt depends on this key path, as scalaVersion and # crossScalaVersions is determined from it include: - - { java: 8, scala: 2.12.15 } - - { java: 8, scala: 2.13.8 } - - { java: 8, scala: 3.1.2 } + - { java: 8, scala: 2.12.20 } + - { java: 8, scala: 2.13.16 } + - { java: 8, scala: 3.3.5 } env: CI: true @@ -115,9 +115,9 @@ jobs: fail-fast: false matrix: include: - - { java: 8, scala: 2.12.15 } - - { java: 8, scala: 2.13.8 } - - { java: 8, scala: 3.1.2 } + - { java: 8, scala: 2.12.20 } + - { java: 8, scala: 2.13.16 } + - { java: 8, scala: 3.3.5 } steps: - uses: actions/checkout@v2 @@ -158,9 +158,9 @@ jobs: fail-fast: false matrix: include: - - { java: 8, scala: 2.13.8 } + - { java: 8, scala: 2.13.16 } # TODO: enable this after it works! - # - { java: 8, scala: 3.1.2 } + # - { java: 8, scala: 3.3.5 } steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index bb032f1cd..d5899b7e7 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ TAGS metals.sbt .vscode .bsp +.planning/ diff --git a/.jvmopts b/.jvmopts index 69394b39e..b205e5036 100644 --- a/.jvmopts +++ b/.jvmopts @@ -4,5 +4,4 @@ -XX:ReservedCodeCacheSize=250M -XX:+TieredCompilation -XX:-UseGCOverheadLimit --XX:+CMSClassUnloadingEnabled diff --git a/build.sbt b/build.sbt index ab1241bd5..e51405983 100644 --- a/build.sbt +++ b/build.sbt @@ -3,6 +3,7 @@ import sbt.{ Def, Global, Tags } import scala.collection.immutable.SortedSet import MonixBuildUtils._ +import org.typelevel.scalacoptions.ScalacOptions val benchmarkProjects = List( "benchmarksPrev", @@ -31,9 +32,9 @@ val reactiveStreams_Version = "1.0.4" val macrotaskExecutor_Version = "1.0.0" val minitest_Version = "2.9.6" val implicitBox_Version = "0.3.4" -val kindProjector_Version = "0.13.2" +val kindProjector_Version = "0.13.3" val betterMonadicFor_Version = "0.3.1" -val silencer_Version = "1.7.8" +val silencer_Version = "1.7.19" val scalaCompat_Version = "2.7.0" // The Monix version with which we must keep binary compatibility. @@ -168,15 +169,19 @@ lazy val sharedSettings = pgpSettings ++ Seq( else ver }, - /* // Enable this to debug warnings... Compile / scalacOptions ++= { CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, 13)) => Seq("-Wconf:any:warning-verbose") + case Some((2, 13)) => Seq( + "-Wconf:cat=other-implicit-type:silent", + // Silence -Wvalue-discard warnings: tpolecat 0.5.x enables -Wvalue-discard which + // catches discarded values (e.g. trySuccess/tryFailure returning Boolean). These are + // pre-existing patterns in the codebase and not bugs. + "-Wconf:msg=unused value of type:silent" + ) case _ => Seq.empty } }, - */ // Disabled from the sbt-tpolecat set Compile / scalacOptions --= Seq( @@ -191,6 +196,16 @@ lazy val sharedSettings = pgpSettings ++ Seq( "-Wunused:params", "-Xlint:infer-any" ), + // Disabled from tpolecat for test compilation: + // -Wunused:patvars triggers on for-comprehension loop vars in tests (pre-existing pattern) + // -Xlint:constant triggers on intentional overflow tests (e.g. Long.MaxValue + 1) + Test / scalacOptions --= { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 13)) => Seq("-Wunused:patvars", "-Xlint:constant") + case Some((2, 12)) => Seq("-Ywarn-unused:patvars") + case _ => Seq.empty + } + }, // Turning off fatal warnings for doc generation Compile / doc / tpolecatExcludeOptions ++= ScalacOptions.defaultConsoleExclude, // Silence everything in auto-generated files @@ -202,7 +217,9 @@ lazy val sharedSettings = pgpSettings ++ Seq( }, scalacOptions --= { if (isDotty.value) - Seq("-Xfatal-warnings") + // tpolecat uses -Werror in Scala 3 (not -Xfatal-warnings); remove both to disable fatal warnings + // so that pre-existing value-discard and similar patterns don't break Scala 3 builds + Seq("-Xfatal-warnings", "-Werror") else Seq() }, diff --git a/monix-execution/shared/src/main/scala/monix/execution/CancelablePromise.scala b/monix-execution/shared/src/main/scala/monix/execution/CancelablePromise.scala index fc00e7895..f60512961 100644 --- a/monix-execution/shared/src/main/scala/monix/execution/CancelablePromise.scala +++ b/monix-execution/shared/src/main/scala/monix/execution/CancelablePromise.scala @@ -242,7 +242,7 @@ object CancelablePromise { } if (errors ne null) { // Throws all errors as a composite - val x :: xs = errors.toList + val x :: xs = errors.toList: @unchecked throw Platform.composeErrors(x, xs: _*) } true diff --git a/project/build.properties b/project/build.properties index 08e68ae69..878b19c8f 100644 --- a/project/build.properties +++ b/project/build.properties @@ -15,4 +15,4 @@ # limitations under the License. # -sbt.version=1.5.2 +sbt.version=1.10.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index 87a949525..88840f5df 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,15 +1,17 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0") -addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.0") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.18.2") +addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.4") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.10.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.3.1") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") -addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.30") -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.3.1") -addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.2") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") +addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.32") +addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.3") +addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.0") +addSbtPlugin("com.github.sbt" % "sbt-git" % "2.1.0") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2") +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1") + +libraryDependencySchemes += "com.lihaoyi" %% "geny" % VersionScheme.Always \ No newline at end of file