Fork me on GitHub
#tools-deps
<
2022-08-15
>
arohner11:08:53

What is the rationale for not supporting :exclusions at the top level of deps.edn? Is that a missing feature, or intentional? Sometimes I’ll want to completely replace a dep with internal code, and it’s not easy because I have to :exclude it from each path. It’s also risky because any future dependency could reintroduce a dependency on the library

p-himik11:08:39

> completely replace a dep with internal code Just adding the same namespaces to one of the dirs in your :paths should do that, no?

arohner11:08:04

the dep still gets resolved and downloaded, and might appear ahead of src on the classpath

p-himik12:08:12

> might appear ahead of src on the classpath Oh? How?

p-himik12:08:23

Not sure what I'm looking at and why. If you're using tools.deps.alpha, the content of :paths should appear before the content of :deps, as far as I know.

Alex Miller (Clojure team)12:08:37

:paths will appear before deps on the classpath

Alex Miller (Clojure team)12:08:31

but to the original question, just haven't gotten around to thinking about it properly. I actually don't think we have a ticket for it if you wanted to add a request at https://ask.clojure.org

arohner12:08:22

The other reason to want to exclude globally is some java deps do magic if they’re on the classpath at all, e.g. slf4j injection

arohner12:08:27

rules_clojure compiles very differently: each library is compiled separately, with their minimal classpath. In the case of 3rd party deps, that might not even include src at all

Alex Miller (Clojure team)17:08:38

prep-lib is a way for a git dep to prepare a lib to be on the classpath, but I think what you're after is not about classpaths