This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-05
Channels
- # announcements (5)
- # babashka (2)
- # beginners (47)
- # calva (3)
- # cider (42)
- # clerk (5)
- # clj-commons (21)
- # clojure (145)
- # clojure-austin (25)
- # clojure-europe (14)
- # clojure-norway (9)
- # clojure-spec (7)
- # clojurescript (21)
- # datomic (4)
- # dev-tooling (4)
- # docker (5)
- # gratitude (5)
- # honeysql (6)
- # hyperfiddle (45)
- # jobs (1)
- # juxt (2)
- # malli (25)
- # meander (1)
- # mount (3)
- # other-languages (7)
- # pathom (7)
- # pedestal (1)
- # reagent (5)
- # reitit (20)
- # releases (2)
- # remote-jobs (1)
- # shadow-cljs (77)
- # squint (8)
- # tools-deps (34)
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
?
No difference, they are aliases
Same with paths and replace-paths
Kind of a historical artifact at this point
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...
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).
The official tools.build
guide, I meant, shows :deps
.
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
.
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.
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
.I agree it could be cleaned up. I'm not sure it's "inconsistent" tho'...
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.
It omits quite a bit of nuance (but that's nothing new for Clojure docs).
No mention of what in the doc?
That you can use :deps in aliases instead of :replace-deps. Under “Arg Map Keys” only the replace- versions are shown.
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.
I guess we’ll have to agree to disagree. Anyway, at least I understand what’s going on now.
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.
I'm not sure what we're disagreeing on -- but I'm glad you understand the docs, I think?
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.
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/)
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
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)
<packaging>pom</packaging>
modules is about maven build time, doesn't affect anything on consumption side