This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-29
Channels
- # architecture (3)
- # aws-lambda (1)
- # babashka (7)
- # beginners (60)
- # calva (33)
- # chlorine-clover (8)
- # cider (24)
- # circleci (4)
- # clj-kondo (13)
- # cljs-dev (1)
- # cljsrn (12)
- # clojure (76)
- # clojure-australia (6)
- # clojure-europe (100)
- # clojure-france (1)
- # clojure-nl (13)
- # clojure-uk (16)
- # clojurescript (49)
- # conjure (1)
- # cryogen (8)
- # datomic (43)
- # dirac (3)
- # etaoin (1)
- # exercism (4)
- # fulcro (32)
- # jobs (2)
- # kaocha (4)
- # nginx (1)
- # off-topic (106)
- # pathom (8)
- # reagent (5)
- # reitit (5)
- # sci (52)
- # shadow-cljs (37)
- # tools-deps (30)
- # tree-sitter (18)
- # xtdb (18)
working to give an error message to verify that the tools deps version is too old to support -M -m
. Does anyone know offhand if a version supported -X
but not -M -m
? Hoping can check something real quick with -X
and that means it necessarily supports -M
as it stands, added a simple (ns check) (defn -main [& _] (System/exit 0))
but would prefer to not need a new main and new ns if X
and M
go hand in hand
ie, could just do clojure -X clojure.core/identity :a :a
and if that returns 0 then good to go for -M -m our.stuff
@dpsutton I expect this is not what you are looking for, but I write my scripts in Babashka where I find a Clojure version check to be explicit and straightforward: https://github.com/lread/rewrite-cljc-playground/blob/60ad8c118a86221e35692f2ce10281e7cef0f8a4/script/helper/env.clj#L39
@dpsutton https://clojure.org/releases/tools might have the info about -X but not -M -m support... although I believe -X support wasnt added until https://clojure.org/releases/tools#v1.10.1.697 and -M -m was in by then. I use https://clojure.org/releases/tools#v1.10.1.697 as the minimum requirement for Clojure CLI tools with my aliases and content from Practicalli
-M
has been in the CLI for a long time but it's meaning changed around 1.10.1.697
The difference between 1.10.1.561 (stable) and the later version is just that -M
now respects resolve-args and classpath-args in aliases as well as main-opts. Previously, it ignored resolve-args and classpath-args. Does that help @dpsutton?
Yeah that does. I think that means we should use the check for X support to make sure we have a recent enough version
Although I think our use case is simple enough that as long as M support is there it’s fine
@dpsutton I just ran some tests on a bunch of prerelease versions between the last two stable releases, and there are several where that command returns a zero status but doesn't actually work.
(but I believe they would support -M
with aliases by that point... I just haven't tested that 🙂 )
(! 1626)-> /usr/local/Cellar/clojure\@1.10.1.636/1.10.1.636/bin/clojure -X clojure.core/identity :a :a
No alias specified with -X
Thu Oct 29 09:58:15
(sean)-(jobs:0)-(/Developer/workspace/wsmain/build)
(! 1627)-> echo $?
0
The ability to pass the fn to execute on the command-line came fairly late in that set of prerelease builds.
1.10.1.672 seems to be the first prerelease build that allowed it.
Yeah, 1.10.1.561 (previous stable) throws an exception and gives a non-zero exit status.
(so does 1.10.1.590 which was the first of the prerelease builds)
Beautiful. How do you change versions so quickly? Would have done that if I knew a good way to swap them around easily
I installed them by version with brew and then I can use the full path (as shown above) to run any version I want 🙂
how are you doing this?
just brew install @version ?
brew install clojure/tools/[email protected]
per the CLI install docs
clear, thanks a lot!
See https://github.com/clojure/homebrew-tools (which is linked from the CLI install docs on the CLI guides page)
[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 didn't have 561 until just now, but installed it by version to test.