This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-29
Channels
- # babashka (64)
- # beginners (60)
- # calva (10)
- # circleci (3)
- # clj-kondo (62)
- # cljdoc (6)
- # clojars (2)
- # clojure (152)
- # clojure-europe (19)
- # clojure-nl (3)
- # clojure-uk (18)
- # clojurescript (50)
- # clojureverse-ops (12)
- # core-async (21)
- # cursive (6)
- # data-science (1)
- # datomic (17)
- # events (14)
- # fulcro (64)
- # graalvm (20)
- # graphql (5)
- # honeysql (14)
- # jackdaw (3)
- # jobs (1)
- # jobs-discuss (22)
- # kaocha (2)
- # lsp (9)
- # luminus (8)
- # malli (30)
- # meander (31)
- # other-languages (1)
- # polylith (8)
- # re-frame (15)
- # shadow-cljs (85)
- # specter (2)
- # sql (11)
- # tools-deps (56)
- # vim (39)
- # vscode (7)
- # xtdb (16)
I'm curious to try Clojure CLI https://clojure.org/releases/tools#v1.10.3.933 - is there usually a delay before brew upgrade clojure/tools/clojure
will find it? brew tells me "Warning: clojure/tools/clojure 1.10.3.822 already installed"
I suspect my brew-fu is at fault. Perahps there's some tap specific update needed so brew knows about new releases.
Maybe you just need to run brew update
first @olivergeorge?
Ta. I got there in the end. brew update didn't seem to help but doing a version specific brew install worked (at least clashed with what I had but after fetching the new version).
Yeah, I always do the explicit @version install (and then the brew link
dance)...
brew upgrade clojure/tools/clojure
should work - it's updated there
(! 707)-> ls /usr/local/Cellar/clojure
clojure/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/
[email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/
[email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/
[email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/ [email protected]/
🙂I'm struggling to use -X:deps help/doc
. I think it's my misunderstanding. It's unable to work because my tools are in a namespace that requires namespaces in a library, but -X:deps
replaces the deps instead, so I get "Could not locate clojure/data/csv__init.class, clojure/data/csv.clj or clojure/data/csv.cljc on classpath.".
Shouldn't -X:deps
run as well as my project dependencies to make this work?
can you put your full command line?
@dominicm Yeah, I've only been able to get help/doc
to work in very limited situations because :deps
replaces your project dependencies.
I'll write up a repro on ask...
help/doc is really intended for tool use cases more than project use cases, but happy to consider things more fully
Nothing I saw solved for the project case. Here's my use-case: I have some functions in my project which I routinely want to run for doing things like installing generated data to the db, etc. These functions could be run from the REPL, but they're also good for the CLI too (with a little prn sprinkled in).
I want the full set of project dependencies in there, not just a small subset I can specify using :extra-deps
. https://ask.clojure.org/index.php/10888/help-doc-doesnt-work-with-project-dependencies and TDEPS-201 captures my wants well, and mentions solutions I think would work for me.

Yeah, the alternate root deps.edn
alias version of :deps
that does :extra-deps
instead of :replace-deps
seems like a good compromise. I have occasionally found myself wanting to just add t.d.a to something I'm doing so it would help with that too.
https://ask.clojure.org/index.php/10888/help-doc-doesnt-work-with-project-dependencies
@alexmiller I had it working with a tool before but now I can't figure out what I had to do for that... can you remind me?
Ah, I remembered!
clojure -A:deps -Tnew help/dir
That lists functions in the default namespace of the tool.yeah, you'll either want that or clojure -X:deps:whatever help/dir
OK, so this works:
(! 766)-> cat deps.edn
{:aliases {:csv {:extra-deps {org.clojure/data.csv {:mvn/version "RELEASE"}}}}}
(! 767)-> clojure -X:deps:csv help/doc :ns clojure.data.csv
Reading and writing comma separated values.
...
but without an alias, none of the project's basic :deps
would work and that's "expected" because this is intended for "tools", not projects?I almost feel like there should be some "magic" alias that means "use the project :deps
" 🙂
I will raise an issue against clojure-site to add examples to the reference docs to show the two usages for tools...
https://clojure.org/reference/deps_and_cli#_help_functions - a start
I suspect folks will wonder what -Tnew
is so maybe my-tool
instead?
(although you could use -Tdeps-graph
since that is actually used as an example on that page)
This stuff is hard -- you never know what assumptions folks bring with them to a page of docs like that.
also added a couple more notes and link to the api docs
Congrats about the release, really excited about the new things. Ran into this after upgrading to Clojure CLI version 1.10.3.933
(artifact changed, we encountered this with a private dep):
clj -Srepro -Sdeps '{:deps {org.clojure/data.csv {:git/url "" :sha "aa9b3bdd3a1d3f6a7fe12eaab76b45ef3f197ad5" :tag "main"}}}' ✘ 130
Error building classpath. Library org.clojure/data.csv has invalid tag: main
Fixed by removing the :tag
which previous versions would just ignore. Not sure if it should be considered a breaking change.yes, I'd consider that a bug and it kind of ties in with some issues we have with git-resolve-tags
have you been using git-resolve-tags btw?
not me personally (I’m used to manually looking up the sha on github and pasting it) but I think my colleague who added the dep is using it
the new :git/tag expects only a valid tag (not a branch name like main)
the old :tag with git-resolve-tags would happily resolve that
so there are important differences here. I just tend to assume no one is using that stuff but clearly somebody is
I have an example in my user deps.edn
of using gitlibs/resolve
for turning a branch name into a SHA: https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L177-L180 -- presumably @mkvlr could use that instead of git-resolve-tags
?
ah, and there’s no way to specify a branch and use tools.deps to update the sha from it anymore?
at the moment, not really
I guess being able to set a minimum CLI version would be nice, so we can upgrade to the newer :git/tag
keys
or is there currently anything I’m missing except asking everybody on the team to upgrade when relying on newer tools.deps features?
(though of course the problem will only go away once everybody is on a version that supports requiring a minimum version, so not immediately helpful)
another thought: could :git/ref
be a thing to support in the future for mutable things like branches together with git-resolve-refs
? Also not sure if it would be nice to support :git/tag
without needing a :sha
. I feel like deleting or overwriting a released tag can be similar to force pushing a :sha
out of the repo which can be gone once GC’d. But also see the upside of being explicit…
These sorts of things I think goes against the idea of deps as data, since there's no reproducible way to run your project if it has a mutable dependency. Personally I'd favor having a -T tool which would update your dependencies in your deps edn based on a key like :git/ref
, and then it just updates the sha in the dep with rewrite-clj
Although it'd probably be like :tool-name.git/ref
for the actual key
@suskeyhose to be clear I was talking of a ref as a way to update a sha, so it would still be immutable. And tags I consider it to be best practice for them to not change (but can be forced to be overwritten) so I’m on the fence on that one.
Ah, I see
Then we were suggesting basically the same thing, but as a tool vs as a core part of tools deps I suspect
Well, not quite if your suggestion was to validate that the ref does match that sha
Nothing I saw solved for the project case. Here's my use-case: I have some functions in my project which I routinely want to run for doing things like installing generated data to the db, etc. These functions could be run from the REPL, but they're also good for the CLI too (with a little prn sprinkled in).
I want the full set of project dependencies in there, not just a small subset I can specify using :extra-deps
. https://ask.clojure.org/index.php/10888/help-doc-doesnt-work-with-project-dependencies and TDEPS-201 captures my wants well, and mentions solutions I think would work for me.

we both want to update the sha, which git-resolve-tags used to do that (for both tags and branches, now only for tags). Think we all agree a tool is the way forward
I have an example in my user deps.edn
of using gitlibs/resolve
for turning a branch name into a SHA: https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L177-L180 -- presumably @mkvlr could use that instead of git-resolve-tags
?
yeah, though I’m not sure I’m ever going to change my habit of just copy & pasting the sha from GitHub, comes with the upside of seeing the commit etc 🙈
Now that that deps.edn has some new rules, the linting for it in clj-kondo needs to be updated. Please test your deps.edns and report any false positives, please!
$ clojure -Sdeps '{:deps {clj-kondo/clj-kondo {:git/url "" :sha "05cc5aca58d89215a295799df8e27fa1a9874885"}}}' -M -m clj-kondo.main --lint deps.edn
Checking out: at 05cc5aca58d89215a295799df8e27fa1a9874885
linting took 52ms, errors: 0, warnings: 0
You can report false positives in this issue: https://github.com/clj-kondo/clj-kondo/issues/1318
🙏