Share your thoughts in the 2024 State of Clojure Survey!

Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.deps by

Supplying a :git/url of ../../../../../../../../tmp/foobar where /tmp/foobar is a git repo on the system results in:

`
Error building classpath. org.eclipse.jgit.transport.TransportLocal cannot be cast to org.eclipse.jgit.transport.SshTransport
java.lang.ClassCastException: org.eclipse.jgit.transport.TransportLocal cannot be cast to org.eclipse.jgit.transport.SshTransport

at clojure.tools.gitlibs.impl$fn$reify__829.configure(impl.clj:32)
at org.eclipse.jgit.api.TransportCommand.configure(TransportCommand.java:155)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:235)
at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:306)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:89)
at clojure.tools.gitlibs.impl$call_with_auth.invokeStatic(impl.clj:49)
at clojure.tools.gitlibs.impl$call_with_auth.invoke(impl.clj:41)
at clojure.tools.gitlibs.impl$git_clone_bare.invokeStatic(impl.clj:71)
at clojure.tools.gitlibs.impl$git_clone_bare.invoke(impl.clj:68)
at clojure.tools.gitlibs.impl$ensure_git_dir.invokeStatic(impl.clj:110)
at clojure.tools.gitlibs.impl$ensure_git_dir.invoke(impl.clj:100)
at clojure.tools.gitlibs$resolve.invokeStatic(gitlibs.clj:33)
at clojure.tools.gitlibs$resolve.invoke(gitlibs.clj:29)
at clojure.tools.gitlibs$procure.invokeStatic(gitlibs.clj:47)
at clojure.tools.gitlibs$procure.invoke(gitlibs.clj:41)
at clojure.tools.deps.alpha.extensions.git$eval894$fn__896.invoke(git.clj:41)
at clojure.lang.MultiFn.invoke(MultiFn.java:238)
at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:168)
at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:152)
at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:215)
at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:197)
at clojure.tools.deps.alpha.script.make_classpath$create_classpath.invokeStatic(make_classpath.clj:59)
at clojure.tools.deps.alpha.script.make_classpath$create_classpath.invoke(make_classpath.clj:52)
at clojure.tools.deps.alpha.script.make_classpath$run.invokeStatic(make_classpath.clj:70)
at clojure.tools.deps.alpha.script.make_classpath$run.invoke(make_classpath.clj:64)
at clojure.tools.deps.alpha.script.make_classpath$_main.invokeStatic(make_classpath.clj:109)
at clojure.tools.deps.alpha.script.make_classpath$_main.doInvoke(make_classpath.clj:84)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:702)
at clojure.core$apply.invokeStatic(core.clj:657)
at clojure.main$main_opt.invokeStatic(main.clj:317)
at clojure.main$main_opt.invoke(main.clj:313)
at clojure.main$main.invokeStatic(main.clj:424)
at clojure.main$main.doInvoke(main.clj:387)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:702)
at clojure.main.main(main.java:37)

`

Gitlibs should instead handle local repos.

4 Answers

0 votes
by

Comment made by: netpyoung

Currently tools.gitlib's doesn't support file:// url also.

`
(defn- call-with-auth
([^GitCommand command]

(call-with-auth
  (.. command getRepository getConfig (getString "remote" "origin" "url"))
  command))

([^String url ^GitCommand command]
(cond

 ;; need to filtering like that.
 (and (instance? TransportCommand command)
      (str/starts-with? url "file"))
 (.call command)
 (and (instance? TransportCommand command)
      (not (str/starts-with? url "http")))
 (.. ^TransportCommand command (setTransportConfigCallback @ssh-callback) call)

:else (.call command))))
`

0 votes
by
_Comment made by: alexmiller_

What is the value in using a local Git repo vs a local dep? ie:


clj -Sdeps '{:deps {my/local {:local/root "../../../../../../../../tmp/foobar"}}}'
0 votes
by

Comment made by: ajcummings

I think there is value in using a local Git repo, at least with my
setup.

We are not running at Git server at work; instead we are hosting our
repositories in NFS. One of the motivations for switching to
tools.deps is that I could fetch my dependencies directly from these
Git repos instead of laundering through our Maven repo (which is also
simply hosted in NFS).

Given this setup, what I would like is a way to fetch directly from Git
in the filesystem, including the insight into tags and history to enable
-Sresolve-tags, deps-ancient, and the like. Doing a git clone/checkout
and pointing there with :local/root doesn't provide that capability, nor
does it support version selection by :sha.

One workaround I've tried is washing the connection to Git through ssh
to another machine which also mounts NFS. But this is brittle for
reasons related to my IT environment, so I'm not willing to unleash
that on my team. So we're sticking with deploying through our
internal Maven repo for now.

0 votes
by
Reference: https://clojure.atlassian.net/browse/TDEPS-93 (reported by severeoverfl0w)
...