This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-30
Channels
- # admin-announcements (1)
- # announcements (1)
- # babashka (8)
- # bristol-clojurians (1)
- # calva (36)
- # clojure (115)
- # clojure-europe (5)
- # clojure-italy (4)
- # clojure-nl (3)
- # clojure-norway (3)
- # clojure-uk (161)
- # clojuredesign-podcast (3)
- # clojurescript (71)
- # core-async (34)
- # cursive (26)
- # datomic (43)
- # docker (2)
- # emacs (24)
- # figwheel-main (1)
- # fulcro (36)
- # graalvm (7)
- # immutant (2)
- # jackdaw (1)
- # jobs (2)
- # leiningen (8)
- # luminus (5)
- # off-topic (29)
- # onyx (1)
- # other-languages (5)
- # pathom (6)
- # pedestal (3)
- # reagent (11)
- # ring (8)
- # shadow-cljs (42)
- # spacemacs (17)
- # specter (6)
- # tools-deps (80)
- # videos (1)
i have some issues suddenly downloading the expectations/clojure-test
dependency:
% clj -Aexpect
Downloading: expectation/clojure-test/1.2.1/clojure-test-1.2.1.pom from
Downloading: expectation/clojure-test/1.2.1/clojure-test-1.2.1.jar from
Error building classpath. Could not find artifact expectation:clojure-test:jar:1.2.1 in central ( )
my project's deps.edn
explicitly specify these repos:
:mvn/repos
{"clojars" {:url " "}
"central" {:url
" "
#_" "}
"" {:url ""}
"datomic-cloud" {:url ""}}
im not sure how to debug the situation;; - see https://github.com/clojure-expectations/expectations ;; - and https://github.com/clojure-expectations/clojure-test ;; - run your expectations: clj -A:test:expect:test-runner (using cognitect test runner)
:expect
{:extra-deps {expectations {:mvn/version "RELEASE"}
expectations/clojure-test {:mvn/version "RELEASE"}}}
Its from a collection of common deps I keep here https://github.com/practicalli/deps-edn-examples/blob/master/deps.edn
My blog has more up-to-date info about deps.edn and the Clojure CLI, I havent moved that to the book yet https://practicalli.github.io/blog/archives/ See July and August articles
The #tools-deps channel is also useful for deps.edn issues
You can also send me a direct message if you need help and cant find where to get help
my ~/.clojure/deps.edn
also contains one repo:
:mvn/repos {
"datomic-cloud" {:url ""}
}
how are this per-user and per-project :mvn/repos
are getting merged?Just that - they are merged, project merged over user merged over built in
i tried to copy out the deps specification from a remote, terminal based emacs, running in an iterm2, but it has mouse support, so i could only yank it into the remote emacs' kill ring... that's why i retyped it locally... incorrectly...
im battling with emacs for months now, slowly learning more and more about it but i still end up falling back to cursive to get things done... im really wondering if there is some easy way to get into clojure development with emacs or everyone goes through these serious birthing pains? i found https://practicalli.github.io/clojure/ recently which seems promising
@onetom This is a bit off topic for this channel, but feel free to continue about learning clojure in #beginners
graph view..? I think that I may have missed something, but scrolling back I can't find it... 😞
try it with --size too
Sadly --size
doesn’t work with gitlibs based monorepo dep that uses :deps/root
specified deps.edn
which references a sibling monorepo folder dep via :local/root "../aws"
. Quite the contrived example. Here’s the obfuscated stacktrace:
/Users/kszabo/.gitlibs/libs/monorepo/aws/8badc505955040c6a8780bfab4e0484ca4c69a45/aws is not a relative path
java.lang.IllegalArgumentException: /Users/kszabo/.gitlibs/libs/monorepo/aws/8badc505955040c6a8780bfab4e0484ca4c69a45/aws is not a relative path
at $as_relative_path.invokeStatic(io.clj:414)
at $file.invokeStatic(io.clj:426)
at $file.invoke(io.clj:418)
at clojure.tools.deps.alpha.extensions.git$eval1027$fn__1029.invoke(git.clj:43)
at clojure.lang.MultiFn.invoke(MultiFn.java:239)
at clojure.tools.deps.graph$get_size.invokeStatic(graph.clj:95)
at clojure.tools.deps.graph$get_size.invoke(graph.clj:93)
at clojure.tools.deps.graph$make_dep_node.invokeStatic(graph.clj:107)
at clojure.tools.deps.graph$make_dep_node.invoke(graph.clj:99)
at clojure.tools.deps.graph$make_graph$fn__1522.invoke(graph.clj:125)
If I have a main that takes arguments that look like clojure
's (e.g. pack) and I run like so:
clojure -A:pack -- -A:for-pack-pls
Then both the --
and the -A:for-pack-pls
are passed to pack, but I'd only expect the -A:for-pack-pls
to be passed.Oh, looks like it's because --
is an unknown flag to the cli, so it just passes it along... It would be handy if it actually followed the --
convention itself.
Could also be built into https://github.com/borkdude/deps.clj/
is that a question for me re tools.deps or for pack?
sorry, I don't understand what's being requesteed
what is the --
convention?
so is this really a clojure.main request?
@alexmiller for you.
diff --git a/src/main/resources/clojure b/src/main/resources/clojure
index 851d1a6..c6170a3 100755
--- a/src/main/resources/clojure
+++ b/src/main/resources/clojure
@@ -55,6 +55,10 @@ do
help=true
shift
;;
+ --)
+ shift
+ break
+ ;;
*)
break
;;
Code is easier to describe, here's the change I'm proposing ^just restating to make sure I'm getting it...
clojure
takes command lines of the form clojure [dep-opt*] [init-opt*] [main-opt] [arg*]
and makes java command lines of the form java [java-opt*] -cp classpath clojure.main [init-opt*] [main-opt] [arg*]
and the --
introduces a separator between [dep-opt*] and the rest?
not clear to me how that patch does that, but I get the intent now
*)
delegates to init-opt by catching unrecognized arguments (e.g. -e
) and passing them on. --
works similarly, but it does a shift
before break
in order to remove the --
before continuing.
ok, I got it
seems ok to me if you want to make a ticket/patch
haha, I have a silly way to prove that it works.
❯ echo '(println "HELLO")' > -A:kafka
❯ clojure -- -A:kafka
HELLO
also need to handle: windows script, help text, and man file
This is the one I think: https://github.com/clojure/brew-install/blob/1.10.1/src/main/resources/ClojureTools.psm1
that is the correct branch
btw dominic, Powershell also works on Linux and Mac nowadays, if you want to test some snippets
the change is probably pretty obvious
even then it's nice to test, unless you're not making obvious mistakes all the time like I do 😛
the man file is in doc/clojure.1
also, you should make a corresponding PR on https://github.com/clojure/clojure-site with a doc update to content/reference/deps_and_cli
another test to check is that there isn't an issue with the built-in clojure.main support for -
arg
I think it's fine, but would be good to check it
@alexmiller Just to check, happy with "Stop parsing arguments, and pass remaining arguments to clojure.main" as the doc?
I've gone ahead with that string, can easily swap it out if you'd prefer something else 🙂
I don't know, whatever. I'll update after I apply and look at it
aws-vault
uses this pattern (a tool for acquiring temporary credentials in AWS, and then running a command with those creds as env vars)
aws-vault exec profile-name --flag-for-aws-vault -- some-command --flag-for-command
tools.cli
supports that too since it's a GNU convention https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
"The argument ‘--’ terminates all options; any following arguments are treated as non-option arguments, even if they begin with a hyphen." (to save folks reading it)
@seancorfield I looked for that on the tools.cli README earlier because of this conversation but Cmd+f on --
didn't get me anything
@borkdude Yeah, the README doesn't mention it -- it just links to the GNU doc as the "spec" of the behavior.