Fork me on GitHub
#tools-deps
<
2022-08-25
>
twashing22:08:46

i. I have a tools.deps project ii. that has a git dependency. iii. tools.deps has previously downloaded the dependency foo/bar. iv. And it’s in my local /Users/foo/.gitlibs/_repos/ssh/foo.github.com/foo/bar But trying to run a repl now, gives me the error. What am I missing?

Error building classpath. Unable to fetch /Users/foo/.gitlibs/_repos/ssh/foo.github.com/foo/bar
ssh: Could not resolve hostname : nodename nor servname provided, or not known
fatal: Could not read from remote repository.

hiredman22:08:05

dns error resolution is failing for the name

twashing22:08:48

I was previously able to run the same command, without access to that domain name. What’s strange is that the message says... Unable to fetch /Users/foo/.gitlibs/_repos/ssh/foo.github.com/foo/bar. But that directory is there. Looking at the source file... https://github.com/clojure/tools.gitlibs/blob/master/src/main/clojure/clojure/tools/gitlibs/impl.clj#L91-L92 it is shelling out to git --git-dir... What stumps me is, if it worked previously (fetch from local git repo), what could cause it to break :thinking_face:

hiredman23:08:58

are you saying you never had access to http://foo.github.com or whatever the real domain name is?

hiredman23:08:41

tools.deps works by building a cache of deps -> classpath, which means the first time you run clj it launches a java process that does a lot of stuff, then it figures out a classpath, and stores that in a file named by a hash of the deps.edn file (plus some other stuff)

hiredman23:08:57

then it launches your java process with your classpath

hiredman23:08:25

then on subsequent runs of clj if your deps.edn hasn't changed, it only launches your java process with your classpath

hiredman23:08:43

if you had access to http://foo.github.com sometime in the past, got on the code, then lost access, but nothing invalidated the cache, then you would never know

twashing23:08:45

Ok then I’ll ask the question in a different way. • Can tools.deps download git deps in machine1:~/.gitlibs • Then can I directly rsync that to machine2:~/.gitlibs?

twashing23:08:57

@U0NCTKEV8 From your breakdown, ~/.gitlibs only works on the machine it was downloaded on.

hiredman23:08:00

yes, but sometimes tools.deps needs to access the origin of the git repo

hiredman23:08:48

specifically, I believe, if you are using tags instead of full shas

hiredman23:08:13

because a tag can change, so it tries to fetch tags

twashing23:08:32

Hmm… :thinking_face: So bottom line, ~/.gitlibs is not portable in the way ~/.m2/repository is.

hiredman23:08:50

(it might unconditionally fetch even if you aren't using tags if it gets to that point, I forget)

twashing23:08:50

Do you know of any tools that can give me that portability? From the advertisement, git --git-dir... should point to a local directory.

hiredman23:08:13

https://clojure.atlassian.net/browse/TDEPS-223 is maybe this, or at least related to it

1
hiredman23:08:36

sure, the git call does point to local directory, but what is failing is the call does a "fetch" to pull the tags from the remote repo, which you apparently don't have access to from machine2