Fork me on GitHub
#tools-deps
<
2024-01-10
>
seancorfield09:01:07

When a tool is installed (`clojure -Ttools install ...`) and the run (`clojure -Tsome-tool ...`) what determines the version of Clojure it uses? I ask because I have a tool that specifies Clojure 1.12 Alpha 5 in its :deps but when I run it via clojure CLI 1.11.1435, that seems to be ignored and it uses Clojure 1.11.1 instead. I can get around it with an alias in my user deps.edn and :override-deps so that clojure -A:1.12 -Tsome-tool ... then runs with Clojure 1.12 but that's kind of a pain.

Alex Miller (Clojure team)14:01:31

I suspect since the tool has it as a transitive dep, the top-level root deps.edn is the one that defines the version

Alex Miller (Clojure team)14:01:58

When running as an installed tool it’s like the top level dep is the tool itself (+ Clojure from root deps)

seancorfield17:01:19

deps-new latest SHA on the develop branch -- its deps.edn specifies Clojure 1.12 -- but if you install and run it with the 1.11.1.1435 CLI, it uses 1.11 (and breaks because it uses 1.12-specific features).

seancorfield17:01:52

So it sounds like you're saying an installed tool can't override the version of Clojure being used?

Alex Miller (Clojure team)17:01:18

I think that is a practical consequence of this setup (I think maybe we've even talking about this here before, or maybe it was someone else)

Alex Miller (Clojure team)17:01:46

can't say that was really the intention though

seancorfield17:01:34

Thanks. Is that likely to get fixed "soon" or is a 1.12 version of the CLI likely to come first?

seancorfield17:01:50

(just considering my options for deps-new at this point)

Alex Miller (Clojure team)17:01:47

not sure when I will get to it. not sure I even have a good thought on how to fix it

seancorfield17:01:26

I can make deps-new "adaptive" and not break if you run it with 1.11 -- but dynamically adding git deps to the classpath in order to make it easier to use third-party templates is my current priority for that project right now. 1.12 makes that a lot easier (but I have some separate Qs around that I'll ask in #C06E3HYPR probably).

gratitude 1
seancorfield17:01:00

Obvs. I could use a sub-process and a basis etc but I'd prefer not to go that route if a 1.12 CLI is on the horizon -- I don't mind "forcing" people to upgrade to that to get the new features...