This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-24
Channels
- # announcements (2)
- # babashka (39)
- # babashka-sci-dev (1)
- # beginners (30)
- # biff (2)
- # cider (9)
- # clj-commons (5)
- # clj-yaml (30)
- # cljdoc (15)
- # clojars (1)
- # clojure (13)
- # clojure-europe (42)
- # clojure-poland (6)
- # clojure-uk (2)
- # cursive (4)
- # datomic (24)
- # graalvm (12)
- # graphql (7)
- # hyperfiddle (91)
- # lsp (175)
- # malli (3)
- # membrane (9)
- # music (1)
- # off-topic (5)
- # reagent (7)
- # reitit (1)
- # releases (7)
- # rewrite-clj (1)
- # scittle (7)
- # shadow-cljs (3)
Maybe you'll advise a better way to do the following.
I'd like to release on Clojars a library that depends on tools.build
. Since it is a git dependency, it won't appear in the POM file or anywhere in the jar and cljdoc analysis will fail ; tools.build
will be missing.
My solution is to wrap the tools.build
functions I need in delay
s with a requiring-resolve
s and deref at runtime. That way, analysis should pass and users can add tools.build
to their project themselves.
However this is certainly cumbersome. Any other alternatives? 🙏
Hiya @UCFG3SDFV! What some folks do is include those deps in their poms but mark them with a scope of provided. Here’s https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#getting-dependencies-right in our docs.
Thanks @UE21H2HHD! But how would that work with a git dependency? :thinking_face:
From a practical p.o.v. you really can't release libraries to Clojars (or Maven) if they rely on git deps -- you have to release them as git deps. There's a lot of tooling that isn't going to work properly, I suspect, and I have to ask: if your users need to add tools.build
as a local git dep anyway to use your library, why not release your library as a git dep (and then it can depend on tools.build
and users won't also need to add that themselves)?
I see no value in releasing such libs to Clojars -- only downsides.
Oh thanks @U04V70XH6 for answering, and sorry @UCFG3SDFV for not noticing your followup!
Also note: cljdoc only currently supports building docs from clojars released libs. We don’t yet have support building from a git hosted projects.
@U04V70XH6 Well the lib is part of a monorepo in construction and as such can't be imported as a git dep. This is because prepping a lib is fully static and cannot take any arguments. Until this is true, I don't think it will be possible consuming only part of a monorepo.
@UCFG3SDFV The poly
tool is part of a monorepo but can be used as a git dep -- see :deps/root
for how to point a git dep into a monorepo.
@U04V70XH6 I asked about that on #tools-deps to get a general answer but maybe you have a more practical experience. What happens when the same polylith repo is consumed twice as a gitlib? By pointing to different :deps/root
?
They are treated as separate deps (since they have separate lib names).
Ah, I see Alex mentioned the transitive deps issue which, yeah, use true for any transitive deps that can conflict and can't be compared.
So my hypothesis was there shouldn't be any problem as long as libs from the same repo are required with the same SHA. At least in a polylith-style repo where libs refer to other local libs via :local/root
.
Do you concur?