Fork me on GitHub
#tools-deps
<
2018-07-20
>
cfleming00:07:29

I’m testing deps with Cursive, and I’m finding that resolving several large projects at once is really slow. This is a project with several apps in it, all of which use a series of libraries transitively via ‘:local/root’. Is it possible that each project refresh works out a complete list of what to download up front and then downloads it, such that each project will download everything even if another project has concurrently downloaded that dep in the meantime?

cfleming00:07:41

In total there are 15 projects (including apps + libs), it uses kafka so who knows how much each one will download. But I’m on a 1 Gb fibre connection, so it’s generally pretty quick. It’s taking around 15-20 minutes to resolve them all.

Alex Miller (Clojure team)00:07:57

It uses Maven to download as it goes, which uses the Maven cache

Alex Miller (Clojure team)00:07:42

That said, I have spent no time optimizing any of that and none of it is parallel (but most likely some could be)

cfleming00:07:41

Right, my case is probably unusual in that if you set up a large project in Cursive (which I just did based on data a user sent me) then IntelliJ will go off and resolve all the projects in parallel.

cfleming00:07:52

Does the maven lib separate the resolution into a resolution step and a download step? I’m wondering if each project does the resolution step, decides what to download and then downloads it without checking before each download if something else has done so in the meantime?

mping12:07:33

Hi, is there a recommended way to integrate lein with tools-deps? I want to use git dependencies

mgrbyte13:07:37

@mping Not sure about "recommended", but I'm using lein-tools-deps - works pretty well so far. Only things that don't work are lein deps :tree, lein search AFAICT

hlolli15:07:46

is there a function in tools.deps that I could use to generate a vector of maps containing all remote dependencies for a project's dependencies, plus, if possible, the sha-sums of the .jar files. I'm wiring a deriviation for nix(Os), and it seems that there's no tool for generating nix expression for clojure dependencies available. There's one for maven, called mvn2nix. I guess I could use that, but I'd have to make some hack for mirrors, adding clojars etc..

dominicm15:07:55

yeah, I think that would be possible via the api

dominicm15:07:09

the api is small, call both of the documented functions

hlolli15:07:59

make-classpath and resolve-deps? I will try!

dominicm15:07:40

maybe not make-classpath actually

dominicm15:07:45

just resolve-deps & vals

hlolli16:07:41

@dominicm thanks for the tip, I'm getting all the deps printed, which is good. But that which is missing, is the url's to the .jar files

fipp
 {:versions
  {#:mvn{:version "0.6.12"}
   {:mvn/version "0.6.12", :deps/manifest :mvn}},
  :paths {#:mvn{:version "0.6.12"} #{[]}},
  :select #:mvn{:version "0.6.12"},
  :pin true},
probably straightforward to do, but how would I get the download urls from this information?

dominicm16:07:15

@hlolli I think there's something missing here, you've called resolve-deps?

hlolli16:07:38

yes I did this

(prn
 (pprint (resolve-deps '{:deps
                         {org.clojure/clojure        {:mvn/version "1.9.0"}
                          org.clojure/clojurescript  {:mvn/version "1.10.238"}
                          org.clojure/tools.reader   {:mvn/version "1.3.0-alpha3"}
                          com.cognitect/transit-cljs {:mvn/version "0.8.256"}
                          malabarba/lazy-map         {:mvn/version "1.3"}
                          fipp                       {:mvn/version "0.6.12"}}}
                       {:verbose true}
                       )))

dominicm16:07:30

Something looks off about your result to me. The value of :paths for me is different, I have jars in there.

dominicm16:07:32

or dirs, context dependent.

hlolli16:07:16

ah yes, if the jar is found, it appears

hlolli16:07:21

but only locally

hlolli16:07:46

com.google.protobuf/protobuf-java
 {:mvn/version "3.0.2",
  :deps/manifest :mvn,
  :paths
  ["/home/hlolli/.m2/repository/com/google/protobuf/protobuf-java/3.0.2/protobuf-java-3.0.2.jar"],
  :dependents [com.google.javascript/closure-compiler-unshaded]},

dominicm17:07:11

You want the remote values?

hlolli17:07:34

yes, I need that, and the sha sums, but I could just get them after all is downloaded

hlolli17:07:46

the pain with nix, is that nothing can be downloaded without being declared, all http fetches need to be done on nix's side

dominicm17:07:34

I don't think you can get the remote urls, I think it's blackboxed into a maven library

hlolli17:07:39

maybe, you can always download jars directly from clojars, maybe maven is more blackboxed

dominicm17:07:01

I meant maven library which handles clojars & maven

dominicm17:07:11

t.d.a has no concept of "get-url-for-dep"

dominicm17:07:43

You'd probably have to utilize the same approach that mvn2nix uses, and also write equivalents for git & local deps.

hlolli17:07:06

pff, hope its easy 🙂 will research.

noprompt22:07:19

has anyone run in to problems with using krypton and git deps?

noprompt22:07:03

clj complains it can’t find the ~/.ssh/id_krypton private key which it shouldn’t because, as i understand it, krypton has that key.