Open mberndt123 opened 10 months ago
Thank you for the minimisation, I was able to reproduce it on my machine.
As a side note zio-interop-cats:3.1.1.0
is almost 2 years old, while using the latest version of this project 23.1.0.0
the snippet would correctly compile. There probably needs to be some issue related to binary incompatibility of the two libraries.
I think it is not specified how the compiler should behave in case of binary incompatibility of 2 libraries.
In our case the ZIO project seems to not set any versioning scheme which might be helpfull when using binary incompatible versions of dependencies. In our case the zio-interop-cats
uses ZIO 1.0.8
which is beining evicted by 2.0.x
introduced via dependency of zio-http
. This can be workarounded by upgrading zio-interop-cats
as described in previous comment.
Even if we'd adjust the code to compile (see snippet below) and we would be able to pass it through all transform phases it still would fail in the backend:
//> using dep dev.zio::zio-interop-cats:3.1.1.0
//> using dep dev.zio::zio-http:3.0.0-RC3
import zio.{Runtime,Task}
import cats.effect.Async
import zio.interop.catz.*
given [T]: zio.Runtime[T] = ???
def foo = cats.effect.Async.apply[Task]
results in
exception occurred while compiling /Users/wmazur/projects/sandbox/main.scala
Error: cannot resolve reference to type zio.type.ZManaged
the classfile defining the type might be missing from the classpath
Error compiling project (Scala 3.3.0, JVM)
However, in each case we should try to provide a meaningfull error message.
Bisect points that the compiler started crashing after extending the implicit search mechanism in ea13cad629f85cb3156753dc784e4af0438d0167 Probably the noChainConversionsNote
should be guarded in some way to prevent crashing the compiler.
Last good release: 3.3.1-RC1-bin-20230131-42f2764-NIGHTLY First bad release: 3.3.1-RC1-bin-20230201-e751f51-NIGHTLY
Yeah, I just copy-pasted the sbt line from the ZIO documentation. Thanks for the hint that updating that stops the compiler from crashing.
The implicit search seems to fails because the Async[Task]
requires an instance of object introduced via conversion.
It's defined as follows
In ZIO 2.x: implicit final def asyncRuntimeInstance[E](implicit runtime: Runtime[Any]): Async[Task]
In ZIO 1.x: implicit final def asyncRuntimeInstance[E](implicit runtime: Runtime[Clock & CBlocking]): Async[Task]
where the Clock
in ZIO 1.x is defined as
package object clock:
type Clock = Hash[Clock.Service]
object Clock:
trait Service
but in ZIO 2.x it's a regular trait trait Clock
defined in the top level.
During typer/implicit search it seems that we're using the asyncRuntimeInstance
defined in ZIO 1.x, but the package object clock.Clock
cannot be found.
Because in any case the compilation should fail either with error or crash I have no idea how to reproduce it for the Vulpix regression tests.
Bisect points that the compiler started crashing after extending the implicit search mechanism in ea13cad Probably the
noChainConversionsNote
should be guarded in some way to prevent crashing the compiler.
I addressed how that change addressed a related crash with the fix (and follow up to the fix) https://github.com/lampepfl/dotty/pull/18719 and https://github.com/lampepfl/dotty/pull/18727. But I'm not sure how exactly that affects the issue here.
It seems that it is still failing in nightly - 3.4.0-RC1-bin-20231117-5bb6f0d-NIGHTLY I'm adding stacktrace of the crash below
Hi,
The project in the attachment makes the Scala 3.3.1 compiler crash on my machine. The complete code is:
And the important bit of the error message seems to be this:
I have attached the complete output of
sbt compile
as a log file.The crash goes away when I do either of the following:
"dev.zio" %% "zio-http" % "3.0.0-RC2"
from build.sbtscalaVersion
to3.3.0
in build.sbtIt then prints the following error:
minimized.tar.gz sbt-compile.log