Fork me on GitHub
#tools-deps
<
2018-05-28
>
borkdude09:05:47

without Srepro deps aren’t downloaded but with it they are?

clojure -Srepro -Spath
I need the path but also the effect of deps being downloaded, but nothing else. What’s the best option for this?

borkdude09:05:36

this is excellent for lumo/planck btw, very fast

alexmiller13:05:30

repro should not affect downloading. Are you just seeing m2 caching?

borkdude13:05:24

@alexmiller when I e.g. delete tools.cli from my .m2 repo, only -Spath does not force downloading, but it works with -Srepro. What should the behavior be?

alexmiller14:05:00

Oh, you’re misinterpreting stuff due to classpath caching

alexmiller14:05:38

Normally, if there is a cached classpath, it’s used (and the actual paths aren’t checked, so it won’t notice you deleted from m2). But if there is no cached classpath it will download

borkdude14:05:45

if I can set M2_HOME somehow, I could try to reproduce. Don’t know how to do that with clj

borkdude14:05:03

ah, that explains it

alexmiller14:05:04

With repro, I think it does not use the cached classpath

alexmiller14:05:12

So forces download

alexmiller14:05:41

You can use -Spath -Sforce to do what you want

borkdude14:05:58

so in normal circumstances ( I don’t delete something from .m2 manually ) all should work according to plan

alexmiller14:05:49

Yes, in the normal circumstances things work normally

borkdude14:05:19

yeah, but -Sforce takes longer, that’s not preferred for planck or lumo, so I’ll go for just -Spath

alexmiller14:05:38

We actually have a ticket open for noticing broken paths

borkdude14:05:40

hehe, yes, I mean, there is no logic to actually check for the existence of jars after classpath caching

borkdude14:05:00

so, I understand now, thanks

borkdude14:05:26

side question, is there a way to change which .m2/repository to use with clj?

rickmoynihan16:05:48

Merely as an extra data point I ran into this issue yesterday because I’d blown an .m2 dep away whilst deving/testing some CI stuff. I realised I also needed to blow .cpcache away too to get the effect I wanted; but either a good message, or re-resolving the missing deps would’ve been super nice. It could easily have been a hard error to diagnose.

alexmiller16:05:50

yeah, I’ve been there (even knowing how it works)

alexmiller14:05:11

Yes, you can set :deps/local-repo in deps.edn map

borkdude14:05:30

ah, that’s actually the issue yes. well, if it takes extra time it would be worth considering not doing it… or with another option

borkdude14:05:57

if it’s a couple of ms, it would be ok

alexmiller14:05:22

Yeah I haven’t done any eval on it yet

alexmiller14:05:06

There are also cases where you might expect to have a missing path dir

alexmiller14:05:32

And would want that to be ok

borkdude14:05:45

I have this in deps.edn:

{:deps/local-repo "/tmp/repro"}
and do this from /tmp/repro:
clj -Sforce -Sdeps '{:deps {org.clojure/tools.cli {:mvn/version "0.3.7"}}}' -e "(require '[clojure.tools.cli])"
it doesn’t seem to use the local dir

borkdude14:05:59

just upgraded to just to make sure

borkdude14:05:10

also put everything inside the deps.edn file

borkdude14:05:05

ah, it was :mvn/local-repo

alexmiller16:05:55

Oh sorry, yeah that :)