Fork me on GitHub
#tools-deps
<
2018-10-02
>
kommen05:10:42

is there a way to figure out in a clojure process started with clj which aliases were used to start it?

seancorfield06:10:00

The aliases are only used to build the classpath (and main opts etc). By the time your program is running, none of that is available.

seancorfield06:10:16

What is the problem you're trying to solve here?

kommen06:10:43

cider checks if dependencies for certain functionality are on the classpath. until now, simply by splitting the classpath entries and interpreting that. this falls apart when using tools.deps git and local coordinates

seancorfield06:10:30

Yup. Well, I think CIDER is trying to be far too clever here and making all sorts of unwarranted assumptions -- but it sounds like Bozihdar is aware of the problem and will figure it out -- he's been doing amazing stuff with CIDER...

seancorfield06:10:47

clj and tools.deps are making a lot of people reconsider their assumptions šŸ™‚

kommen06:10:24

ok, thanks

dominicm06:10:58

The safe way to do it is to check for the existence of namespaces/classes, not to search the classpath for them.

šŸ‘ 4
šŸ‘Œ 4
krukow20:10:31

@seancorfield @alexmiller I have a simple repro (on my machine) - from a clean install. Unzip the .zip file into an empty directory and run clj -A:uberjar -Srepro -Sforce - would any of you be so kind as to confirm / invalidate the repro so I can make a formal issue?

krukow20:10:58

FYI the repro sequence was: with an empty /.m2, /.clojure on OS X high sierra with brew install clojure, `clj -Sdeps '{:deps {seancorfield/clj-new {:git/url "https://github.com/seancorfield/clj-new" :sha "21ca1b27f46dc324be084ba839beca555aeda387"}}}' \ -m clj-new.create \ app \ krukow/artifact-exception` and then clj -A:uberjar -Srepro -Sforce in the folder where simple-repro.zip is unzipped.

krukow20:10:30

then add

:mvn/repos {"central" {:url ""}
             "clojars" {:url ""}}

krukow20:10:37

to deps.edn and things work

dominicm20:10:52

@krukow this makes sense to me. Cambada doesn't consider the system deps.edn file.

seancorfield20:10:12

Ouch! That's quite the gotcha!

krukow20:10:36

thank you!

krukow20:10:31

but the workaround is easy then - I should have thought of this šŸ˜®

krukow20:10:55

One more general question: where can I find the source code for the clojure & clj CLI tools

seancorfield20:10:04

The brew-install and tools.deps.alpha repos under the clojure org.

seancorfield20:10:35

(the former is the shell scripts etc, the latter is the library they use for all the dependency stuff)

krukow20:10:33

:thumbsup: thank you Sean

amar22:10:51

@krukow this PR should fix the issue you were having https://github.com/luchiniatwork/cambada/pull/14