How to declare a super specific version of Clojure in the deps.edn?

Some instructions for using clj-new says:

Note: these instructions assume you are using the Clojure CLI version 1.10.1.697 or later!

And because those instructions are not working for me, I’m suspecting it is because my Clojure version, which is 1.10.1 (that is why I’m using a different set of old instructions and I’m fine using clj-new, that is not the problem).

So I am wondering: How can I specify in my deps.edn that I want to use Clojure 1.10.1.697 or later (with that last part of 697)?

Thank you!

Clojure CLI versions are not Clojure versions. See https://clojure.org/releases/tools for Clojure CLI versions.

The Clojure CLI can use any version of Clojure: you specify org.clojure/clojure as a dependency and you can even use Clojure 1.0 with the latest Clojure CLI:

(! 622)-> clojure -Sdescribe
{:version "1.10.1.727" <==== THIS IS THE CLOJURE CLI VERSION
 :config-files ["/usr/local/Cellar/clojure@1.10.1.727/1.10.1.727/deps.edn" "/Users/sean/.clojure/deps.edn" "deps.edn" ]
 :config-user "/Users/sean/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/Cellar/clojure@1.10.1.727/1.10.1.727"
 :config-dir "/Users/sean/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}

Tue Oct 27 11:23:56
(sean)-(jobs:0)-(~/clojure)
(! 623)-> clojure -A:1.0 <==== THIS IS AN ALIAS FOR org.clojure/clojure {:mvn/version "1.0.0"}
Downloading: org/clojure/clojure/1.0.0/clojure-1.0.0.pom from central
Downloading: org/clojure/clojure/1.0.0/clojure-1.0.0.jar from central
Clojure 1.0.0-
user=> (clojure-version)
"1.0.0-"
user=> *clojure-version*
{:major 1, :minor 0, :incremental 0, :qualifier ""}
user=> 

You can install a specific version of the Clojure CLI. I use brew on macOS and Linux, for example:

brew install clojure/tools/clojure@1.10.1.727

Several projects out there now rely on the changed -M behavior or the new -X option on the CLI, which is why they say you need at least 1.10.1.697.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.