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

Dotty resolution issue #613

Closed
tomasherman opened this issue Apr 4, 2021 · 9 comments · Fixed by #624
Closed

Dotty resolution issue #613

tomasherman opened this issue Apr 4, 2021 · 9 comments · Fixed by #624
Milestone

Comments

@tomasherman
Copy link

Hello,

should sbt-mima work with scala3 builds? For me it fails resolving the artifacts, it tries to download the following:
https://repo1.maven.org/maven2/com/avast/cloud/datadog4s-common_3.0.0-RC1_3.0/0.12.0/datadog4s-common_3.0.0-RC1_3.0-0.12.0.pom

please notice the _3.0 after the RC1
Thanks

@SethTisue
Copy link
Collaborator

similar report at scalacenter/sbt-version-policy#62

@dwijnand
Copy link
Collaborator

dwijnand commented Apr 6, 2021

I think that comes from applying

            val moduleId = CrossVersion(m, scalaModuleInfo.value) match {
              case Some(f) => m.withName(f(m.name))
              case None    => m
            }
            moduleId -> SbtMima.getPreviousArtifact(moduleId, depRes, taskStreams)

Seeing as that works for Scala 2 projects, it seems to me that something in the data is wrong in Scala 3 projects?

Could you provide a minimisation of the problem please?

@tomasherman
Copy link
Author

Would cloning https://github.com/avast/datadog4s and running sbt +mimaReportBinaryIssues suffice as minimised issue? It's a full blown project but it's super small and takes few seconds to compile :) ... if not, i can try to make something even simpler but it would require publishing stuff for mima to have something to verify, right? which is a pain in the neck :D

let me know if this would work for you

@julienrf
Copy link
Contributor

julienrf commented May 4, 2021

I have just pushed a minimization of the problem here: 1deb3fc

The ScalaModuleInfo looks like this:

Some(ScalaModuleInfo(3.0.0-RC3, 3.0.0-RC3, Vector(), true, false, true, org.scala-lang, Vector(scala-library, scala-compiler, scala-reflect, scala-actors, scalap)))

Nothing suspicious, right?

@julienrf
Copy link
Contributor

julienrf commented May 4, 2021

I’ve just found that by setting useCoursier := false, it works. So, the issue seems to be located somewhere in the implementation of CoursierDependencyResolution#update.

@julienrf
Copy link
Contributor

julienrf commented May 5, 2021

I’ve noticed that the following change also fixes the issue with Scala 3:

             val moduleId = CrossVersion(m, scalaModuleInfo.value) match {
-              case Some(f) => m.withName(f(m.name))
+              case Some(f) => m.withName(f(m.name)).withCrossVersion(CrossVersion.disabled)
               case None    => m
             }

I’ve submitted #624 with this change, however it’s not clear to me which component is doing something wrong here. The fact that setting useCoursier := false fixes the issue makes me think that there is some (wrong) inconsistency between Coursier and Ivy.

@julienrf
Copy link
Contributor

julienrf commented May 5, 2021

May I request a release containing the fix? 😇

@tomasherman
Copy link
Author

thanks!

@dwijnand
Copy link
Collaborator

dwijnand commented May 5, 2021

😄

Of course, but I want to wait until next week to see if there's anything broken in 0.9.0 that I need to fix. (I've been hesitating because I'm uncertain about my unpickling efforts...)

@dwijnand dwijnand added this to the 0.9.1 milestone May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants