Fork me on GitHub
#tools-deps
<
2022-10-12
>
Drew Verlee02:10:11

Is there a way to automatically programatically add exclusions to deps.edn at the root level? If not, is there a reason why that would be hard to do? Or is there something else i should consider? I know i can get a tree of deps using clj -Stree, it would seem simple enough to find the dep i wanted to exclude and walk up the tree and add it to the parent.

Alex Miller (Clojure team)04:10:15

If you want programmatic I would use tools.deps rather than the cli

Alex Miller (Clojure team)04:10:59

But it is somewhat tricky in that it’s not really a tree but a graph, and a dep can appear at many points

borkdude09:10:37

It seems :deps/prep-lib only "activates" if you use the project as a dependency, vs. when you start the project locally. Is that intentional?

borkdude@m1 /tmp/proj $ clj -Sdeps '{:deps {current/current {:local/root "."}}}'
Error building classpath. The following libs must be prepared before use: [current/current]

borkdude@m1 /tmp/proj $ clj
Clojure 1.11.0
user=>

borkdude09:10:10

Another suggestion: the prep-lib error message could include what to run

👍 1
borkdude09:10:34

This also didn't work:

$ clj -Sdeps '{:deps {current/current {:local/root "."}}}' -X:deps prep
Error building classpath. The following libs must be prepared before use: [current/current]

Alex Miller (Clojure team)18:10:09

Yeah, have thought about that, wasn’t sure if it would be like 20 lines of commands at some point :)

borkdude18:10:53

What about the first issue, shouldn't it also just work locally?

borkdude18:10:24

I.e. in an unprepared project, run a REPL, get an error about prep and be able to run clojure -X:deps prep

Alex Miller (Clojure team)21:10:06

That probably makes sense but I want to go back too the origins sheets to make sure I’m not forgetting something

👍 1