Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure CLI by
closed ago by

As seen on Slack: https://clojurians.slack.com/archives/C03S1KBA2/p1655612767836199

I have confirmed that:

clojure -Ttools install-latest :lib io.github.seancorfield/deps-new :as new

Installs v0.4.9 despite three releases having been made since then.

And if you have an earlier version of deps-new installed and try to update it:

clojure -Ttools install-latest :tool new

you get v0.4.9.

How is it comparing the versions? A lexical sort won't work because v0.4.10, v0.4.11, and v0.4.12 will all sort "earlier" than v0.4.9 but they are later versions.

closed with the note: Fixed in Clojure CLI 1.1.11.1145

1 Answer

+1 vote
ago by
selected ago by
 
Best answer

New version of tools.tools is now available. You can install it with:

clj -Ttools install-latest :tool tools

This version sorts by semver formats, not lexicographically.

ago by
Confirmed this works for the use cases I've tried so far.
ago by
Doesn't work for this tool:

$ clojure -Ttools install-latest :lib io.github.clj-holmes/clj-watson :as clj-watson
clj-watson: Skipping, newest installed io.github.clj-holmes/clj-watson v4.0.1-ALPHA

v4.0.1 is the latest version.
ago by
Thanks, new version of tools.tools is available, filters alphas etc.

`clj -Ttools install-latest :tool tools`
ago by
I can confirm that new version installs v4.0.1 of Watson, as expected.

You say "filters alphas etc" -- do you mean that it will not install an alpha/beta version or that it sorts them correctly as older than a "gold" release?

Will the "Install latest" section of the CLI reference be updated with these caveats and clarifications (including the lack of support for :deps/root and non-tagged SHAs)?
ago by
It filters out version strings containing a variety of things: a, alpha, b, beta, m, milestone, rc, cr, and snapshot. I don't think it makes sense to automatically install non-final release versions (you can always find those versions and install them explicitly with install if needed). I've updated the install-latest docs at https://clojure.github.io/tools.tools/clojure.tools.tools.api.html#var-install-latest, will do docs with CLI release.
ago by
Perfect! Thank you.
...