Fork me on GitHub
#tools-deps
<
2020-04-06
>
pez11:04:21

I am trying to move a project over from Leiningen to deps. In the project.clj there is a top level :exclusionsvector. Anyone familiar enough with both lein and deps to hint me where I should look up how to translate it to deps?

Alex Miller (Clojure team)12:04:10

There is no support for global exclusions right now

Alex Miller (Clojure team)12:04:51

But you can repeat it at each top level dep if needed

pez12:04:03

Thanks! We'll see if needed. 😃

vlaaad11:04:16

hmm, I think I saw something about using :override-deps with nil values…

mgrbyte11:04:37

I am trying to figure out how to create an uberjar with exlusions (This achieved with the :provided profile in lein). I'm using depstar atm. Has anyone found a way to do this?

rickmoynihan11:04:42

@pez: it’s translates directly:

some/dep {:mvn/version "3.0.0"
                   :exclusions [ch.qos.logback/logback-classic]}

teodorlu12:04:40

Note: deps uses different dependency resolution from Lein (which relies on Maven). It might make sense to check if you need the exclusions after moving to deps. The ClojureScript podcast S3E4[1] with @alexmiller provides some discussion on this. [1]: https://clojurescriptpodcast.com/

imre12:04:22

Would it go against deps philosophy to add support for something like provided? To me that (although it could perhaps be better named) communicates for (some of) its functionality, this project needs xx/yy, however it is left to the consumer to provide those. Or is a dev alias with those dependencies the preferred way?

imre12:04:32

Understood, thanks

pez12:04:38

@rickmoynihan yes, those exclusions work. This is a top-level key that Leiningen supports. I am not even sure what it does, only that I fail to get my project running and thinking it might be this. But after trying with @vlaaad’s suggestion, indicates I also have some other error in my config.

seancorfield16:04:30

@pez FWIW, we used exclusions heavily with both lein and boot but once we switched to deps.edn we were able to get rid of nearly all our exclusions (I think we still have a couple of exclusions of ClojureScript in our backend deps because we just don't need/want that brought in).

pez17:04:40

@seancorfield, Thanks! I'll listen to that podcast that @teodorlu mentioned and see if I can figure out why. 😃

🙂 4
seancorfield21:04:48

@mikerod Recent commits have made add-lib depend on Java code in that repo so you can no longer depend on it via git. I built a local version to use, so I could work with the most recent features & fixes. Alex has talked about some form of add-lib ending up in core or part of the REPL or something... all TBD at this point.

mikerod21:04:47

Ah ok. Thanks for the details.

seancorfield21:04:54

My "dot-clojure" file (`deps.edn`) has a :deps alias that depends on a git SHA prior to the Java code dependency.

mikerod21:04:03

I did see that one.

mikerod21:04:15

But guess it requires some more.

seancorfield21:04:13

Well, it can be used as-is -- and it generally works just fine. I used it quite a bit in that form for loading new libraries into my running REPL (since I tend to start a REPL and run it for days).

mikerod14:04:15

I believe I read there were issues in newer JVMs around trying to add to URL classloaders or something of that sort. This has been worked around in this branch? I’m going to look a bit at the impl because I’m curious what is being done.

mikerod14:04:24

(which is used by pomegranate)

seancorfield15:04:52

@mikerod If you create a dynamic class loader, you can load new libraries/classes into it: that's how we embed Clojure at work into a legacy app and how add-lib works (you can only use it in a context that has a DCL -- for example, Cognitect's REBL does not, so at work we have a small Clojure script to start REBL's UI after setting up a DCL).

mikerod16:04:53

ah ok. that makes sense - thanks for the extra details

seancorfield21:04:26

(I'm using a variant of 0.8.667 built locally now)

Alex Miller (Clojure team)21:04:14

I'm actually working on it RIGHT NOW :)

🎉 28
Alex Miller (Clojure team)21:04:39

Rich and I spent an hour this morning talking about it

andy.fingerhut21:04:55

Quick. Everybody don't bother Alex! 🙂

😂 12
seancorfield21:04:19

I deliberately didn't @ you so I wouldn't disturb you 🙂

mikerod22:04:06

Ok. I appreciate all the input.