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.
nice work. fwiw, it's also here: https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/tools-deps
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
should we be using -X:base:deps
? this also doesn't work
We're using the :default-deps
feature
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
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).
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
also btw, mvn-pom does not take a :lib argument, I'm curious how you got the idea it did
@alexmiller 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}}
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.
fwiw @seancorfield also has said he has the exact same problem at his job
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
thx, that repros for me
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.
alright, thanks
my team lead is now threatening with migrating everything to mvn ;)
Probably this is too strict:
https://github.com/clojure/tools.deps.alpha/blob/9b3744fc9ab3b64d1e39765afc6e478c7c77cea4/src/main/clojure/clojure/tools/deps/alpha/extensions.clj#L66-L72
The map?
check should be extended to allowing nil
as well
@borkdude use -Spom instead
We have the exact same problem at work
(also we use {}
instead of nil
for overridden deps - and then :override-deps
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
.@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]}
we have a couple of local/root deps which it seems it doesn't pick up?
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
The pom.xml
isn't terribly important to depstar
-- it gets artifact, group, and version from it. That's all.
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
yep, same. thanks!
In the olden boot days I wrote my own solution for this: https://github.com/borkdude/boot-bundle