Fork me on GitHub
#tools-deps
<
2022-11-21
>
borkdude16:11:58

I have a project that has a dependency on a git lib with a deps/root. That deps/root project has a local/root dependency on another project in that git repo. That should work right?

borkdude16:11:22

But it doesn't unless I'm doing something wrong here:

clj -Sdeps '{:deps {io.github.squint-cljs/cherry {:git/sha "0d7ef527ea983cbe4a0f8ee95e388e78d80d14f4"}}}'

Alex Miller (Clojure team)16:11:09

io.github.squint-cljs/compiler-common has two libs in the tree, one as a local coord, one as a git coord - version selection doesn't know how to compare those

Alex Miller (Clojure team)16:11:25

yes, the local is actually in the context of a git coord, but you've lost that context

borkdude17:11:01

@alexmiller I see the problem, I shouldn't have used the compiler-common name twice. So the top level dep is a deps/root in the git repo which then requires the other project via local/root via a different name. I think that ought to work.

{:paths ["src" "resources"]
 :deps {io.github.squint-cljs/compiler-common-cherry
        {:git/sha "45a6d93d20869183d922041f109124f5625cad39"
         :deps/root "cherry"}}}
I pushed that to under :git/sha "2f323066cbc74147991c2f33148075af83088057" But I'm now getting:
$ clj -Sdeps '{:deps {io.github.squint-cljs/cherry {:git/sha "2f323066cbc74147991c2f33148075af83088057"}}}'
Cloning: 
Error building classpath. Unable to clone /Users/borkdude/.gitlibs/_repos/https/github.com/squint-cljs/compiler-common-cherry
fatal: could not read Username for '': terminal prompts disabled

dergutemoritz17:11:34

Looks like you're referring to a private repo there

borkdude17:11:26

of course, I have to add :git/url ""

borkdude17:11:02

it works now:

$ clj -Sdeps '{:deps {io.github.squint-cljs/cherry {:git/sha "14e0a95e0c01129f3967b9419fd4799376e23d09"}}}'
Checking out:  at 14e0a95e0c01129f3967b9419fd4799376e23d09
Checking out:  at 45a6d93d20869183d922041f109124f5625cad39
Clojure 1.11.0
user=> (require '[cherry.compiler :as cherry])

1
Alex Miller (Clojure team)17:11:34

private repos are fine of course (but you have to auth). useful things to know: • set GITLIBS_DEBUG=true to see git commands being executed • set GITLIBS_TERMINAL=true to get terminal prompts

borkdude17:11:13

This isn't private, I just forgot to add the git/url, I only changed the io.github.* name to avoid the conflict but of course that wasn't sufficient since it's also used to derive the git/url

💡 1
borkdude17:11:00

so it actually works like expected now, I just shouldn't have used the same libname for different purposes

borkdude17:11:43

io.github.squint-cljs/compiler-common$cherry
for deps/roots ;)

Alex Miller (Clojure team)17:11:52

I don't love it, but should work

borkdude17:11:11

what I (kind of non-seriously) proposed was that $cherry should be ignored for derivation of git/url but would still count as a different lib (cause different name)