This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-03
Channels
- # announcements (8)
- # aws (2)
- # babashka (16)
- # beginners (173)
- # calva (13)
- # cider (4)
- # cljfx (6)
- # cljs-dev (108)
- # clojure (63)
- # clojure-australia (2)
- # clojure-dev (10)
- # clojure-europe (73)
- # clojure-italy (8)
- # clojure-nl (4)
- # clojure-norway (5)
- # clojure-uk (4)
- # clojurescript (49)
- # clojureverse-ops (4)
- # community-development (3)
- # core-async (23)
- # cursive (3)
- # data-science (5)
- # datomic (25)
- # emacs (3)
- # events (1)
- # fulcro (13)
- # helix (5)
- # introduce-yourself (1)
- # lein-figwheel (1)
- # lsp (36)
- # malli (1)
- # meander (2)
- # membrane (4)
- # music (8)
- # nextjournal (51)
- # off-topic (47)
- # other-languages (5)
- # pathom (31)
- # pedestal (5)
- # planck (14)
- # polylith (5)
- # portal (1)
- # re-frame (30)
- # react (2)
- # reagent (24)
- # releases (1)
- # rewrite-clj (18)
- # ring (9)
- # sci (33)
- # shadow-cljs (49)
- # testing (3)
- # tools-build (21)
- # tools-deps (29)
- # vim (19)
- # web-security (1)
- # xtdb (12)
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
1.10.3
so .. if I had actually read the docs, I would have found:
clj -X:deps find-versions :lib clojure.java-time/clojure.java-time
{: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"}
With
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"}
...
@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 {}}
You can also use it to add a tools.build config + file to your repo:
neil add build
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:
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?
clj version is 1.10.3.967, 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(Compiler.java:7652)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:368)
at clojure.lang.RT.maybeLoadResourceScript(RT.java:364)
at clojure.lang.RT.doInit(RT.java:486)
at clojure.lang.RT.init(RT.java:467)
at clojure.main.main(main.java:38)
Caused by: java.io.FileNotFoundException: Could not locate org/httpkit/client__init.class, org/httpkit/client.clj or org/httpkit/client.cljc on classpath.
at clojure.lang.RT.load(RT.java:462)
at clojure.lang.RT.load(RT.java:424)
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(RestFn.java:408)
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(RestFn.java:142)
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(RestFn.java:137)
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(RestFn.java:436)
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(Compiler.java:7181)
at clojure.lang.Compiler.eval(Compiler.java:7170)
at clojure.lang.Compiler.load(Compiler.java:7640)
... 6 more
I switch from clj-http to http-kit to see if that’s a library specific issue, but seem not……
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]"
"--interactive"]}}}
ah, so the difference is in your user.clj being included - there is actually a fix for this in the Clojure CLI released yesterday - 1.10.3.1075
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.
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
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")
I did that
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.)
you can use multiple aliases, so user deps.edn could have shared stuff and project level could have per-project
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.