tools-deps

seancorfield 2024-01-10T09:44:07.315229Z

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) 2024-01-10T14:29:55.396059Z

Can you share a repro?

Alex Miller (Clojure team) 2024-01-10T14:32:31.877569Z

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) 2024-01-10T14:33:58.248029Z

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

seancorfield 2024-01-10T17:12:19.242469Z

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).

seancorfield 2024-01-10T17:12:52.688089Z

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

Alex Miller (Clojure team) 2024-01-10T17:22:18.392689Z

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) 2024-01-10T17:22:46.311619Z

can't say that was really the intention though

Alex Miller (Clojure team) 2024-01-10T17:25:32.169389Z

logged this as https://clojure.atlassian.net/browse/TDEPS-258

seancorfield 2024-01-10T17:26:34.901589Z

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

seancorfield 2024-01-10T17:26:50.446629Z

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

Alex Miller (Clojure team) 2024-01-10T17:27:47.323809Z

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

seancorfield 2024-01-10T17:30:26.031769Z

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 #clojure-dev probably).

1
seancorfield 2024-01-10T17:32:00.852739Z

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...