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

zio-nio-core_3 has Scala 2.13 dependencies #439

Open
marcsaegesser opened this issue Nov 22, 2021 · 3 comments
Open

zio-nio-core_3 has Scala 2.13 dependencies #439

marcsaegesser opened this issue Nov 22, 2021 · 3 comments

Comments

@marcsaegesser
Copy link

The zio-nio-core_3 in Maven has dependencies on Scala 2.13 libraries silencer-lib and scala-collection-compat. If I use zio-nio in a project that also depends on one of those libraries I get a compile error about cross-version suffixes.

        <dependency>
            <groupId>com.github.ghik</groupId>
            <artifactId>silencer-lib_2.13.6</artifactId>
            <version>1.7.4</version>
            <scope>provided</scope>
        </dependency>
       <dependency>
            <groupId>org.scala-lang.modules</groupId>
            <artifactId>scala-collection-compat_2.13</artifactId>
            <version>2.4.4</version>
        </dependency>

I cloned the repo and tried building the top-level project and it fails with the same error.

sbt "++ 3.0.2;compile"
[info] welcome to sbt 1.5.5 (Ubuntu Java 11.0.11)
[info] loading settings for project zio-nio from build.sbt ...
[info] set current project to zio-nio (in build file:/home/msaegesser/work/zio-nio/)
[info] Setting Scala version to 3.0.2 on 2 projects.
[info] Excluded 2 projects, run ++ 3.0.2 -v for more details.
[info] Reapplying settings...
[info] set current project to zio-nio (in build file:/home/msaegesser/work/zio-nio/)
[error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("file:/home/msaegesser/work/zio-nio/"), "docs"):
[error]    org.scala-lang.modules:scala-collection-compat _3, _2.13
[error] java.lang.RuntimeException: Conflicting cross-version suffixes in: org.scala-lang.modules:scala-collection-compat
[error] 	at scala.sys.package$.error(package.scala:30)
[error] 	at sbt.librarymanagement.ConflictWarning$.processCrossVersioned(ConflictWarning.scala:39)
[error] 	at sbt.librarymanagement.ConflictWarning$.apply(ConflictWarning.scala:19)
[error] 	at sbt.Classpaths$.$anonfun$ivyBaseSettings$71(Defaults.scala:3194)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] 	at sbt.Execute.work(Execute.scala:291)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:829)
[error] (docs / update) Conflicting cross-version suffixes in: org.scala-lang.modules:scala-collection-compat
[error] Total time: 1 s, completed Nov 22, 2021, 9:42:15 AM

Curiously, if I run sbt "++ 3.0.2;publishLocal I get a zio-nio artifact that does not depend on zio-nio-core and has a scala-collection-compat_3:2.5.5 dependency and only has a 2.13 dependency on silencer-lib.

I'm hoping someone here has better sbt chops that I do and understand how this happens.

@marcsaegesser
Copy link
Author

This comment on a PR from a couple months ago describes a work-around for this problem. I thought I'd share it here to make it more visible to others facing the same issue.

@francisdb
Copy link
Contributor

This was fixed on master but did not make it to 2.0.0-RC1

[info]   | +-dev.zio:zio-nio_3:2.0.0-RC1
[info]   | | +-dev.zio:zio-streams_3:2.0.0-RC1
[info]   | | | +-org.scala-lang:scala3-library_3:3.1.0 (evicted by: 3.1.1)
[info]   | | |
[info]   | | +-dev.zio:zio_3:2.0.0-RC1
[info]   | | | +-org.scala-lang:scala3-library_3:3.1.0 (evicted by: 3.1.1)
[info]   | | |
[info]   | | +-org.scala-lang.modules:scala-collection-compat_2.13:2.6.0 [S]
[info]   | | +-org.scala-lang:scala3-library_3:3.1.0 (evicted by: 3.1.1)
[info]   | | +-org.scala-lang:scala3-library_3:3.1.1 [S]

@francisdb
Copy link
Contributor

francisdb commented Mar 16, 2022

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

No branches or pull requests

2 participants