Fork me on GitHub
#cljdoc
<
2023-02-09
>
seancorfield17:02:25

Has any more thought been given to situations where a library needs a dependency to be present for analysis but does not "depend" on that to be used? @sritchie09 just raised the issue of provided scope deps since you can't generate a pom.xml with tools.build that includes scope on deps. This has cropped up with several libraries in the past (including build-related stuff for cljs libs, I believe?).

lread17:02:39

Yeah, it does crop up as an issue from time to time. I typically have an anemic pom.xml in my projects that use tools.build. I suppose tools.build would wipe out an existing provided dep in a pom.xml when applying deps to an anemic pom.xml ?

seancorfield17:02:01

Right, that's the issue: if you generate pom.xml using write-pom, it replaces <dependencies> with the default computed basis from deps.edn.

mkvlr17:02:34

another solution would we static analysis which we talked about recently

lread17:02:35

I see, thanks @U04V70XH6. Hmm... The only other config we currently have is doc/cljdoc.edn . I suppose we could maybe add something in there. Yeah @U5H74UNSF, static analysis would fix many many (many) failing cljdoc builds.

Sam Ritchie17:02:17

I’ve added a provided dep and I’m trying to test it out with a snapshot build… I get https://cljdoc.org/builds/65960

Sam Ritchie17:02:23

an internal server error! probably unrelated

lread17:02:20

Sacre bleu!

lread17:02:43

Since you are here @sritchie09 you'd probably still need dynamic analysis if your API is generated from import-vars type techniques.

Sam Ritchie17:02:23

that’s not the case for this library, here I am shipping a mafs.sci namespace: https://github.com/mentat-collective/Mafs.cljs/blob/main/src/mafs/sci.cljs that uses sci, but I don’t include SCI as a dependency

Sam Ritchie17:02:29

(since the user can ignore the namespace if they don’t want SCI)

Sam Ritchie17:02:58

@UE21H2HHD is that error an indication of a problem with handling provided dependencies? or unrelated?

lread17:02:57

Lemme take a peek @sritchie09...

🙏 2
lread17:02:27

@sritchie09, I'm not sure but maybe SNAPSHOT build support is currently broken. I can take a deeper look sometime soon. But am currently busy with a rewrite-clj issue.

👍 2
lread23:02:43

@sritchie09 for your snapshot release, in your https://repo.clojars.org/org/mentat/mafs.cljs/0.2.2-SNAPSHOT/mafs.cljs-0.2.2-20230209.171052-1.pom you have

<scm>
    <url></url>
    <connection>scm:git:</connection>
    <developerConnection>scm:git:</developerConnection>
    <tag>v0.2.2-SNAPSHOT</tag>
  </scm>
That tag (of course) does not exist in your GitHub repo. Cljdoc is wildly surprised by this (it really should not be so shocked), hence the current 500 error. If I look at https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#snapshot-builds, we suggest the <tag> be set to the corresponding t commit sha for snapshot builds. I'm noticing yours is not the only lib to slap a snapshot version in <tag> for snapshot builds.... perhaps cljdoc could be more forgiving here. Or... at the very least provide a better error message.

Sam Ritchie23:02:40

Sorry, it did exist when I ran the command, I deleted it afterward, after our conversation, I should have mentioned

Sam Ritchie23:02:56

Before I added that tag, the import in the first step failed

lread23:02:16

Oh, so we have 2 problems maybe!

lread23:02:01

I'm going to start a new thread to avoid spamming the (perhaps) uninterested.

hkjels21:02:42

I guess this is the issue I'm also bumping into then https://cljdoc.org/d/net.clojars.simtech/reagent-flow/v11.5.5

hkjels21:02:52

I haven't worked throught the docs yet though, so it might just be that I'm missing something

lread21:02:57

Maybe @U0B1SDL67, I see No such namespace: reactflow . Is that a dep you don't include in your artifact?

lread21:02:32

Huh, I don't see any sources on the github repo: https://github.com/dnv-opensource/reagent-flow, is that the right repo?

lread21:02:45

Anyhoo, please do start a new thread if you'd like to work out what is going on.

hkjels21:02:59

Yeah. The source is in the http://index.org file. OK. Thanks

hkjels21:02:04

Reading some docs now 🙂

👍 2
lread23:02:25

@sritchie09 failing snapshot build 🧵

lread23:02:16

Continuing from https://clojurians.slack.com/archives/C8V0BQ0M6/p1675962025824019 this thread... but focused on Sam's failing snapshot build only

Sam Ritchie23:02:15

want me to push another one?

Sam Ritchie23:02:38

I pushed 0.2.1-SNAPSHOT after I forgot the tag, which is why I went to 0.2.2-SNAPSHOT…

Sam Ritchie23:02:41

so lame (of me)

lread23:02:59

Nah, not unless you want to... I don't think SNAPSHOT builds are typically git tagged...

lread23:02:28

If I fudge the pom scm tag to be a429c31ae2585fa89a62d16823893dd97b07c267 the docs build fine locally for me.

lread23:02:48

... for org.mentat/mafs.cljs version 0.2.2-SNAPSHOT.

Sam Ritchie23:02:04

oh, that’s a good idea — would you recommend always tagging via sha, vs an actual tag?

lread23:02:15

You could, but I think I'd only use the sha for snapshot builds. But you could. I think that might be the way lein works when it generates jars (I'd have to double check on that).

Sam Ritchie23:02:58

the snapshot for me was really just a test that the provided dep would work, this isn’t a blocker for me at all

Sam Ritchie23:02:06

(and thank you for checking that the build worked!!)

lread23:02:10

Yeah but your experiments are discovering lotsa stuff to help us improve cljdoc, so please keep on sharing!

❤️ 2
lread23:02:28

Some folks put HEAD in <tag> for snapshot builds, I'm not a big fan of that because it means old snapshot builds will point to the latest git sources.

lread23:02:55

I was thinking... that maybe a default fallback might help for snapshot builds. If the <tag> is not found fall back to HEAD. But we'd probably want to share that the tag was not found somewhere. Sometimes being helpful and magic is not really helpful at all.

Sam Ritchie23:02:17

I love my cljdoc since it’s the most stable place / best looking place to link to for var docs from my source code and clerk docs

lread23:02:05

Well glad you like it! We have a rag-tag team of maintainers, and it looks like I'm the current active one. But send a big ❤️ to @U050TNB9F for creating cljdoc!

lread23:02:56

In any case I'm going to open an issue to improve error messaging here. We should not barf with a 500 error.

🎉 2