is there a library that provides lein deps :pedantic :abort
? i.e. looks for and warns on conflicting versions?
or documentation on how conflicting versions are handled?
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
there are a few tools like depot
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
:pedantic :abort
warns about that, in (some) situations
You could refernce the conflicting dependency as a top level dependency and decide for a version yourself
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?
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
well I did whole conj talk about it. it's complicated
but generally the idea is to pick the newest version
Is the talk uploaded?
but it also picks consistent subtrees (so no child lib should be included if it's parent isn't)
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
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
My argument is that pedantic abort doesn't make sense in a deps world.
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?).
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.
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?
Ah, think I found it at https://clojure.org/guides/deps_and_cli. Just use override-deps.
yes
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.
@markbastian yes, :deps/root