tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
arohner 2020-07-02T13:22:57.187200Z

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

arohner 2020-07-02T13:23:34.187500Z

or documentation on how conflicting versions are handled?

2020-07-02T13:27:23.187600Z

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

alexmiller 2020-07-02T13:28:31.187900Z

there are a few tools like depot

alexmiller 2020-07-02T13:28:43.188100Z

https://github.com/clojure/tools.deps.alpha/wiki/Tools

alexmiller 2020-07-02T13:29:19.188300Z

or https://github.com/slipset/deps-ancient

arohner 2020-07-02T13:30:13.189300Z

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

arohner 2020-07-02T13:30:44.190Z

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

sveri 2020-07-02T13:31:09.190700Z

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

arohner 2020-07-02T13:31:34.191300Z

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?

arohner 2020-07-02T13:32:12.191400Z

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

alexmiller 2020-07-02T13:33:31.191900Z

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

👍 1
alexmiller 2020-07-02T13:33:41.192200Z

but generally the idea is to pick the newest version

arohner 2020-07-02T13:34:13.192600Z

Is the talk uploaded?

alexmiller 2020-07-02T13:34:25.193Z

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

alexmiller 2020-07-02T13:35:27.193900Z

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

alexmiller 2020-07-02T13:36:05.194600Z

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

alexmiller 2020-07-02T13:36:38.194700Z

yeah - https://www.youtube.com/watch?v=7CM7Ef-dPWQ

👍 1
dominicm 2020-07-02T16:38:48.195800Z

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

dominicm 2020-07-02T16:40:59.198500Z

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?).

dominicm 2020-07-02T16:42:31.200100Z

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.

2020-07-02T19:41:26.203200Z

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?

2020-07-02T19:43:05.203300Z

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

alexmiller 2020-07-02T20:15:26.203500Z

yes

2020-07-02T21:04:21.205200Z

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.

borkdude 2020-07-02T21:06:03.205500Z

@markbastian yes, :deps/root

🙏 1