This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-30
Channels
- # aleph (2)
- # announcements (8)
- # babashka (12)
- # beginners (34)
- # calva (36)
- # cherry (3)
- # cider (1)
- # clj-kondo (11)
- # clj-otel (6)
- # cljdoc (31)
- # clojure (121)
- # clojure-conj (1)
- # clojure-czech (2)
- # clojure-europe (109)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (3)
- # cursive (3)
- # datahike (1)
- # datomic (9)
- # deps-new (6)
- # docker (5)
- # emacs (21)
- # fulcro (4)
- # hoplon (16)
- # introduce-yourself (2)
- # london-clojurians (5)
- # lsp (87)
- # malli (17)
- # missionary (1)
- # nbb (27)
- # off-topic (257)
- # pathom (4)
- # portal (42)
- # practicalli (1)
- # rdf (3)
- # releases (2)
- # shadow-cljs (49)
- # slack-help (3)
- # timbre (2)
Hello! I'm trying to convert some of my libraries to leverage cljdoc, starting with io.aviso/pretty. I'm having an issue related to dependencies -- see https://app.circleci.com/pipelines/github/cljdoc/builder/40995/workflows/a9fd76b1-e669-4044-bd39-cd316da952f5/jobs/57370. At issue is that pretty has a namespace that depends on com.stuartsierra/component but component is an https://github.com/AvisoNovate/pretty/blob/master/deps.edn#LL13C37-L13C37. When I generate documentation with Codox I https://github.com/AvisoNovate/pretty/blob/master/build.clj#L31. Is there some similar option for cljdoc?
Hi @U04VDKC4G! Here's the https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#getting-dependencies-right. If you are still stuck or have questions I'm around to try and help.
I'm banging my head around it; deps.edn
does seem to have an easy way to inject the optional dependencies into the pom.xml.
Did you mean to type "does not seem"? If so, ya, it is awkward with deps.edn
to a add provided
deps. Some approaches can be found in yesterday's thread.
Yeah I have raised as an issue as have the same problem.
I was unclear whether the best fix was to be able to choose an alias (or aliases) for cljdoc, or to inject ‘provided’ deps into my jar during build.
In https://github.com/AvisoNovate/pretty/actions/runs/4567908358/jobs/8062284488 it seems like it can't find pom.xml
; isn't it supposed to find it inside the jar that just got built? Here's my https://github.com/AvisoNovate/pretty/blob/master/.github/workflows/clojure.yml#L47.
@U04VDKC4G, I've not ever tried the cljdoc-check-action. I wonder if there is something amiss with it. I do see https://github.com/cljdoc/cljdoc-check-action/issues/3 asking about one aspect of it. I'll take a peek sometime soon and get back to you.
Hmmm... I'm looking at how https://github.com/cljdoc/cljdoc-analyzer#use-as-a-clojure-cli-tool. It assumes: >
# provided ./pom.xml and ./target/*.jar exist
Which I don't understand yet. Without understanding more I'm with you @U04VDKC4G, why wouldn't it just use the pom in the built jar?
Probably it was developed before clojure tools.build
pom generation was a thing?
@U0522TWDA any memories?Raised an issue: https://github.com/cljdoc/cljdoc-check-action/issues/4
@U04VDKC4G, if @U0522TWDA is too busy to take a peek at this one, I will do so probably tomorrow.
Maybe it came from that use case... but the pre-amble sez "Analyze a deps-based library in the current directory", which I think means a deps.edn
based project. But whatever. Unless someone thinks of why we would-not/should-not use the pom in the jar by default, we'll make it do so soon.
@U04VDKC4G, In the meantime, a CI workaround for you. After you generate your jar you could:
cp target/classes/META-INF/maven/io.aviso/pretty/pom.xml .
But then you'll discover analysis is barfing on src/io/aviso/lein_pretty.clj
, you'll need to add a :no-doc
meta to that ns.I'm holding off on integrating pretty w/ cljdoc. It's funny, pretty is an example in the docs for how to work around a lib that doesn't conform!
And it ain't pretty! Or is it? It is pretty but it ain't pretty. We'll fix things up. Thanks for taking the check action for a spin, I'm not sure how widely it has been adopted and your feedback here will help us to slap it into shape.
I'm excited to get some of my libs into cljdoc; it simplifies my life for sure, and it's a very valuable service. I did try to run some of this locally, but I'm on an M1 Mac so the Docker images were problematic and appears to run very, very slow. Or I just didn't know what was going on.
A good solution for Pretty might be to break it up into three parts: core pretty, a lein plugin (or just drop that entirely), and an extension lib that has the extra setup for component and tools.logging.
Yeah, the current local preview story for cljdoc mimics production but is certainly not local-friendly.
Hello! Sorry I did not see the issues, I will try to set up notification in GH for that. To your question, I do not remember anything 😅 (one of the reasons I blog a lot). I will have a look at the code. But it should work for a deps.edn - based library because that is what it was built for and tested with.
@UE21H2HHD I believe it boils down to the fact that I used existing capabilities in the analyzer, and there was (is?) no support for reading the pom file from the jar. This https://github.com/cljdoc/cljdoc-analyzer/blob/f10878e83ca85f758faf21ee5555524394edbac7/src/cljdoc_analyzer/runner.clj#L174 is where cljdoc tries to read the POM. If we want the analyzer to be able to use the pom in the jar, then we could perhaps change the line to st. like
- pom-str (slurp pompath)
+ pom-str (or (slurp pompath) (slurp (str jar-contents-dir "/" pompath))) ; does this break on windows?
WDYT?Oh, I see it is a little more complicated, since the pom in the jar is at META-INF/maven/<group>/<library>/pom.xml
so we’d need to be smarter at finding it…
Yeah, I'm sure glad I take notes @U0522TWDA, because I remember very little too!
I can take a peek at cljdoc-analyzer and see what might be done there to support using the pom from within the jar there. Also, I vaguely remember some use case where the pom was not in the jar. Was it https://github.com/juxt/pack.alpha that supported this style? Ya https://github.com/cljdoc/cljdoc-analyzer/issues/29.