This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-02
Channels
- # announcements (3)
- # aws (2)
- # babashka (60)
- # beginners (21)
- # cljs-dev (35)
- # cljsrn (3)
- # clojure (53)
- # clojure-android (2)
- # clojure-australia (3)
- # clojure-europe (45)
- # clojure-france (4)
- # clojure-nl (4)
- # clojure-uk (6)
- # clojurescript (33)
- # core-typed (1)
- # cursive (13)
- # datomic (6)
- # duct (1)
- # emacs (2)
- # fulcro (10)
- # introduce-yourself (3)
- # jobs (2)
- # jobs-discuss (13)
- # leiningen (1)
- # malli (19)
- # missionary (63)
- # music (1)
- # off-topic (21)
- # pathom (3)
- # polylith (18)
- # practicalli (12)
- # proletarian (1)
- # reagent (40)
- # reitit (23)
- # releases (1)
- # remote-jobs (1)
- # ring (14)
- # ring-swagger (1)
- # shadow-cljs (13)
- # sql (30)
- # testing (27)
- # tools-deps (31)
- # vim (10)
- # xtdb (4)
Just in case anyone wants to know how to run tests using build.clj
(instead of clojure -M:test
or clojure -X:test
as a separate step), I have added an example to next.jdbc
's repo, since it uses a barebones invocation of the Cognitect test-runner
: https://github.com/seancorfield/next-jdbc so you do clojure -T:build run-tests
(this is only really useful if you want a build command that runs your tests as part of a bunch of other stuff -- otherwise you're just spinning up a subprocess for no good reason)
Note: this is not a -X
-style invocation of test-runner
(even though clojure -X:test
is how I normally run tests in that project)!
I'm getting this error when my deps.edn includes `
techascent/tech.ml {:mvn/version "6.001"}
I've tried deleting my entire .m2/repository directory but the error reoccurs.
Any idea what's going on?@markaddleman try adding -Sthreads 1
to your CLI invocation.
FWIW, clojure -Sdeps '{:deps {techascent/tech.ml {:mvn/version "6.001"}}}'
works fine for me so there's no inherent problem with that lib.
Thanks. I'm getting a new error now:
Error building classpath. Could not transfer artifact args4j:args4j:jar:2.0.26 from/to central ( ): status code: 416, reason phrase: Range Not Satisfiable (416)
I think I've made progressI'm also on very spotty wi-fi so I
So I'll try again when I get home
Ah, spotty wifi. Yeah, definitely -Sthreads 1
. And you may need to delete your ~/.m2/repository
and start fresh to avoid corrupted files.
Yes, thanks
-Sthreads 1
did the trick. Thanks!
is it possible to specify BOM dependencies via deps.edn
? ex:
@jeffrey.wayne.evans No, not currently. You have to specify all the components of the BOM explicitly instead. I suspect this would get a lot of upvotes if it was posted on http://ask.clojure.org
https://ask.clojure.org/index.php/10892/add-support-for-bom-bill-of-materials-dependencies
Suppose you have a few aliases "alias1, alias2, etc" and a main entry point "foo", how would you invoke this? I would think clojure -A:alias1:alias2 -M foo
? Or do you just clojure -M:alias1:alias2:foo
? Is there a difference, or one to be preferred over another?
I would use the second format.
do you have a reason for that? just preference, unambiguous merging of main opts, etc?
I pretty much only use -A
now if I'm starting a REPL or have a very specific use case where -A
is the right approach, e.g., clojure -A:deps -Tnew help/doc
I see. This is for a coworker that needs an nrepl main so it kinda feels the same as that to me: clojure -A:dev -M:nrepl
kinda feels the same
I've always used just one flag and a concatenated list of aliases...
I think it's just personal preference. I find a single flag option "clearer" in that you immediately see "I run a -main
" or "I run exec function" (or "I start a REPL") -- -M
or -X
(or -A
).
yeah. i guess i like the other version for precisely that reason clojure -A:classpath-additions -M entrypoint
The docs seem to encourage my style:
clojure [clj-opt*] -X[aliases] [a/fn] [kpath v]* kv-map?
clojure [clj-opt*] -M[aliases] [main-opts]
that's a good point. I guess i was thinking of when the changeover happens such that -A
will no longer allow main options to "win".
Also, where it describes how various options (in deps.edn
) are provided, it says "should be provided as an alias in one of the deps sources and provided to the Clojure tools using -A (for REPL invocation), -X (for function execution), or -M (for clojure.main execution)." which reads to me as "you use either -A
or -X
or -M
" (even though you can provide -A
and either -X
or -M
).
@dpsutton RE tooling, I'm not sure what cider's opts are atm, but I have been thinking about switching my setup over to taking a list of aliases which are passed to -A
as you can't combine -M
or -X
with the nrepl start code anyway. The downside to that is how main-opts concatenate, so I can have an alias containing :main-opts ["-i", "init.clj"]
to inject some startup code, but I suppose -M:user:provided:aliases
is just as valid so it's probably OK.
cider used to use just trailing main args with -M -m nrepl/cmdline host port
but if there were any profiles in the provided aliases those would actually dominate. so now it uses inline -Sdeps {:cider/nrepl {:main-args ..}}
and then adds the profile cider/nrepl
as the last profile so it wins under any strategy