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

Fails to import build with Scala 3 #395

Closed
wheatandtares opened this issue Jan 27, 2023 · 10 comments · Fixed by #468
Closed

Fails to import build with Scala 3 #395

wheatandtares opened this issue Jan 27, 2023 · 10 comments · Fixed by #468

Comments

@wheatandtares
Copy link

wheatandtares commented Jan 27, 2023

When I compile with

val scalaVersion = "3.2.2"

And dependency

"dev.zio"     %% "zio-s3"                 % "0.4.2.1",

I'm getting an error

2023.01.27 10:40:18 INFO  [error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("file:/..."), "..."):
2023.01.27 10:40:18 INFO  [error]    org.scala-lang.modules:scala-collection-compat _3, _2.13

I am not referencing that package in any other dependency that I'm aware of, and if I remove the zio-s3 dependency my code compiles and runs just fine.

I'm new to Scala and ZIO, but from what I can see, the problem line appears to be this one https://github.com/zio/zio-s3/blob/main/build.sbt#L46 and this one

val ScalaDotty = "3.1.2"

@regis-leray
Copy link
Member

regis-leray commented Jan 28, 2023

I cannot reproduce your problem

sbt new scala/scala3.g8 

i changed my sbt build file witht he zio s3 dependency

val scala3Version = "3.2.2"

lazy val root = project
  .in(file("."))
  .settings(
    name := "playground-scala3",
    version := "0.1.0-SNAPSHOT",

    scalaVersion := scala3Version,

    libraryDependencies += "dev.zio" %% "zio-s3" % "0.4.2.3" 
    
  )
sbt compile

We are not using this dependency for scala3 https://github.com/zio/zio-s3/blob/series/2.x/build.sbt#L48
org.scala-lang.modules:scala-collection-compat

@regis-leray
Copy link
Member

Please reopen if you have some problem

@wheatandtares
Copy link
Author

Hmm it must be that one of my other dependencies is pulling org.scala-lang.modules:scala-collection-compat _3 transitively then

@DGolubets
Copy link

I just got this problem.
You can't do if (scalaVersion.value == ScalaDotty) because Scala version evolves.

@regis-leray regis-leray reopened this Apr 9, 2024
@regis-leray
Copy link
Member

regis-leray commented Apr 9, 2024

Oki i think i know how to fix it

Also the scala dotty version is static not dynamic. It is set here

val ScalaDotty = "3.1.2"

i dont understand the issue you are facing i was not able to reproduce, can you provide a script scastie to reproduce the issue

@regis-leray
Copy link
Member

regis-leray commented Apr 9, 2024

I was checking the dependencies of the project , i dont see anything regarding the
https://repo1.maven.org/maven2/dev/zio/zio-s3_3/0.4.2.4/zio-s3_3-0.4.2.4.pom

org.scala-lang.modules:scala-collection-compat

@regis-leray
Copy link
Member

You can also display the graph of the dependency with dependency tree command

https://www.baeldung.com/scala/sbt-dependency-tree

@DGolubets
Copy link

You can try https://scastie.scala-lang.org/TY0yKIaDTAygq4GxKtPrIA
It looks like zio-s3 brings this from zio-nio.
Indeed they mention they fix it in newer release: https://github.com/zio/zio-nio/releases/tag/v2.0.1 (but zio-s3 pulls 2.0.0)

regis-leray added a commit that referenced this issue Apr 9, 2024
@regis-leray
Copy link
Member

#468

@regis-leray regis-leray reopened this Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
regis-leray added a commit that referenced this issue Apr 9, 2024
@regis-leray
Copy link
Member

release 0.4.3

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 a pull request may close this issue.

3 participants