Fork me on GitHub
#tools-deps
<
2021-04-21
>
dvingo12:04:02

When I execute the following in a shell:

clojure -Sdeps '{:deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}}' -m antq.core
I see this warning:
WARNING: When invoking clojure.main, use -M
Is there a way to remove this warning? or is there a problem with the above invocation?

delaguardo12:04:58

add -M in the front of -m -M -m antq.core

delaguardo12:04:14

or call antq.core/-main directly using -X -X antq.core/-main

borkdude12:04:28

-X is not intended to be used with -main functions since the arg parsing is processed differently

dvingo12:04:11

thanks @U04V4KLKC

clojure -Sdeps '{:deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}}' -M -m antq.core
this worked

seancorfield15:04:22

@U04V4KLKC Just to follow on from Michiel’s point and perhaps clarify for @U051V5LLP: -X invokes a function passing a single hash map as an argument but -main expects a sequence of zero or more strings. As long as -main doesn’t do anything with its & args, you can get away with calling it via -X but that’s an accident of implementation rather than an intended usage.

thanks2 3
zalky15:04:07

Hi all, I was hoping to use node foreman launch a couple of simultaneous clojure processes in development, but it seems there's some concurrency issues when working with a project with remote git coordinates. If two clojure processes try to clone/checkout the same git coordinate concurrently, they run into problems. The workaround is to resolve concurrency by manually launching processes, giving one process a chance to locally clone git first. My question is: is this a reasonable expectation of the clojure deps tooling? Or might this be considered an issue?

Alex Miller (Clojure team)15:04:21

are you using the latest version of clojure?

Alex Miller (Clojure team)15:04:19

prior to 1.10.3.814, we were using jgit. as of 1.10.3.814, we're shelling out to git, so these are completely different tool sets with different behaviors. when shelling out to git, you're really asking, can git support multiple concurrent clones/checkouts and the answer is generally yes due to how git uses lock files

zalky15:04:29

I'm using Clojure CLI version 1.10.3.822

Alex Miller (Clojure team)15:04:43

ok, so my follow up would be more precisely you are seeing the issue - is it in git clone of the repo or getting the working tree (it actually doesn't use git checkout, but rather git worktree)

Alex Miller (Clojure team)15:04:03

and also what git --version you're on

zalky15:04:25

git version 2.20.1 (Apple Git-117)

Alex Miller (Clojure team)15:04:33

you can set GITLIBS_DEBUG=true to see all the commands being run

Alex Miller (Clojure team)15:04:47

if that helps narrow it down

Alex Miller (Clojure team)15:04:08

when you see "problems", what does that look like?

zalky15:04:54

Thanks @alexmiller, I believe I've seen more than one related error message, sometimes related to a git lock file, other times a error: cannot lock ref

zalky15:04:18

Other times a files already exists message

Alex Miller (Clojure team)15:04:30

would love to see those. might be something I can detect/retry or otherwise work with

zalky15:04:13

Ok, I can try to reproduce a number of those messages with the GITLIBS_DEBUG set, is this place to follow up or would you prefer somewhere else?

Alex Miller (Clojure team)15:04:28

https://ask.clojure.org is probably the best to file that

👍 3