Fork me on GitHub
#tools-deps
<
2019-10-05
>
ikitommi10:10:36

hi. I have a transitive deps issue. metosin/malli depends on both borkdude/sci and borkdude/edamame via sha. sci uses edamame via real mvn version. When I try to use malli, the versions conflict:

➜  ~ clj -Sdeps '{:deps {metosin/malli {:git/url "" :sha "28b4ee63bd571ce612e8cd0e9dab6ef86722597e"}}}'
Checking out:  at 28b4ee63bd571ce612e8cd0e9dab6ef86722597e
Downloading: borkdude/edamame/0.0.6/edamame-0.0.6.pom from 
Error building classpath. Unable to compare versions for borkdude/edamame: {:mvn/version "0.0.6", :deps/manifest :mvn} and {:git/url "", :sha "9b3e825b65ec6fe0dc536988fd036e6e681813de", :deps/manifest :deps, :deps/root "/Users/tommi/.gitlibs/libs/borkdude/edamame/9b3e825b65ec6fe0dc536988fd036e6e681813de"}

ikitommi10:10:14

If I add explicit sha to edamame from command like, it works, but is not what I would like to be needed.

ikitommi11:10:40

e.g. this works:

➜  ~ clj -Sdeps '{:deps {metosin/malli {:git/url "" :sha "28b4ee63bd571ce612e8cd0e9dab6ef86722597e"}, borkdude/edamame {:git/url "", :sha "9b3e825b65ec6fe0dc536988fd036e6e681813de"}}}'

ikitommi11:10:22

quick-hacked this so that malli depends on edamame mvn version. Still, curious could it be made to work with just Sha dep to it

dominicm11:10:00

What do you think should happen here? The problem is that maven and git don't have a comparison mechanism that makes sense.

borkdude11:10:50

@ikitommi I think it's best to depend on a mvn version of edamame then from now on. I'll try to do that with sci as well.

Alex Miller (Clojure team)12:10:32

This can be made to work, but I haven’t done so yet. Maven artifacts generally record their sha at build time so it is possible to version compare them.

👍 12
borkdude12:10:43

what if you have two branches that are diverged from the same maven version?

Alex Miller (Clojure team)13:10:01

This is just back to the same rules we use for git comparisons - if one version is a descendant of another, its preferred. If there is no ancestor relationship, they aren’t comparable

Alex Miller (Clojure team)13:10:28

In that case, it will throw and you need to be explicit at the top level about which dep to use (top dep version always used)