Fork me on GitHub
#tools-deps
<
2020-07-02
>
arohner13:07:57

is there a library that provides lein deps :pedantic :abort? i.e. looks for and warns on conflicting versions?

arohner13:07:34

or documentation on how conflicting versions are handled?

delaguardo13:07:23

you could use -Strace to create edn file with all that information. but I’m not aware of any tooling to make reading of that file easy

alexmiller13:07:31

there are a few tools like depot

arohner13:07:13

I’m looking to handle a jarhell situation where I declare dependencies on A and B, and they each declare a dependency on C, but with conflicting versions

sveri13:07:09

You could refernce the conflicting dependency as a top level dependency and decide for a version yourself

arohner13:07:12

Right, but I need to discover conflicts before resolving them. I’d like a tool to detect them and warn before I find out the hard way

arohner13:07:44

:pedantic :abort warns about that, in (some) situations

arohner13:07:34

but I’d also need to understand how tools.deps resolves that tree. lein’s dependencies are a vector, so deps are ordered sequentially. With a map, how does that work?

alexmiller13:07:31

well I did whole conj talk about it. it's complicated

👍 3
arohner13:07:13

Is the talk uploaded?

alexmiller13:07:41

but generally the idea is to pick the newest version

alexmiller13:07:25

but it also picks consistent subtrees (so no child lib should be included if it's parent isn't)

alexmiller13:07:27

clj -Strace is the best info about what it did and why - the log details each lib/version it looked at (breadth first), what it decided, and why

alexmiller13:07:05

tools.deps.graph has a tool for using trace.edn files to generate a series of pictures from that that can be somewhat helpful as well

dominicm16:07:48

My argument is that pedantic abort doesn't make sense in a deps world.

dominicm16:07:59

You'll never get an older version than what is required, which eliminates 90% of problems you get with maven. In maven, it's assumed everything is conflicting. Deps assumes that newer things are compatible with older things (so the conflict is picking the older dependency?).

dominicm16:07:31

However, the equivalent tool I think would be useful is detecting a top level dependency on an older artefact, when you've bumped the version and it transitively depends on something newer.

markbastian19:07:26

If I have a dependency specified in my main deps section and another version of that dependency under an alias, does the alias take precedence when it is active?

markbastian19:07:05

Ah, think I found it at https://clojure.org/guides/deps_and_cli. Just use override-deps.

markbastian21:07:21

Is there a way to specify a subdirectory when providing git coordinates for a dependency? For example, the git project is foo and within that you have the folders foo-clj and foo-py. deps.edn is in foo-clj. I want to point deps to the foo-clj folder.

borkdude21:07:03

@markbastian yes, :deps/root

🙏 3