Fork me on GitHub
#tools-deps
<
2021-09-03
>
kirill.salykin11:09:55

is there faster way to prefetch deps for all aliases rather then invoke clojure with alias multiple times?

- clojure -Sdeps '{:mvn/local-repo ".m2"}' -A:test -Spath
    - clojure -Sdeps '{:mvn/local-repo ".m2"}' -A:prod -Spath
    - clojure -Sdeps '{:mvn/local-repo ".m2"}' -A:uberjar -Spath
it is not super long, but still takes around 40 secs (according to ci)

borkdude11:09:27

why not combine all those aliases at once?

borkdude11:09:58

note that combining aliases might result in a different dep resolution than a per alias invocation

kirill.salykin11:09:36

because they might influence each other

kirill.salykin11:09:47

exaclty the reason

borkdude12:09:12

@kirill.salykin you could do this in parallel to speed things up. I hope git / mvn can deal with that, but I think it should

kirill.salykin12:09:28

thats an idea, thanks

borkdude12:09:32

using babashka tasks this is fairly trivial

kirill.salykin12:09:39

tell me more šŸ™‚

borkdude12:09:10

bb.edn

{:tasks {test-deps (clojure "-Sdeps '{:mvn/local-repo ".m2"}' -A:test -Spath")
            prod-deps ...
            main-deps ...
            all-deps {:depends [test-deps prod-deps main-deps]}
And the run bb run --parallel all-deps

šŸ™ 2
kirill.salykin12:09:20

sorry for stupid question, just to ensure, bb is on par with latest tools-deps?

kirill.salykin12:09:45

awesome! you are the best!

borkdude12:09:00

if you don't want to rely on the latest bb clojure, then you can also use (shell "clojure -Sdeps ...")

borkdude12:09:27

to shell out to the system-installed clojure CLI

kirill.salykin12:09:09

thanks for pointers, need to wrap my head around it

kirill.salykin12:09:08

oh, you so nice

kirill.salykin12:09:27

nice, will give it a try!

borkdude12:09:38

(EDIT: added --parallel)

borkdude12:09:04

note that formally, -Spath must go before the aliases

Alex Miller (Clojure team)12:09:51

You are likely to get different deps from combining than separate

borkdude12:09:48

that was already clear I think

Alex Miller (Clojure team)12:09:10

We do have some open issues related to parallel downloads too

kirill.salykin12:09:26

care to share the link? Iā€™d like to +1 those

Alex Miller (Clojure team)12:09:49

This is an area of active changes in Maven itself over the last few core releases

Joshua Suskalo18:09:15

Where do I go to suggest features for tools deps and the clojure cli? Just http://ask.clojure.org?

seancorfield18:09:04

Yes, that's the best place.