Fork me on GitHub
#tools-deps
<
2022-01-27
>
hlship00:01:07

So I'm in the middle of converting all our internal dependencies from :mvn/version to :git/url (this would only make sense inside Walmart) and I"m having problems:

> clj -X:dev:test
Error building classpath. Unable to compare versions for com.walmartlabs.clojure/util: {:mvn/version "1.3.0", :deps/manifest :mvn} and {:git/tag "v1.4.0", :git/sha "925c4a5c6984ec641c3fa0f786ec7e48da5e7c64", :git/url ":clojure/util.git", :deps/manifest :deps, :deps/root "/Users/hship/.gitlibs/libs/com.walmartlabs.clojure/util/925c4a5c6984ec641c3fa0f786ec7e48da5e7c64"}
The issue is that I have, somewhere, a transitive dependency that uses the :mvn/version coordinate, and this library now uses a :git/url coordinate. I'm OK with the tool complaining that you can't mix and match this way BUT the above message does not help me hunt down which transitive dependency itself has the :mvn/version coordinate. Is there a tool option that helps here? Is there additional logging that can be enabled? -Strace doesn't seem to work; this error seem to prevent that from being written.

hiredman00:01:46

maybe try clj -X:deps tree I forget what the exact command is, I think that should print out a tree of deps

hiredman00:01:44

hmmm, that likely won't work either 😕

hiredman00:01:47

ok, if you temporarily add the problematic dep to your project's deps.edn, you can run clj -X:deps tree, and it will show all the places that dep is depended on, and show them all as overridden at the top level

hiredman00:01:10

then you can find the problem, fix it, and remove the temporary addition to your project's deps.edn

hlship00:01:38

Right; I'm trying adding a :local/root coord and running clj -Stree.

hlship00:01:21

No dice; same message.

hiredman00:01:46

if you add a dependency to the deps.edn of the project where you are invoking clj on the problematic dependency com.walmartlabs.clojure/util it will override all the other deps transitive deps (closer to the root of the tree wins) and let you run tree

hlship00:01:24

I thought so too. Let me try with :git/url instead of :local/root.

hiredman00:01:29

I say it will do this because I tried it locally

hlship00:01:14

Ah, bad map nesting.

hiredman00:01:15

I am in project A which depends on projects C and D, projects C and D both have deps on tools.deps.alpha, one with maven and one with git

hlship00:01:33

Think I found it.