tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
seancorfield 2021-03-05T03:02:30.148600Z

FWIW, I ran into a similar situation later today @alexmiller but I wasn't able to nail down a repro. In the end, I blew away ~/.gitlibs and that fixed it. Here's the output from one of my attempts:

Checking out: <https://github.com/seancorfield/depstar> at ee2badaaf4b26754f903ed92e77fd4e82cf2ed70
Error building classpath. Manifest type not detected when finding deps for com.github.seancorfield/depstar in coordinate {:git/url "<https://github.com/seancorfield/depstar>", :sha "ee2badaaf4b26754f903ed92e77fd4e82cf2ed70"}
And that checked out folder was empty.

seancorfield 2021-03-05T03:03:14.148800Z

And with a different SHA -- same result:

(! 806)-&gt; clojure -X:jar
Checking out: <https://github.com/seancorfield/depstar> at a8cf78c9e09e3504e64fc77bcb133a7ada39a68f
Error building classpath. Manifest type not detected when finding deps for com.github.seancorfield/depstar in coordinate {:git/url "<https://github.com/seancorfield/depstar>", :sha "a8cf78c9e09e3504e64fc77bcb133a7ada39a68f"}

seancorfield 2021-03-05T03:04:34.149Z

The only odd thing is that this line was missing when it failed:

Cloning: <https://github.com/seancorfield/depstar>
but present when it worked.

seancorfield 2021-03-05T04:30:47.149500Z

Just a follow-up note: in the main channel, you indicated that the problem might be due to prior parallel jgit downloads causing corruption but these SHAs were new since I moved to 1.10.2.801 -- are you saying that the jgit impl could have messed things up in the ~/.gitlibs folder such that it causes problems for the new git-sh impl @alexmiller?

2021-03-05T04:57:41.153100Z

Hi, I just upgraded to the latest version. I used to setup my test runner like this

:runner  {:extra-paths ["test"]
                     :extra-deps  {lambdaisland/kaocha {:mvn/version "1.0.641"}}
                     :main-opts   ["-m" "kaocha.runner"]}
this now gives my deprecation warnings
❯ clj -A:test:runner --focus unit
WARNING: When invoking clojure.main, use -M
but after reading the docs I am not sure how to address them

seancorfield 2021-03-05T05:02:50.153600Z

@sofra Use clj -M:test:runner --focus unit

seancorfield 2021-03-05T05:04:30.155400Z

With the introduction of -X for function execution, -M has been expanded from just :main-opts to include deps/paths as well and is how you should run anything relying on clojure.main (`:main-opts`). -A is going to be reserved for starting a REPL in due course (but still functions as before, except with that warning).

2021-03-05T05:07:28.157Z

thanks @seancorfield for the explanation

2021-03-05T05:09:33.158400Z

I had tried with -M instead of -A but it seems to look for the kaocha.runner as a file on the file system then

❯ clj -M:test:runner --focus unit
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
kaocha.runner (No such file or directory)

dpsutton 2021-03-05T05:13:17.159200Z

I think kaocha is looking for a config file?

seancorfield 2021-03-05T05:13:27.159400Z

No.

seancorfield 2021-03-05T05:14:16.160200Z

@sofra I just created a brand new project and put this in it:

:aliases
 {:test {:extra-paths ["test"]
         :extra-deps {org.clojure/test.check {:mvn/version "1.1.0"}}}
  :runner  {:extra-paths ["test"]
                     :extra-deps  {lambdaisland/kaocha {:mvn/version "1.0.641"}}
                     :main-opts   ["-m" "kaocha.runner"]}
 ...}
and it works fine for me:
$ clojure -M:test:runner --focus unit
[(F)]
Randomized with --seed 150177492

FAIL in sofra.example-test/a-test (example_test.clj:7)
FIXME, I fail.
Expected:
  0
Actual:
  -0 +1
1 tests, 1 assertions, 1 failures.

seancorfield 2021-03-05T05:14:37.160600Z

I think perhaps you changed your :main-opts?

seancorfield 2021-03-05T05:16:22.161400Z

That's with the latest prerelease:

$ clojure --version
Clojure CLI version 1.10.2.801
but I can try it with the latest stable version...

2021-03-05T05:17:11.162400Z

hmmm, thanks … my bad, it does seem to work now, not sure what it was

2021-03-05T05:18:01.163100Z

yeah strange, sorry for the noise, it is working 🙂

1
seancorfield 2021-03-05T05:18:52.163800Z

(I just double-checked it works with 1.10.2.790 as well)

2021-03-05T05:18:59.164Z

cool