-
Notifications
You must be signed in to change notification settings - Fork 49
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
Unexpected inject of scala3-library
by the TypelevelKernelPlugin
#654
Comments
Thanks, sorry for the trouble. We introduced that in #415, which was cargo-culted from typelevel/cats#1889 via sbt/sbt#2503. Maybe there is a better way to do this. I guess the problem is that eviction is not working properly when we manually mess with the classpath like this. |
Also one note - it should rather be kept as a low priority. We can add custom sbt options to projects in OpenCB to filter out problematic config entries on our side. |
Thanks, but actually I think that this is a rather high-priority issue. It's not just affecting the community build, it's affecting real builds. For example this is the Cats build:
We haven't noticed the problem so far because Scala Library 3.3.1 is forwards- and backwards-compatible with 3.3.0. But it can still be highly confusing to users because they may be non-deterministically using a different version of Scala 3.3.x lib than they intended e.g. an older, bugged version. The problem becomes even worse when Scala 3.4.0 will be released because that will not be forward-compatible with 3.3.x. The community build is foreshadowing real-world user pain. |
Hmm.. It was definitely not anticipated. Do I understand correctly that even though scalac-compat-annotation is still compile-only dependency, but it brings in another version of scala3-library at compile time? |
Yes, the problem with this code is that we are mindlessly adding scalac-compat-annotation and all of its dependencies (i.e. the scala library, either 2 and/or 3) directly to the classpath. Typically dependencies are first pre-processed through the eviction mechanism to avoid conflicting entries on the classpath but this bypasses that. sbt-typelevel/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala Line 62 in 076d867
In light of typelevel/scalac-compat#56 I'm starting to wonder whether it's worth all of this effort to have a "compile-only" dependency. The tooling just doesn't support it well ... |
@armanbilge , it's just appeared to me that we could probably ditch the
I checked it briefly on my local and it seems working in a similar way – allows a downstream using the annotations at compile time but does not push the library further. Neither it pushes any garbage to the downstream classpath – i.e. the eviction is working out of the box. Wdyt? If you're fine with such a change, I can arrange a PR for that. |
In other words I suppose this particular issue can be resolved. |
Yes, in this SO answer Seb suggests using the Should we deprecate |
@armanbilge fyi: #655, thx! |
In the Open Community Build for typelevel/spotted-leopards I've seen a strange failures when building docs under 3.4.0-NIGHTLY. Build logs.
One of the reasons of failures were duplicated entries of
scala3-library
. The error message was as followingwhere
caps.Cap
is the experimental part of Caprese project (Capture Calculus) https://github.com/lampepfl/dotty/blob/15033c7ac8be33a1b94226da3cca3922b53066ce/library/src/scala/caps.scala#L7Why this symbol was required in building docs is out of the scope of this issue. What's important is the fact the for some reason
scala3-library:3.3.0
was present on the classpath when building docs insteead of expected nightly version of stdlib. After poking around I've found the following injected externalDependeciesInspection of unmanaged classpath pointed me to this project:
The
scala3-library:3.3.0
seems to be injected in here inTypeLevelKernelPlugin
sbt-typelevel/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala
Line 62 in 076d867
I don't know the purpose of this inject and if it really required. I only want to spot some light on it.
When it comes to failures in the scaladoc I think there might some some bug, because during normal compilation duplicate stdlib entries seems not to be the problems, altough I would try to reproduce it and report to the dotty repo.
The text was updated successfully, but these errors were encountered: