Hi! How can I find out which version of org.clojure/tools.deps the clojure CLI is using internally?
I'm debugging a problem where our CI appears to be running an old version of tools.deps, and I'm trying to narrow down the problem space.
can try https://clojuredocs.org/clojure.core/clojure-version without a deps.edn in the current working dir
From CI logs:
bash -c "(mkdir /tmp/fresh && cd /tmp/fresh && clojure -e '(clojure-version)')"
WARNING: Implicit use of clojure.main with options is deprecated, use -M
"1.12.0"
Based on the 1.12.0 result, I'd conclude that we run a recent Clojure version.The symptom is that Git deps with :git/sha fail to download, complaining that :sha is missing.
Library no.cjohansen/replicant has missing :sha in coordinate.
deps.edn contains this dep:
no.cjohansen/replicant {:git/url ""
:git/sha "0cb5064f40a20fc4525bcb018a022cef3dc05da3"}
The official deps.edn reference recommends :git/sha, not :sha. From what I can tell, :git/sha has been allowed for about two years.ah wait youβre looking for the CLI version? Thatβs in the clojure script I think
if you do clj -version that tells you the CLI version. https://github.com/clojure/brew-install/blob/1.12.0/CHANGELOG.md can probably be used to find the associated tools.deps version
:sha was original (still supported for backwards compatibility), and :git/sha has been around and preferred since circa tools.deps 0.12.985 / Clojure CLI 1.10.3.933
but the real error may be that it's not finding that sha in the repo
indeed, I do not see that sha in that repo
oh, no it is there
Great, that helps narrow down the problem. I'm printing a clojure --version, which from what I can tell is the most recent CLI version (https://github.com/clojure/brew-install/blob/1.12.0/CHANGELOG.md), which should support :git/sha.
$ clojure --version
Clojure CLI version 1.12.0.1488what command are you running to get that error?
clojure --version
the https://github.com/clojure/tools.deps/blob/78afc5492f06180c1d2c4904bc626207abb4e44f/src/main/clojure/clojure/tools/deps/extensions/git.clj#L79 that has been in tools.deps for the last 3 years like that says "sha", not ":sha", so you are seeing an old tools.deps, perhaps from a program dependency, not from the CLI dependency
if you are running a tool when you get that, it might be the tool's dependency
if you are deploying Datomic Ions, I know they were using an old version of tools.deps for example (not sure if that has been updated)
Normals dependencies won't be able to modify the tools.deps version, right?
---
I'm not running a tool, I'm running a clojure -M -m .... The following is the full Makefile target (with added lines for printing versions).
resources/fontawesome-icons:
clojure --version
bash -c "(mkdir /tmp/fresh && cd /tmp/fresh && clojure -e '(clojure-version)')"
clojure -Sdeps "{:deps {no.cjohansen/fontawesome-clj {:mvn/version \"2024.01.22\"} \
clj-http/clj-http {:mvn/version \"3.12.3\"} \
hickory/hickory {:mvn/version \"0.7.1\"}}}" \
-M -m fontawesome.import :download resources 6.4.2
The code runs on a Github action, set up with DeLaGuardo/setup-clojure@13.0:
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@13.0
with:
cli: 1.12.0.1488Thanks a lot for the help, @alexmiller and @mkvlr. I'll do some further digging on my own, I might have to try narrow down the problem from a different angle!
tools.deps is just a library. if you run a program that uses it as such, it can of course be out of date. I don't know what fontawesome.import does, but maybe it uses tools.deps
you could look at
clojure -Sdeps "{:deps {no.cjohansen/fontawesome-clj {:mvn/version \"2024.01.22\"} \
clj-http/clj-http {:mvn/version \"3.12.3\"} \
hickory/hickory {:mvn/version \"0.7.1\"}}}" -StreeApologies Alex and Martin: I was misreading Github Action terminal logs, and wasn't looking at the correct Makefile target. The Makefile target that was actually producing the errors depended on
{badigeon/badigeon {:git/url ""
:sha "f4bcca58536f49c10a5ea87b662f33ccf83338ce"}}
, which uses org.clojure/tools.deps.alpha {:mvn/version "0.11.910"}.
If nothing else, I've learned a thing or two about tools.build!yes, that's quite old. I think tools.build is probably a better choice now for what badigeon does