Fork me on GitHub
#tools-deps
<
2020-11-21
>
misha11:11:24

howdy! https://akovantsev.github.io/corpus/clojure-slack/tools-deps this channel's log as a single page (as preserved by https://clojurians-log.clojureverse.org/tools-deps) double-click on words to filter (cmd+f to highlight as per your browser), click on dates to expand filtered-out.

😀 3
borkdude13:11:49

We are using CLJ_CONFIG to set dependency versions properly from a "one source of truth" deps.edn file that is located in ../base. It works great. Our only problem is generating the pom file:

$ export CLJ_CONFIG=../base
clojure -A:base -X:deps mvn-pom :lib dre.annotator/annotator

Error generating pom manifest: Bad coordinate for library selmer/selmer, expected map: nil

borkdude13:11:43

should we be using -X:base:deps ? this also doesn't work

borkdude14:11:08

We're using the :default-deps feature

borkdude14:11:54

Repro:

{:aliases {:versions {:default-deps {clj-kondo/clj-kondo {:mvn/version "2020.10.10"}}}}
 :deps {clj-kondo/clj-kondo nil}}
clojure -A:versions -Spath
works, but:
$ clojure -A:versions -X:deps mvn-pom
Error generating pom manifest: Bad coordinate for library clj-kondo/clj-kondo, expected map: nil

Alex Miller (Clojure team)17:11:32

Note that -X:deps mvn-pom is not affected by changes in the classpath used to run it (so using the :versions alias with it won't affect the pom that is generated). This differs from -Spom which does work from the classpath you're choosing via clj. We are still debating the best way to supply a set of classpath-modifying options to mvn-pom (and other programs like tree).

Alex Miller (Clojure team)17:11:40

I wasn't able to repro the error you show above with that or with variants. The code you point to should only be happening if a coord can't be resolved so that's too probably too late to be fixing this error, but I'd like to have a good repro first

Alex Miller (Clojure team)17:11:38

also btw, mvn-pom does not take a :lib argument, I'm curious how you got the idea it did

borkdude18:11:50

@U064X3EF3 Tried this again.

borkdude@MBP2019 /tmp $ clojure -A:versions -X:deps mvn-pom
Error generating pom manifest: Bad coordinate for library clj-kondo/clj-kondo, expected map: nil
borkdude@MBP2019 /tmp $ clojure -Sdescribe
{:version "1.10.1.727"
 :config-files ["/usr/local/Cellar/clojure/1.10.1.727/deps.edn" "/Users/borkdude/.clojure/deps.edn" "deps.edn" ]
 :config-user "/Users/borkdude/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/Cellar/clojure/1.10.1.727"
 :config-dir "/Users/borkdude/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}
borkdude@MBP2019 /tmp $ cat deps.edn
{:aliases {:versions {:default-deps {clj-kondo/clj-kondo {:mvn/version "2020.10.10"}}}}
 :deps {clj-kondo/clj-kondo nil}}

borkdude18:11:08

I don't know where the :lib argument came from. This was written by a colleague who went with vacation and this blocked our deploy.

borkdude18:11:01

fwiw @seancorfield also has said he has the exact same problem at his job

borkdude19:11:14

Same with -Srepro:

$ clojure -Srepro -A:versions -X:deps mvn-pom
Error generating pom manifest: Bad coordinate for library clj-kondo/clj-kondo, expected map: nil

Alex Miller (Clojure team)22:11:30

thx, that repros for me

Alex Miller (Clojure team)22:11:32

so this is exactly what I said above - the :versions alias affects the classpath of the mvn-pom program, but is not used when computing the pom deps (only the project deps.edn is used for that), and yes that's the same issue Sean has. as he said, clj -Spom works differently and that's the recommended path right now.

borkdude22:11:41

alright, thanks

borkdude14:11:50

my team lead is now threatening with migrating everything to mvn ;)

seancorfield18:11:22

We have the exact same problem at work

seancorfield18:11:37

(also we use {} instead of nil for overridden deps - and then :override-deps

borkdude18:11:20

lol, I made this hack:

clojure -M:base:deps -e "(require '[clojure.tools.cli.api :as api]) (require '[clojure.tools.deps.alpha.extensions :as ext]) (alter-var-root #'ext/throw-bad-coord (constantly (fn [x y] [x y]))) (alter-var-root #'ext/throw-bad-manifest (constantly (fn [x y z] z))) (api/mvn-pom {:lib 'dre.annotator/annotator})"
but it didn't work. I'll try -Spom .

borkdude18:11:40

@seancorfield I'm seeing:

Skipping paths: resources
Skipping coordinate: {:local/root ../genseng, :deps/manifest :deps, :deps/root ../genseng, :parents #{[]}, :paths [/Users/borkdude/dre/DocSearch/genseng/src]}

borkdude18:11:56

we have a couple of local/root deps which it seems it doesn't pick up?

borkdude18:11:38

Not sure if this is bad. We use the pom.xml for the uberjar with depstar:

clojure -A:base:jvm -M:depstar -m hf.depstar.uberjar target/annotator-standalone.jar -C -m dre.standalone

seancorfield19:11:58

The pom.xml isn't terribly important to depstar -- it gets artifact, group, and version from it. That's all.

seancorfield19:11:04

We generated a pom.xml for each subproject that we build uberjars for but the dependencies aren't important. Then we do the CLJ_CONFIG=../versions clojure -M:defaults:depstar ...etc... much like you @borkdude

borkdude19:11:17

yep, same. thanks!

borkdude19:11:41

In the olden boot days I wrote my own solution for this: https://github.com/borkdude/boot-bundle