tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
borkdude 2020-08-09T20:11:43.090900Z

I get a ton of "DEPRECATED libs must be qualified" warnings not from my own deps.edn, but for transitive deps. Can I somehow turn that off? It's not something I can fix in my own codebase.

borkdude 2020-08-09T20:12:29.091800Z

Also one thought: would it make sense to only deprecate it for git deps and not for mvn deps, since mvn already has the foo = foo/foo implicit convention and there's not much tools.deps is going to change about that?

vlaaad 2020-08-09T20:23:07.092100Z

This is not about foo=foo/foo convention, this about a way of thinking about dependencies. Shorthands incentivize names squatting, full group/artifact names make you think who you depend on. I'd rather depend on borkdude/clj-kondo than on just clj-kondo. I'd rather released vlaaad/cljfx than just cljfx... I think it makes sense to state group/artifact for every procurer.

dominicm 2020-08-09T20:23:34.092700Z

I don't think maven does have that implicit thing, does it?

dominicm 2020-08-09T20:23:44.093Z

They're very big on groups

borkdude 2020-08-09T20:34:48.094800Z

If you push a library foobar with lein to clojars, it's really foobar/foobar, so the group is foobar and the library is also called foobar. That's what I mean with a mvn library. The mechanism for pushing/retrieving is based on mvn. I know avoiding conflicts is important, but this convention has been there since ages in leiningen. Is this a lein convention or a mvn convention, I'm not sure. I haven't used pom.xml directly that much.

borkdude 2020-08-09T20:36:42.096900Z

So is this a design mistake of lein that deps now tries to solve? I totally understand the need for git deps to have a unique and predictable identifier.

dominicm 2020-08-09T20:36:49.097200Z

I suspect it's a lein and clojars thing. Maven central won't let you create an artifact like that, only clojars does (to controversy)

borkdude 2020-08-09T20:40:01.097800Z

Anyway, I hope that I turn off the warning for transitive deps, since I'm getting a ton of them:

borkdude@MBP2019 ~/Dropbox/dev/clojure/babashka (master) $ clojure -Sforce -A:lib-tests
DEPRECATED: Libs must be qualified, change expound => expound/expound (/Users/borkdude/.gitlibs/libs/lambdaisland/regal/b059fdb06d5586a9a04c27e7b011c467ad8546db/deps.edn)
DEPRECATED: Libs must be qualified, change instaparse => instaparse/instaparse (/Users/borkdude/.gitlibs/libs/lambdaisland/regal/b059fdb06d5586a9a04c27e7b011c467ad8546db/deps.edn)
DEPRECATED: Libs must be qualified, change medley => medley/medley (/Users/borkdude/.gitlibs/libs/henryw374/cljc.java-time/e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c/deps.edn)
DEPRECATED: Libs must be qualified, change camel-snake-kebab => camel-snake-kebab/camel-snake-kebab (/Users/borkdude/.gitlibs/libs/henryw374/cljc.java-time/e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c/deps.edn)
DEPRECATED: Libs must be qualified, change cljs.java-time => cljs.java-time/cljs.java-time (/Users/borkdude/.gitlibs/libs/henryw374/cljc.java-time/e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c/deps.edn)
DEPRECATED: Libs must be qualified, change expound => expound/expound (/Users/borkdude/.gitlibs/libs/lambdaisland/regal/b059fdb06d5586a9a04c27e7b011c467ad8546db/deps.edn)
DEPRECATED: Libs must be qualified, change instaparse => instaparse/instaparse (/Users/borkdude/.gitlibs/libs/lambdaisland/regal/b059fdb06d5586a9a04c27e7b011c467ad8546db/deps.edn)
DEPRECATED: Libs must be qualified, change medley => medley/medley (/Users/borkdude/.gitlibs/libs/henryw374/cljc.java-time/e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c/deps.edn)
DEPRECATED: Libs must be qualified, change camel-snake-kebab => camel-snake-kebab/camel-snake-kebab (/Users/borkdude/.gitlibs/libs/henryw374/cljc.java-time/e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c/deps.edn)
DEPRECATED: Libs must be qualified, change cljs.java-time => cljs.java-time/cljs.java-time (/Users/borkdude/.gitlibs/libs/henryw374/cljc.java-time/e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c/deps.edn)
Clojure 1.10.2-alpha1
user=>

seancorfield 2020-08-09T20:44:03.098500Z

@borkdude You're only getting those for git deps -- not for all transitive deps.

seancorfield 2020-08-09T20:44:54.099500Z

If you were depending on released versions, you wouldn't get those warnings. I've only had to update my current project deps to get rid of warnings -- but I don't generally depend on git deps.

borkdude 2020-08-09T20:46:57.101300Z

I'm getting warnings for 1) my own git deps, 2) my own mvn deps, 3) mvn deps of transitive git deps. I'm not sure if a git dep depending on another git dep would also yield a warning, but I suspect this situation isn't that prevalent yet (let's call this 4). I understand the need for 1. 2 is disputable, but from a "let's fix what lein did wrong" perspective, I can live with it. 3 and 4 I wouldn't find acceptable.

borkdude 2020-08-09T20:47:12.101600Z

1 and 2 aren't shown in the output, I already fixed those.

alexmiller 2020-08-09T20:49:11.103200Z

You are getting these any time clj reads any deps manifest

alexmiller 2020-08-09T20:50:15.103800Z

So would for 4 as well

alexmiller 2020-08-09T20:52:06.105Z

I could tailor these more, but this is a step towards removing support entirely

1
alexmiller 2020-08-09T20:56:03.108700Z

The thing I’m really trying to get rid of here is the need for canonicalization of libs when reading deps files

seancorfield 2020-08-09T20:56:47.109400Z

I have run across a handful of "single" named Java libs (`wsdl4j` plus a few others), but it's pretty rare in non-Clojure world. I agree that we've been very sloppy about that practice in the past (and I'm guilty a few times -- but I'm working to fix that 🙂 )

borkdude 2020-08-09T20:56:59.109700Z

Well, leaving it as it is now will probably force people to update their deps.edns quicker ;)

alexmiller 2020-08-09T20:57:33.110100Z

Well that’s the idea :)

dominicm 2020-08-09T21:01:55.112100Z

I'm glad there's more of a push on this. I've seen a few conflicts in libraries (I've seen at least two libraries using roll.core). I've gotten friction in the past because it's "verbose", so it's nice this will become non optional.

borkdude 2020-08-09T21:02:44.112800Z

I think that example just shows how .core doesn't contribute to avoiding conflicts while still having a multi-segmented name

seancorfield 2020-08-09T21:04:03.113100Z

I think .core is a horrible default 😐

💯 1
✔️ 1
➕ 1
seancorfield 2020-08-09T21:06:29.115900Z

That's why clj-new doesn't do that. You must provide either a group-id/artifact-id project name (and the README talks about using reverse domain names or other identity-based groups) or you can provide a multi-segment namespace name. But I may downplay that option a bit more, now that t.d.a. is "encouraging" proper group/artifact lib names 🙂

cfleming 2020-08-09T23:28:52.118600Z

@alexmiller -Stree seems to be broken since 1.10.1.624. It’s because previously root deps used to return nil in their :dependents set, and now they return an empty collection. This broke Cursive, I’ve fixed it there by inlining make-tree and changing:

(let [{roots false, nonroots true} (group-by #(-> % val :dependents boolean) lib-map)]
to:
(let [{roots false, nonroots true} (group-by #(-> % val :dependents empty? not boolean) lib-map)]

cfleming 2020-08-09T23:30:39.119300Z

I’m not sure what the cause of that change is, I couldn’t see anything immediately suspicious in the changelog but I only had a fairly cursory look.

cfleming 2020-08-09T23:32:06.120400Z

On a related note, is the :dependents/`:children` info returned from resolve-deps considered to be part of the API and thus something I can rely on? It’s not mentioned in the docstring.

seancorfield 2020-08-09T23:43:31.122500Z

The output of -Stree has certainly changed -- I just updated from .619 to .641 and my outdated deps script broke (so that'll be a bit of fun for me to debug and fix tomorrow morning when I get to work!).

cfleming 2020-08-09T23:43:50.122800Z

Well, it’s changed from appearing to not appearing at all.

seancorfield 2020-08-09T23:44:32.123600Z

Ah, yes, that would definitely break my script. I hadn't actually tested basic output yet.

cfleming 2020-08-09T23:44:38.123700Z

~/d/c/issues (master)> clj -Stree
~/d/c/issues (master)>

seancorfield 2020-08-09T23:45:18.123900Z

Oops.

seancorfield 2020-08-09T23:45:36.124300Z

Well... I guess I don't need to debug my script 🙂

cfleming 2020-08-09T23:46:05.124500Z

https://clojure.atlassian.net/browse/TDEPS-161

2