Skip to content
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

Migrate to sbt-typelevel #2791

Merged
merged 20 commits into from
Jan 20, 2022
Merged

Conversation

armanbilge
Copy link
Member

No description provided.

build.sbt Outdated
Comment on lines 263 to 264
ProblemFilters
.exclude[ReversedMissingMethodProblem]("fs2.io.net.tls.TLSSocket.applicationProtocol")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a legit bincompat break 😬 but yolo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, TLSSocket is sealed. phew!

@armanbilge
Copy link
Member Author

FYI this would be a very good chance to migrate to s01 with

ThisBuild / tlSonatypeUseLegacyHost := false

@armanbilge
Copy link
Member Author

MiMa problems we are just discovering on JVM Scala 3:

[error] fs2-io: Failed binary compatibility check against co.fs2:fs2-io_3:3.1.3 (e:info.versionScheme=early-semver)! Found 3 potential problems (filtered 5)
[error]  * static method utf8Charset()java.nio.charset.Charset in class fs2.io.package does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.package.utf8Charset")
[error]  * method utf8Charset()java.nio.charset.Charset in object fs2.io.package does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.package.utf8Charset")
[error]  * abstract method applicationProtocol()java.lang.Object in interface fs2.io.net.tls.TLSSocketPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.tls.TLSSocketPlatform.applicationProtocol")
[error] fs2-reactive-streams: Failed binary compatibility check against co.fs2:fs2-reactive-streams_3:3.1.5 (e:info.versionScheme=early-semver)! Found 2 potential problems
[error]  * static method fsm(cats.effect.kernel.Async)java.lang.Object in class fs2.interop.reactivestreams.StreamSubscriber does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.interop.reactivestreams.StreamSubscriber.fsm")
[error]  * method fsm(cats.effect.kernel.Async)java.lang.Object in object fs2.interop.reactivestreams.StreamSubscriber does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.interop.reactivestreams.StreamSubscriber.fsm")
[info] fs2-benchmark: mimaPreviousArtifacts is empty, not analyzing binary compatibility.
[error] fs2-core: Failed binary compatibility check against co.fs2:fs2-core_3:3.1.1 (e:info.versionScheme=early-semver)! Found 7 potential problems (filtered 187)
[error]  * synthetic static method gzip$default$1$(fs2.compression.Compression)Int in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gzip$default$1$")
[error]  * synthetic static method gzip$default$2$(fs2.compression.Compression)scala.Option in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gzip$default$2$")
[error]  * synthetic static method gzip$default$3$(fs2.compression.Compression)scala.Option in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gzip$default$3$")
[error]  * synthetic static method gzip$default$4$(fs2.compression.Compression)scala.Option in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gzip$default$4$")
[error]  * synthetic static method gzip$default$5$(fs2.compression.Compression)scala.Option in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gzip$default$5$")
[error]  * synthetic static method gzip$default$6$(fs2.compression.Compression)scala.Option in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gzip$default$6$")
[error]  * synthetic static method gunzip$default$1$(fs2.compression.Compression)Int in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gunzip$default$1$")
[error] java.lang.RuntimeException: Failed binary compatibility check against co.fs2:fs2-io_3:3.1.3 (e:info.versionScheme=early-semver)! Found 3 potential problems (filtered 5)

@armanbilge armanbilge mentioned this pull request Jan 13, 2022
2 tasks
@armanbilge
Copy link
Member Author

MiMa just keeps coming 😓

[error] fs2-core: Failed binary compatibility check against co.fs2:fs2-core_3:3.1.1 (e:info.versionScheme=early-semver)! Found 1 potential problems (filtered 193)
[error]  * synthetic static method gunzip$default$1$(fs2.compression.Compression)Int in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gunzip$default$1$")
[info] compiling 3 Scala sources to /workspace/fs2/scodec/js/target/scala-3.1.0/classes ...
[info] fs2-scodec: mimaPreviousArtifacts is empty, not analyzing binary compatibility.
[error] fs2-reactive-streams: Failed binary compatibility check against co.fs2:fs2-reactive-streams_3:3.0.6 (e:info.versionScheme=early-semver)! Found 8 potential problems (filtered 6)
[error]  * abstract method onSubscribe(org.reactivestreams.Subscription)java.lang.Object in interface fs2.interop.reactivestreams.StreamSubscriber#FSM has a different result type in current version, where it is Unit rather than java.lang.Object
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("fs2.interop.reactivestreams.StreamSubscriber#FSM.onSubscribe")
[error]  * abstract method onNext(java.lang.Object)java.lang.Object in interface fs2.interop.reactivestreams.StreamSubscriber#FSM has a different result type in current version, where it is Unit rather than java.lang.Object
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("fs2.interop.reactivestreams.StreamSubscriber#FSM.onNext")
[error]  * abstract method onError(java.lang.Throwable)java.lang.Object in interface fs2.interop.reactivestreams.StreamSubscriber#FSM has a different result type in current version, where it is Unit rather than java.lang.Object
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("fs2.interop.reactivestreams.StreamSubscriber#FSM.onError")
[error]  * abstract method onComplete()java.lang.Object in interface fs2.interop.reactivestreams.StreamSubscriber#FSM has a different result type in current version, where it is Unit rather than java.lang.Object
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("fs2.interop.reactivestreams.StreamSubscriber#FSM.onComplete")
[error]  * abstract method onSubscribe(org.reactivestreams.Subscription)Unit in interface fs2.interop.reactivestreams.StreamSubscriber#FSM is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("fs2.interop.reactivestreams.StreamSubscriber#FSM.onSubscribe")
[error]  * abstract method onNext(java.lang.Object)Unit in interface fs2.interop.reactivestreams.StreamSubscriber#FSM is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("fs2.interop.reactivestreams.StreamSubscriber#FSM.onNext")
[error]  * abstract method onError(java.lang.Throwable)Unit in interface fs2.interop.reactivestreams.StreamSubscriber#FSM is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("fs2.interop.reactivestreams.StreamSubscriber#FSM.onError")
[error]  * abstract method onComplete()Unit in interface fs2.interop.reactivestreams.StreamSubscriber#FSM is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("fs2.interop.reactivestreams.StreamSubscriber#FSM.onComplete")
[info] fs2-scodec: mimaPreviousArtifacts is empty, not analyzing binary compatibility.
[info] compiling 13 Scala sources to /workspace/fs2/benchmark/target/scala-3.1.0/classes ...
[info] compiling 48 Scala sources to /workspace/fs2/protocols/jvm/target/scala-3.1.0/classes ...
[error] fs2-io: Failed binary compatibility check against co.fs2:fs2-io_3:3.0.4 (e:info.versionScheme=early-semver)! Found 31 potential problems (filtered 166)
[error]  * synthetic static method copy$default$3$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.copy$default$3$")
[error]  * synthetic static method createDirectory$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.createDirectory$default$2$")
[error]  * synthetic static method createDirectories$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.createDirectories$default$2$")
[error]  * synthetic static method deleteDirectoryRecursively$default$2$(fs2.io.file.Files)scala.collection.immutable.Set in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.deleteDirectoryRecursively$default$2$")
[error]  * synthetic static method exists$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.exists$default$2$")
[error]  * synthetic static method isDirectory$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.isDirectory$default$2$")
[error]  * synthetic static method isFile$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.isFile$default$2$")
[error]  * synthetic static method move$default$3$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.move$default$3$")
[error]  * synthetic static method permissions$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.permissions$default$2$")
[error]  * synthetic static method readCursor$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.readCursor$default$2$")
[error]  * synthetic static method tempFile$default$1$(fs2.io.file.Files)scala.Option in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.tempFile$default$1$")
[error]  * synthetic static method tempFile$default$2$(fs2.io.file.Files)java.lang.String in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.tempFile$default$2$")
[error]  * synthetic static method tempFile$default$3$(fs2.io.file.Files)java.lang.String in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.tempFile$default$3$")
[error]  * synthetic static method tempFile$default$4$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.tempFile$default$4$")
[error]  * synthetic static method tempDirectory$default$1$(fs2.io.file.Files)scala.Option in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.tempDirectory$default$1$")
[error]  * synthetic static method tempDirectory$default$2$(fs2.io.file.Files)java.lang.String in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.tempDirectory$default$2$")
[error]  * synthetic static method tempDirectory$default$3$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.tempDirectory$default$3$")
[error]  * synthetic static method walk$default$3$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.walk$default$3$")
[error]  * synthetic static method watch$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.watch$default$2$")
[error]  * synthetic static method watch$default$3$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.watch$default$3$")
[error]  * synthetic static method watch$default$4$(fs2.io.file.Files)scala.concurrent.duration.FiniteDuration in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.watch$default$4$")
[error]  * synthetic static method writeAll$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.writeAll$default$2$")
[error]  * synthetic static method writeCursor$default$2$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.writeCursor$default$2$")
[error]  * synthetic static method writeRotate$default$3$(fs2.io.file.Files)scala.collection.immutable.Seq in interface fs2.io.file.Files does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.Files.writeRotate$default$3$")
[error]  * synthetic static method socketGroup$default$1$(fs2.io.net.Network)Int in interface fs2.io.net.Network does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.Network.socketGroup$default$1$")
[error]  * synthetic static method socketGroup$default$2$(fs2.io.net.Network)java.util.concurrent.ThreadFactory in interface fs2.io.net.Network does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.Network.socketGroup$default$2$")
[error]  * synthetic static method datagramSocketGroup$default$1$(fs2.io.net.Network)java.util.concurrent.ThreadFactory in interface fs2.io.net.Network does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.Network.datagramSocketGroup$default$1$")
[error]  * synthetic static method dtlsClient$default$3$(fs2.io.net.tls.TLSContext)fs2.io.net.tls.TLSParameters in interface fs2.io.net.tls.TLSContext does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.tls.TLSContext.dtlsClient$default$3$")
[error]  * synthetic static method dtlsClient$default$4$(fs2.io.net.tls.TLSContext)scala.Option in interface fs2.io.net.tls.TLSContext does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.tls.TLSContext.dtlsClient$default$4$")
[error]  * synthetic static method dtlsServer$default$3$(fs2.io.net.tls.TLSContext)fs2.io.net.tls.TLSParameters in interface fs2.io.net.tls.TLSContext does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.tls.TLSContext.dtlsServer$default$3$")
[error]  * synthetic static method dtlsServer$default$4$(fs2.io.net.tls.TLSContext)scala.Option in interface fs2.io.net.tls.TLSContext does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.tls.TLSContext.dtlsServer$default$4$")
[info] fs2-benchmark: mimaPreviousArtifacts is empty, not analyzing binary compatibility.
[info] fs2-protocols: mimaPreviousArtifacts is empty, not analyzing binary compatibility.
[info] fs2-node: mimaPreviousArtifacts is empty, not analyzing binary compatibility.
[info] compiling 61 Scala sources to /workspace/fs2/io/js/target/scala-3.1.0/classes ...
[info] compiling 48 Scala sources to /workspace/fs2/protocols/js/target/scala-3.1.0/classes ...
[error] fs2-io: Failed binary compatibility check against co.fs2:fs2-io_sjs1_3:3.1.1 (e:info.versionScheme=early-semver)! Found 8 potential problems (filtered 57)
[error]  * method this(scala.scalajs.js.JavaScriptException)Unit in class fs2.io.file.JavaScriptAccessDeniedException does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.JavaScriptAccessDeniedException.this")
[error]  * method this(scala.scalajs.js.JavaScriptException)Unit in class fs2.io.file.JavaScriptDirectoryNotEmptyException does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.JavaScriptDirectoryNotEmptyException.this")
[error]  * method this(scala.scalajs.js.JavaScriptException)Unit in class fs2.io.file.JavaScriptFileAlreadyExistsException does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.JavaScriptFileAlreadyExistsException.this")
[error]  * method this(scala.scalajs.js.JavaScriptException)Unit in class fs2.io.file.JavaScriptNoSuchFileException does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.JavaScriptNoSuchFileException.this")
[error]  * method this(scala.scalajs.js.JavaScriptException)Unit in class fs2.io.file.JavaScriptNotDirectoryException does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.file.JavaScriptNotDirectoryException.this")
[error]  * method this(scala.scalajs.js.JavaScriptException)Unit in class fs2.io.net.JavaScriptSocketException does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.JavaScriptSocketException.this")
[error]  * class fs2.io.net.JavaScriptUnknownException does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("fs2.io.net.JavaScriptUnknownException")
[error]  * method this(fs2.io.net.tls.TLSSocketCompanionPlatform,fs2.internal.jsdeps.node.tlsMod.TLSSocket,fs2.io.internal.SuspendedStream,java.lang.Object,cats.effect.kernel.Async)Unit in class fs2.io.net.tls.TLSSocketCompanionPlatform#AsyncTLSSocket does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.io.net.tls.TLSSocketCompanionPlatform#AsyncTLSSocket.this")
[info] fs2-protocols: mimaPreviousArtifacts is empty, not analyzing binary compatibility.
[error] stack trace is suppressed; run last coreJVM / mimaReportBinaryIssues for the full output
[error] stack trace is suppressed; run last reactiveStreams / mimaReportBinaryIssues for the full output
[error] stack trace is suppressed; run last ioJVM / mimaReportBinaryIssues for the full output
[error] stack trace is suppressed; run last ioJS / mimaReportBinaryIssues for the full output
[error] (coreJVM / mimaReportBinaryIssues) Failed binary compatibility check against co.fs2:fs2-core_3:3.1.1 (e:info.versionScheme=early-semver)! Found 1 potential problems (filtered 193)
[error] (reactiveStreams / mimaReportBinaryIssues) Failed binary compatibility check against co.fs2:fs2-reactive-streams_3:3.0.6 (e:info.versionScheme=early-semver)! Found 8 potential problems (filtered 6)
[error] (ioJVM / mimaReportBinaryIssues) Failed binary compatibility check against co.fs2:fs2-io_3:3.0.4 (e:info.versionScheme=early-semver)! Found 31 potential problems (filtered 166)
[error] (ioJS / mimaReportBinaryIssues) Failed binary compatibility check against co.fs2:fs2-io_sjs1_3:3.1.1 (e:info.versionScheme=early-semver)! Found 8 potential problems (filtered 57)

@armanbilge
Copy link
Member Author

@mpilquist it seems like bincompat is badly broken for anything involving default args on Scala 3 ... any thoughts what to do about that?

build.sbt Outdated
Comment on lines 156 to 157
ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gzip$default$*"),
ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gunzip$default$1$")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some optimism that these missing methods will be restored once the gzip and gunzip methods move back to the shared Compression trait in #2771.

@@ -267,7 +248,8 @@ lazy val io = crossProject(JVMPlatform, JSPlatform)
.jsEnablePlugins(ScalaJSBundlerPlugin)
.settings(
name := "fs2-io",
libraryDependencies += "com.comcast" %%% "ip4s-core" % "3.1.2"
libraryDependencies += "com.comcast" %%% "ip4s-core" % "3.1.2",
tlVersionIntroduced ~= { _.updated("3", "3.1.0") }
Copy link
Member Author

@armanbilge armanbilge Jan 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes for an easy fix, WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine with me

@armanbilge armanbilge marked this pull request as ready for review January 14, 2022 06:42
@mpilquist
Copy link
Member

@mpilquist it seems like bincompat is badly broken for anything involving default args on Scala 3 ... any thoughts what to do about that?

What's done is done. Let's focus on ensuring there are no more bincompat issues going forward though. I don't fully understand what's going on here with default args and the Scala 3 encoding, but I'm concerned that we'll be unable to evolve APIs due to some encoding detail. Have you dug in to the issue yet?

@armanbilge
Copy link
Member Author

I haven't really looked in detail and at first glance the encoding seemed similar to Scala 2.

I think the difference though is that in Scala 3, the methods for the default args e.g. synthetic static method copy$default$3$ are static. For example, compare with these Scala 2 MiMa issues involving default args like synthetic method copy$default$5 in http4s/http4s#5758 (comment). (But, this is comparing a trait to a class so needs further investigation.)

In any case, when moving methods with default args up to a parent trait (in our case, platforming these APIs), the synthetic methods for default args move too. However, in Scala 2 they continued to be inherited by the child trait. In Scala 3, because they are static, they are not inherited, and thus MiMa complains.

@armanbilge
Copy link
Member Author

Huh, now I'm more confused. As an experiment I commented out this method and ran MiMa on Scala 2 and Scala 3.

def gzip(
bufferSize: Int = 1024 * 32,
deflateLevel: Option[Int] = None,
deflateStrategy: Option[Int] = None,
modificationTime: Option[Instant] = None,
fileName: Option[String] = None,
comment: Option[String] = None
): Pipe[F, Byte, Byte] =

Scala 2

sbt:root> ++2.13.7
[info] Setting Scala version to 2.13.7 on 16 projects.
[info] Reapplying settings...
[info] set current project to root (in build file:/workspace/fs2/)
sbt:root> coreJVM/mimaReportBinaryIssues
[error] fs2-core: Failed binary compatibility check against co.fs2:fs2-core_2.13:3.0.1 (e:info.versionScheme=early-semver)! Found 1 potential problems (filtered 52)
[error]  * method gzip(Int,scala.Option,scala.Option,scala.Option,scala.Option,scala.Option)scala.Function1 in interface fs2.compression.Compression does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.gzip")
[error] stack trace is suppressed; run last coreJVM / mimaReportBinaryIssues for the full output
[error] (coreJVM / mimaReportBinaryIssues) Failed binary compatibility check against co.fs2:fs2-core_2.13:3.0.1 (e:info.versionScheme=early-semver)! Found 1 potential problems (filtered 52)

Scala 3

sbt:root> ++3.1.0
[info] Setting Scala version to 3.1.0 on 16 projects.
[info] Reapplying settings...
[info] set current project to root (in build file:/workspace/fs2/)
sbt:root> coreJVM/mimaReportBinaryIssues
[info] compiling 1 Scala source to /workspace/fs2/core/jvm/target/scala-3.1.0/classes ...
[info] compiling 2 Scala sources to /workspace/fs2/core/jvm/target/scala-3.1.0/classes ...
[error] fs2-core: Failed binary compatibility check against co.fs2:fs2-core_3:3.1.5 (e:info.versionScheme=early-semver)! Found 13 potential problems (filtered 5)
[error]  * method gzip(Int,scala.Option,scala.Option,scala.Option,scala.Option,scala.Option)scala.Function1 in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip")
[error]  * synthetic static method gzip$default$1$(fs2.compression.CompressionPlatform)Int in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$1$")
[error]  * synthetic method gzip$default$1()Int in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$1")
[error]  * synthetic static method gzip$default$2$(fs2.compression.CompressionPlatform)scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$2$")
[error]  * synthetic method gzip$default$2()scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$2")
[error]  * synthetic static method gzip$default$3$(fs2.compression.CompressionPlatform)scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$3$")
[error]  * synthetic method gzip$default$3()scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$3")
[error]  * synthetic static method gzip$default$4$(fs2.compression.CompressionPlatform)scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$4$")
[error]  * synthetic method gzip$default$4()scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$4")
[error]  * synthetic static method gzip$default$5$(fs2.compression.CompressionPlatform)scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$5$")
[error]  * synthetic method gzip$default$5()scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$5")
[error]  * synthetic static method gzip$default$6$(fs2.compression.CompressionPlatform)scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$6$")
[error]  * synthetic method gzip$default$6()scala.Option in interface fs2.compression.CompressionPlatform does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.CompressionPlatform.gzip$default$6")
[error] stack trace is suppressed; run last coreJVM / mimaReportBinaryIssues for the full output
[error] (coreJVM / mimaReportBinaryIssues) Failed binary compatibility check against co.fs2:fs2-core_3:3.1.5 (e:info.versionScheme=early-semver)! Found 13 potential problems (filtered 5)

@armanbilge
Copy link
Member Author

More research: I decompiled CompressionPlatform on Scala 2 and 3 to see how default args are encoded. Seems pretty similar, except it's possible that the methods are actually not properly annotated as synthetic in Scala 3?

https://gist.github.com/armanbilge/bd4bdbcc3f76294b9245cf347a42bc8a

See also lightbend-labs/mima#136 for related discussion surround default args and synthetics.

@armanbilge
Copy link
Member Author

@mpilquist ready to make the jump?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants