Fork me on GitHub

What's a good way to look up the latest stable coordinate for a package?

$COMMAND_OR_SCRIPT org.clojure/clojure
# Not by manually browsing maven central, looking at clojars, or copying from Github READMEs


so .. if I had actually read the docs, I would have found:

clj -X:deps find-versions :lib

{:mvn/version "0.1.0"}
{:mvn/version "0.2.0"}
{:mvn/version "0.2.1"}
{:mvn/version "0.2.2"}
{:mvn/version "0.3.0"}
{:mvn/version "0.3.1"}
{:mvn/version "0.3.2"}
{:mvn/version "0.3.3"}

duckie 1


alias clj-dep-versions="clj -X:deps find-versions :lib"
, we can
clj-dep-versions org.clojure/clojure

{:mvn/version "1.0.0"}
{:mvn/version "1.1.0"}
{:mvn/version "1.2.0"}
{:mvn/version "1.2.1"}
{:mvn/version "1.3.0-alpha5"}


But I think I'll go with neil.


@teodorlu I have a babashka script for this called neil, which currently just add the lib directly to your deps.edn:

$ neil add dep :lib org.clojure/clojure :deps-file foo.edn
$ cat foo.edn
{:deps {org.clojure/clojure {:mvn/version "1.11.0-beta1"}}
 :aliases {}}


ooh, that's even nicer. And I persume faster startup than JVM.


Thank you 🙏


You can also use it to add a config + file to your repo:

neil add build

👍 1

Provided NixOS package works great :thumbsup:

Godwin Ko13:02:03

What’s the difference between clj -Stree & clj -X:deps tree? In one of my project using clj-http, the first command runs fine but the second one throw exception of could not locate file on classpath :thinking_face:

Alex Miller (Clojure team)13:02:45

The first runs in your project classpath, the latter runs outside of it, but if you're just running those commands they should basically be the same. Can you share your clj version and the error?

Godwin Ko14:02:01

clj version is, here’s the output for clj -Stree

org.clojure/data.json 1.0.0
org.clojure/clojure 1.10.3
  . org.clojure/spec.alpha 0.2.194
  . org.clojure/core.specs.alpha 0.2.56
org.clojure/core.logic 1.0.0
org.clojure/tools.namespace 1.1.0
  . org.clojure/java.classpath 1.0.0
  . org.clojure/tools.reader 1.3.4
instaparse/instaparse 1.4.10
metosin/malli 0.2.1
  . borkdude/dynaload 0.2.2
  . borkdude/edamame 0.0.11-alpha.15
    X org.clojure/tools.reader 1.3.2 :older-version
  . org.clojure/test.check 1.1.0
org.clojure/math.combinatorics 0.1.6
org.clojure/core.match 1.0.0
org.clojure/data.priority-map 1.0.0
http-kit/http-kit 2.5.3
and here’s for clj -X:deps tree
Exception in thread "main" Syntax error compiling at (user.clj:1:1).
        at clojure.lang.Compiler.load(
        at clojure.lang.RT.loadResourceScript(
        at clojure.lang.RT.loadResourceScript(
        at clojure.lang.RT.maybeLoadResourceScript(
        at clojure.lang.RT.doInit(
        at clojure.lang.RT.init(
        at clojure.main.main(
Caused by: Could not locate org/httpkit/client__init.class, org/httpkit/client.clj or org/httpkit/client.cljc on classpath.
        at clojure.lang.RT.load(
        at clojure.lang.RT.load(
        at clojure.core$load$fn__6856.invoke(core.clj:6115)
        at clojure.core$load.invokeStatic(core.clj:6114)
        at clojure.core$load.doInvoke(core.clj:6098)
        at clojure.lang.RestFn.invoke(
        at clojure.core$load_one.invokeStatic(core.clj:5897)
        at clojure.core$load_one.invoke(core.clj:5892)
        at clojure.core$load_lib$fn__6796.invoke(core.clj:5937)
        at clojure.core$load_lib.invokeStatic(core.clj:5936)
        at clojure.core$load_lib.doInvoke(core.clj:5917)
        at clojure.lang.RestFn.applyTo(
        at clojure.core$apply.invokeStatic(core.clj:669)
        at clojure.core$load_libs.invokeStatic(core.clj:5974)
        at clojure.core$load_libs.doInvoke(core.clj:5958)
        at clojure.lang.RestFn.applyTo(
        at clojure.core$apply.invokeStatic(core.clj:669)
        at clojure.core$require.invokeStatic(core.clj:5996)
        at clojure.core$require.doInvoke(core.clj:5996)
        at clojure.lang.RestFn.invoke(
        at user$eval138$loading__6737__auto____139.invoke(user.clj:1)
        at user$eval138.invokeStatic(user.clj:1)
        at user$eval138.invoke(user.clj:1)
        at clojure.lang.Compiler.eval(
        at clojure.lang.Compiler.eval(
        at clojure.lang.Compiler.load(
        ... 6 more

Godwin Ko14:02:08

I switch from clj-http to http-kit to see if that’s a library specific issue, but seem not……

Godwin Ko14:02:20

my deps.edn is a very simple one, nothing special I guess

{:paths ["src" "resources"]
 :deps {http-kit/http-kit {:mvn/version "2.5.3"}
        instaparse/instaparse {:mvn/version "1.4.10"}
        metosin/malli {:mvn/version "0.2.1"}
        org.clojure/core.logic {:mvn/version "1.0.0"}
        org.clojure/core.match {:mvn/version "1.0.0"}
        org.clojure/data.json {:mvn/version "1.0.0"}
        org.clojure/data.priority-map {:mvn/version "1.0.0"}
        org.clojure/tools.namespace {:mvn/version "1.1.0"}
        org.clojure/math.combinatorics {:mvn/version "0.1.6"}}
 :aliases {:nrepl {:extra-deps {cider/cider-nrepl {:mvn/version "0.25.5"}
                                refactor-nrepl/refactor-nrepl {:mvn/version "2.5.1"}}
                   :main-opts ["-m" "nrepl.cmdline"
                               "--middleware" "[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]"

Alex Miller (Clojure team)14:02:44

ah, so the difference is in your user.clj being included - there is actually a fix for this in the Clojure CLI released yesterday -

Godwin Ko14:02:07

confirm that fixed the issue, thx a lot :man-bowing::skin-tone-2:

Alex Miller (Clojure team)14:02:05

happy coincidence :)

😄 1

Figured I'd move the conversation here from #announcements -- I'd lean toward just removing it as a file at this point but I don't know whether there are still tools out there relying on the files instead of using t.d.a as a library. I think there might also be a little confusion if clojure -Sdescribe stops showing the root deps.edn file but the docs all continue to talk about merging three deps.edn files? Updating the brew-install version to "match" the t.d.a resources' version is the path of least resistance but that redundancy is definitely starting to bother me.

Alex Miller (Clojure team)17:02:26

there are still tools (notably the datomic stuff) that I believe are still pulling the file via -Sdescribe so I'm going to continue letting it drag along for a while

Alex Miller (Clojure team)17:02:39

I have filed prs/issues on projects I'm aware of still using old APIs using this older stuff to get it cleaned up but for now, I'm ok being lazy about cleaning it up


OK, so just update the brew-install deps.edn to avoid confusion? (and to help those legacy tools work "properly")

Alex Miller (Clojure team)17:02:29

I will probably also start just extracting it from tdeps so there is only one thing to update


If I have an alias in a project-level deps.edn file, is there something I can add to my user-level deps.edn to add some dependencies to that alias? (Maybe I have :dev aliases in multiple projects, and I want to add some dev dependencies to all projects.) (If I have a :dev alias in both places, it seems that the user-level one is ignored rather then merged.)

Alex Miller (Clojure team)20:02:55

you can use multiple aliases, so user deps.edn could have shared stuff and project level could have per-project

Alex Miller (Clojure team)20:02:27

then clj -A:common:dev ... or whatever


@alexmiller OK, that makes sense. Thanks. The problem (if that’s what it is) is that maybe I have the :dev alias shared across my team, and maybe shared scripts and/or a shared Emacs .dir-locals file specifying (cider-clojure-cli-aliases . "dev") , so that eg starting a REPL from Emacs does nice things. So it would be nice to be able to piggyback onto the :dev alias in my user-level deps.edn. Maybe I’m just doing it wrong.


Hmmm, I could agree with my team to have a :user-level-dev alias, and our shared scripts etc could refer to that.