cljdoc

seancorfield 2023-02-09T17:00:25.824019Z

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?).

hkjels 2023-02-10T21:44:42.799689Z

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

hkjels 2023-02-10T21:46:52.552489Z

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

lread 2023-02-10T21:46:57.731529Z

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

lread 2023-02-10T21:50:32.071469Z

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

lread 2023-02-10T21:51:45.368909Z

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

hkjels 2023-02-10T21:54:59.127999Z

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

hkjels 2023-02-10T21:55:04.881159Z

Reading some docs now 🙂

👍 1
lread 2023-02-09T17:05:39.293719Z

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 ?

seancorfield 2023-02-09T17:08:01.262179Z

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

mkvlr 2023-02-09T17:09:34.881999Z

another solution would we static analysis which we talked about recently

lread 2023-02-09T17:11:35.208929Z

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

Sam Ritchie 2023-02-09T17:12:17.911179Z

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 Ritchie 2023-02-09T17:12:23.035449Z

an internal server error! probably unrelated

lread 2023-02-09T17:13:20.468129Z

Sacre bleu!

lread 2023-02-09T17:14:43.079869Z

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

Sam Ritchie 2023-02-09T17:15:23.155809Z

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 Ritchie 2023-02-09T17:15:29.906389Z

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

Sam Ritchie 2023-02-09T17:16:58.220539Z

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

lread 2023-02-09T17:18:57.584919Z

Lemme take a peek @sritchie09...

🙏 1
lread 2023-02-09T17:34:27.449009Z

@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.

👍 1
Sam Ritchie 2023-02-09T17:38:19.352399Z

No worries!

lread 2023-02-09T23:09:43.809809Z

@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 Ritchie 2023-02-09T23:10:40.785759Z

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

Sam Ritchie 2023-02-09T23:10:56.713659Z

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

lread 2023-02-09T23:11:16.211099Z

Oh, so we have 2 problems maybe!

lread 2023-02-09T23:13:01.623009Z

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

lread 2023-02-09T23:13:25.809079Z

@sritchie09 failing snapshot build đź§µ

lread 2023-02-09T23:14:16.733619Z

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

Sam Ritchie 2023-02-09T23:17:15.637959Z

want me to push another one?

Sam Ritchie 2023-02-09T23:17:38.868009Z

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

Sam Ritchie 2023-02-09T23:17:41.552899Z

so lame (of me)

lread 2023-02-09T23:20:59.857789Z

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

lread 2023-02-09T23:21:28.666189Z

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

lread 2023-02-09T23:22:48.275169Z

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

Sam Ritchie 2023-02-09T23:24:04.381169Z

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

lread 2023-02-09T23:26:15.034829Z

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 Ritchie 2023-02-09T23:26:58.291619Z

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 Ritchie 2023-02-09T23:27:06.336239Z

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

lread 2023-02-09T23:28:10.328029Z

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

❤️ 1
lread 2023-02-09T23:29:28.840459Z

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.

lread 2023-02-09T23:32:55.421929Z

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 Ritchie 2023-02-09T23:33:17.193979Z

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

lread 2023-02-09T23:35:05.765789Z

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 @martinklepsch for creating cljdoc!

lread 2023-02-09T23:35:56.088599Z

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

🎉 1
lread 2023-02-09T23:50:19.080989Z

Here's the isssue: https://github.com/cljdoc/cljdoc/issues/749