tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
2021-04-21T12:22:02.027Z

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?

2021-04-21T12:23:58.027200Z

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

2021-04-21T12:26:14.027400Z

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

borkdude 2021-04-21T12:32:28.027600Z

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

2021-04-21T12:33:11.027800Z

thanks @delaguardo

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

2021-04-21T15:08:07.036Z

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?

alexmiller 2021-04-21T15:09:21.036300Z

are you using the latest version of clojure?

alexmiller 2021-04-21T15:11:19.037900Z

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

2021-04-21T15:12:29.038600Z

I'm using Clojure CLI version 1.10.3.822

alexmiller 2021-04-21T15:13:43.039500Z

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)

alexmiller 2021-04-21T15:14:03.039800Z

and also what git --version you're on

2021-04-21T15:14:25.040400Z

git version 2.20.1 (Apple Git-117)

alexmiller 2021-04-21T15:14:33.040700Z

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

alexmiller 2021-04-21T15:14:47.040900Z

if that helps narrow it down

seancorfield 2021-04-21T15:15:22.041900Z

@delaguardo Just to follow on from Michiel’s point and perhaps clarify for @danvingo: -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.

1
alexmiller 2021-04-21T15:16:08.043300Z

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

2021-04-21T15:16:54.043500Z

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

2021-04-21T15:17:18.044200Z

Other times a files already exists message

alexmiller 2021-04-21T15:17:30.044500Z

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

2021-04-21T15:18:13.045200Z

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?

alexmiller 2021-04-21T15:36:28.045700Z

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

👍 1
alexmiller 2021-04-21T17:54:43.046300Z

yep, thx