tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
Eugen 2020-12-24T08:35:37.070900Z

hi is there a way that I can access (read) the merged deps.edn from the code I am calling ?

:my-alias-target {:extra-deps {....}
                    :main-opts ["-e" "function/class call that can use deps.edn contents"]}

borkdude 2020-12-24T08:53:01.071200Z

@eugen.stan Maybe looking at the clojure.basis will help

borkdude 2020-12-24T08:53:39.071400Z

(slurp (System/getProperty "clojure.basis"))

👀 1
Eugen 2020-12-24T10:32:19.071800Z

thanks @borkdude, it's exactly what I need

2020-12-24T16:35:43.074100Z

I am using Clojure CLI tools version 1.10.1.763, and with both that and a slightly earlier version when attempting a command with a single alias that uses a single :git/url dependency (which has its own :git/url dependencies), I get an error message "Error building classpath. No known relationship between git versions", but no other clue about which dependency is causing that message. Should it give a dependency name in that message? Or perhaps there are some extra command line options I could use to make it show more details?

2020-12-24T16:37:41.075Z

Adding -Sverbose shows me install_dir, config_paths, etc. but no more detail on the final error message, which is the same as above. -Strace does not write any trace.edn file.

2020-12-24T16:38:30.076300Z

I forget the flags, but the dependency tree printing may help

2020-12-24T16:38:37.076600Z

I am fairly sure I have a small enough issue I can track this down -- mainly curious whether the error message can be made more informative.

2020-12-24T16:39:22.077400Z

If you mean -X:deps tree, I tried adding that at the end of my command line, and it downloads a few extra deps, but then gives the same error message with no other output.

2020-12-24T16:42:20.080100Z

It must be in the deps of your single git dep, or you have another version of that git dep in one of the other deps.edn files listed in config_paths

2020-12-24T16:44:11.083400Z

Agreed that my little problem here should be straightforward to track down, since I can count the deps on the fingers of one hand. As I said, I'm mainly asking whether this is expected output, for cases where it isn't so few deps.

2020-12-24T16:45:34.084500Z

I will get this fixed in this project, but in case you want to reproduce, a command line that should do it is, I believe: clj -Srepro -Sdeps '{:deps {cljol/cljol {:git/url "<https://github.com/jafingerhut/cljol>" :sha "36c45f741fc64db248020aeb155f1f0f24f95dd9"}}}'

alexmiller 2020-12-24T17:58:38.085100Z

I don’t think I said that

alexmiller 2020-12-24T17:58:53.085600Z

We are going to add an api for access

alexmiller 2020-12-24T17:59:07.086200Z

The system property would then be part of impl

seancorfield 2020-12-24T18:01:50.086400Z

Ah, sorry, I misunderstood. It sounded like you wanted to get rid of the system property altogether.

seancorfield 2020-12-24T18:03:15.086600Z

I misremembered: @ghadi said "I am 90% sure the clojure.basis property is going away"

ghadi 2020-12-24T18:36:57.087600Z

That’s me hedging that it’s going to be turned into an impl detail

😆 1
alexmiller 2020-12-24T19:12:26.089400Z

What that error means is that the same git lib was found but there is no ancestor relationship between the two shas and thus the “newest” version can’t be determined

2020-12-24T21:08:28.092500Z

Understood. Is there enough info available when that is detected to print which git lib caused the problem? Not a big deal for me on this issue, but I can imagine with larger dep trees that it would help to narrow down the source of the problem

alexmiller 2020-12-24T22:05:06.094100Z

It can be improved if you want to file a ticket