Skip to content

scala3-library_3 defined for scala_version might be not taken into account for evicition #1781

@WojciechMazur

Description

@WojciechMazur

Under dependency_mode=transitive scala3-library_3 (and possible scala-library) artifacts might not be a subject to evicition rules resulting in chossing version different to the version of the Scala compiler. Such case might lead to compilation crashes observed in scala/scala3#22890

We should either enforce to always use matching stdlib artifact for the verison of the compiler or to ensure we that version selected by scala_version would be compared with version defined in transitive dependenices.

Based on the Slack chat:

I’m now getting these messages
package scala contains object and package with same name: caps.
This indicates that there are several versions of the Scala standard library on the classpath.
The build should be reconfigured so that only one version of the standard library is on the classpath.
and an error pointing to a usage of Expr.summonIgnoring, which only exists in Scala 3.7.x
Based on this issue it looks like this is happening because I have multiple versions of scala3-library_3 on my classpath — one from my build and one that’s pulled in transitively from each of my Scala library dependencies. Is there a way to suppress only those transitive deps?
...
Thanks, just confirmed that adding an explicit dependency on scala3-library_3 fixes it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions