Skip to content

Fails to compile a valid build #4165

Open
@ckipp01

Description

@ckipp01

I'm not really sure this is actually a Mill issue, but rather due to the recent changes in coursier. In my github-dependency-graph Mill plugin I came across a bug in coursier in the past about reconciled versions containing ranges. I added some hacks to work around it but recently with the pr to support the 0.12 series here I noticed that the behavior for this specific case changes a bit now and won't even compile when I believe it should. Given a minimal build like this:

import mill._, scalalib._

object minimalDep extends ScalaModule {
  def scalaVersion = "2.13.15"

  def ivyDeps = Agg(
    ivy"com.fasterxml.jackson.core:jackson-core:2.13.3"
  )
}

object minimal extends ScalaModule {
  def moduleDeps = Seq(minimalDep)

  def scalaVersion = "2.13.8"

  def ivyDeps = Agg(
    ivy"org.jongo:jongo:1.5.0"
  )
}

In earlier versions of Mill this would compile just fine. The reason I had this test is the jongo here wants a range of jackson data-bind [2.7.0,2.12.3] where jackson-core specifically wants 2.13.3. These should be compatible and 2.13.3 should be resolved and all should work fine. However, with 0.12.4 this no longer compiles:

[84/84] ============================== __.compile ============================== 3s
1 tasks failed
minimal.resolvedIvyDeps coursier.error.ResolutionError$ConflictingDependencies: Conflicting dependencies:
com.fasterxml.jackson.core:jackson-core:2.12.3 or [2.7.0,2.12.3] wanted by

  com.fasterxml.jackson.core:jackson-databind:2.12.3 wants 2.12.3
  └─ org.jongo:jongo:1.5.0 wants com.fasterxml.jackson.core:jackson-databind:[2.7.0,2.12.3]

  org.jongo:jongo:1.5.0 wants [2.7.0,2.12.3]


    mill.util.CoursierSupport.resolveDependenciesMetadataSafe(CoursierSupport.scala:312)
    mill.util.CoursierSupport.resolveDependenciesMetadataSafe$(CoursierSupport.scala:249)
    mill.util.Jvm$.resolveDependenciesMetadataSafe(Jvm.scala:15)
    mill.util.CoursierSupport.resolveDependenciesMetadataSafe(CoursierSupport.scala:339)
    mill.util.CoursierSupport.resolveDependenciesMetadataSafe$(CoursierSupport.scala:320)
    mill.util.Jvm$.resolveDependenciesMetadataSafe(Jvm.scala:15)
    mill.util.CoursierSupport.resolveDependencies(CoursierSupport.scala:80)
    mill.util.CoursierSupport.resolveDependencies$(CoursierSupport.scala:56)
    mill.util.Jvm$.resolveDependencies(Jvm.scala:15)
    mill.scalalib.Lib$.resolveDependencies(Lib.scala:158)
    mill.scalalib.CoursierModule$Resolver.resolveDeps(CoursierModule.scala:216)
    mill.scalalib.JavaModule.$anonfun$resolvedIvyDeps$3(JavaModule.scala:779)
coursier.error.ResolutionError$ConflictingDependencies: Conflicting dependencies:
com.fasterxml.jackson.core:jackson-core:2.12.3 or [2.7.0,2.12.3] wanted by

  com.fasterxml.jackson.core:jackson-databind:2.12.3 wants 2.12.3
  └─ org.jongo:jongo:1.5.0 wants com.fasterxml.jackson.core:jackson-databind:[2.7.0,2.12.3]

  org.jongo:jongo:1.5.0 wants [2.7.0,2.12.3]

Shouldn't these be compatible, 2.12.3 be resolved, and all compile fine?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue represents an bugupstreamThe issue originates in an upstream dependency

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions