tools-deps

dpsutton 2023-07-05T13:06:07.925129Z

I’m having an issue using a dep from maven. The dep is https://central.sonatype.com/artifact/org.nd4j/nd4j/1.0.0-M2.1 (org.nd4j/nd4j). I can browse to it at https://repo1.maven.org/maven2/org/nd4j/nd4j/1.0.0-M2.1/ . But there are no jars in that folder, just a pom and checksums. Looking at the pom I don’t see it labelled as a bom, but I do see <modules> that makes me think it is using a feature that tools.deps doesn’t support. > ❯ clj -Sdeps ‘{:deps {org.nd4j/nd4j {:mvn/version “1.0.0-M2.1”}}}’ -P > Error building classpath. Could not find artifact org.nd4j:nd4j:jar:1.0.0-M2.1 in central (https://repo1.maven.org/maven2/)

2023-07-05T13:17:00.476509Z

Figure out which modules you need and then add them one-by-one ? This is one of them: https://repo1.maven.org/maven2/org/nd4j/nd4j-tensorflow/1.0.0-M2.1/nd4j-tensorflow-1.0.0-M2.1.pom

dpsutton 2023-07-05T13:18:18.255169Z

ok. so modules are opaque to tools.deps and i can unfurl them manuall?

dpsutton 2023-07-05T13:06:33.097679Z

Is there a way to consume this dependency with tools.deps?

Alex Miller (Clojure team) 2023-07-05T13:27:19.985819Z

pom-only or bom dependencies are not currently supported as top-level deps, this is a wip area (https://clojure.atlassian.net/browse/TDEPS-202)

dpsutton 2023-07-05T13:34:48.605429Z

how can i recognize that this is “pom-only” dependencies? Is it <modules>?

Alex Miller (Clojure team) 2023-07-05T14:04:10.435799Z

<packaging>pom</packaging>

dpsutton 2023-07-05T14:04:28.206739Z

ah. thank you

Alex Miller (Clojure team) 2023-07-05T14:09:54.539989Z

modules is about maven build time, doesn't affect anything on consumption side

🙏 1
cfleming 2023-07-05T01:59:43.790179Z

Is it documented anywhere that tool aliases can use :deps and :paths, and that this will replace the project deps? https://clojure.org/reference/deps_and_cli#_arg_map_keys doesn’t mention it, and I can’t find it explicitly mentioned in the reference, but there’s an example at https://clojure.org/reference/deps_and_cli#_using_tool_aliases. What is the difference between doing this and using :replace-deps?

practicalli-johnny 2023-07-05T08:04:27.772819Z

Personally I find the :deps and :path shortcuts make learning and maintaining Clojure CLI projects more involved. deps and paths do different things depending on if they are at the top level or in an :aliases definition. I encourage use of the explicit names to make it obvious as to what the configuration will do.

cfleming 2023-07-05T08:19:59.081619Z

Sounds very wise to me.

Alex Miller (Clojure team) 2023-07-05T04:07:14.072019Z

No difference, they are aliases

Alex Miller (Clojure team) 2023-07-05T04:07:50.994099Z

Same with paths and replace-paths

cfleming 2023-07-05T04:08:04.286759Z

Ok thanks.

Alex Miller (Clojure team) 2023-07-05T04:10:11.383239Z

Kind of a historical artifact at this point

cfleming 2023-07-05T04:10:39.388449Z

Is one or the other the preferred way going forward?

seancorfield 2023-07-05T04:39:55.548329Z

I'll be interested to hear it there's a preference at this point... The official guide suggests :deps (and paths is rarely needed but I'd expect :paths to be suggested), but I don't remember the history...

cfleming 2023-07-05T05:25:02.706969Z

Does it? The deps and cli ref mostly mentions :replace-deps, and only has :deps in examples. I can’t see anywhere there where it’s even documented that :deps is a thing you can use (although the doc is big and dense, I might have missed it).

seancorfield 2023-07-05T05:30:38.522789Z

The official tools.build guide, I meant, shows :deps.

cfleming 2023-07-05T05:30:44.847909Z

Ah, ok

seancorfield 2023-07-05T05:33:58.857649Z

Yes, the CLI/deps guide/reference talks about :replace-deps and :replace-paths in https://clojure.org/reference/deps_and_cli#_replace_project_environment_tool and https://clojure.org/reference/deps_and_cli#_arg_map_keys but that was about how to get tool-like behavior before -T existed I think? But https://clojure.org/guides/tools_build#_setup talks about -T and :deps and :paths.

cfleming 2023-07-05T05:48:50.562969Z

Well, the deps and cli ref definitely discusses -T, as well as installing tools and running them via aliases. I don’t think it’s a big deal, but the inconsistency makes it more confusing than it needs to be right now.

seancorfield 2023-07-05T06:06:28.428809Z

Sure, but that reference has this example:

:aliases {
   :linter {:deps {cool/lint-tool {:git/tag "..." :git/sha "..."}}
            :ns-default cool.lint.tool}
With :deps, not :replace-deps.

seancorfield 2023-07-05T06:07:21.701459Z

I agree it could be cleaned up. I'm not sure it's "inconsistent" tho'...

cfleming 2023-07-05T06:07:37.784219Z

Yes, I know, I linked that above. But having it appear like that in examples, when there’s no mention in the doc that that is even possible, is confusing.

seancorfield 2023-07-05T06:07:43.859089Z

It omits quite a bit of nuance (but that's nothing new for Clojure docs).

seancorfield 2023-07-05T06:08:07.565459Z

No mention of what in the doc?

cfleming 2023-07-05T06:08:42.181779Z

That you can use :deps in aliases instead of :replace-deps. Under “Arg Map Keys” only the replace- versions are shown.

seancorfield 2023-07-05T06:10:44.125859Z

You're not joining the dots tho'... All of the tool examples use :deps and the narrative around -T says that project :deps / :paths are ignored so you only get :deps and :paths from the alias (or the tool) -- and that if :paths is omitted you get ["."]. That's all consistent.

cfleming 2023-07-05T06:11:33.504029Z

I guess we’ll have to agree to disagree. Anyway, at least I understand what’s going on now.

seancorfield 2023-07-05T06:11:34.382419Z

The :replace-deps / :replace-paths stuff is not inconsistent with that: it says that in any context (`-M`, -X, or -T), those override the other deps/paths.

seancorfield 2023-07-05T06:13:12.028839Z

I'm not sure what we're disagreeing on -- but I'm glad you understand the docs, I think?

cfleming 2023-07-05T06:13:46.909279Z

No, I understand what is going on after Alex clarified it for me above 🙂

👍🏻 1