Fork me on GitHub
#tools-deps
<
2018-05-08
>
richiardiandrea18:05:11

I have a question, with this deps.edn:

{:paths ["src"]
 :aliases {:dev {:extra-paths ["test"]}
           :self-host {:extra-deps
                       {andare {:mvn/version "0.9.0" :exclusions [org.clojure/clojure]}
                        mount {:mvn/version "0.1.13-SNAPSHOT"}}}}}
and command:
clojure -Srepro -A:dev:self-host -Stree
shouldn't be org.clojure completly excluded from the tree?

richiardiandrea18:05:28

(`mount` does not include it)

Alex Miller (Clojure team)18:05:01

-Srepro is kind of in an in between state right now - it’s actually including the install deps.edn, but not ~/.clojure/deps.edn.

Alex Miller (Clojure team)18:05:12

and the install one includes clojure

Alex Miller (Clojure team)18:05:22

I do not expect this to always be the case

richiardiandrea18:05:24

ok that answers it

Alex Miller (Clojure team)18:05:36

but the meaning and use of -Srepro is kind of a topic of internal debate atm

richiardiandrea18:05:02

so at the moment is there a way to work in isolation? without any interference with the global env?

Alex Miller (Clojure team)18:05:36

there is no way to completely exclude the install-level clojure dep

Alex Miller (Clojure team)18:05:55

(although clojure doesn’t run without clojure so I didn’t expect that to be an issue)

Alex Miller (Clojure team)18:05:05

what are you trying to do?

richiardiandrea18:05:06

I am working with self-host ClojureScript so I don't need Clojure for running, but having it on the classpath might cause issues

richiardiandrea18:05:22

let me debug and see if that's the issue though

richiardiandrea18:05:38

but in general you probably might want to consider the use case

Alex Miller (Clojure team)18:05:22

clj runs clojure.main (always) which requires a class on the runtime. How does self hosted avoid that?

Alex Miller (Clojure team)18:05:03

That is, the entire purpose of clj is to run a class on the JVM

dominicm18:05:20

@alexmiller I'm guess -Spath is being used only

richiardiandrea20:05:09

Yes I am using it only for building the classpath

richiardiandrea20:05:31

And I am using clojure for it

Alex Miller (Clojure team)20:05:57

well, you could avoid this by invoking tools.deps directly too

Alex Miller (Clojure team)20:05:27

that is, as a library, rather than via the script

Alex Miller (Clojure team)20:05:30

if you use -A:deps that will add tools.deps.alpha and its dependencies to your classpath. you could even invoke the clojure.tools.deps.alpha.script.make-classpath script directly

Alex Miller (Clojure team)20:05:44

clj -A:deps -m clojure.tools.deps.alpha.script.make-classpath --config-files /path/to/whatever.edn --libs-file /path/to/out.lib --cp-file /path/to/out.cp --jvm-file /path/to/out.jvm --main-file /path/to/out.main -R :self-host

Alex Miller (Clojure team)20:05:12

something like that - I think that script requires all of those and that they are absolute paths

richiardiandrea21:05:59

Ok that is a possible solution thanks

Alex Miller (Clojure team)21:05:31

if you want to write code instead, you could drop down to the tools.deps.alpha layer and write a few lines of code instead.