Fork me on GitHub
#clojars
<
2022-12-07
>
lread19:12:56

So I've gotten access to the cljdoc server logs and sifting through exceptions. I'm noticing a small weirdness with clojars and artifacts with an exact version of SNAPSHOT. TL;DR Clojars is classifying artifacts with an exact version of SNAPSHOT as snapshot builds but, I think, they are not technically snapshot builds. Tools that access these artifacts don't agree with the classification and therefore don't find them. This is in no way a big problem, if I search clojars feed.clj I only see 10 artifacts that have an exact SNAPSHOT version. I can find a way to work around this for cljdoc. I just thought it might be interesting. Can raise an issue on clojars if you like. Here are the https://github.com/cljdoc/cljdoc/issues/716.

Alex Miller (Clojure team)19:12:02

I think they are technically SNAPSHOT builds

Alex Miller (Clojure team)19:12:27

if I understand Maven version parsing correctly, they should be treated as 0.0.0-SNAPSHOT

Alex Miller (Clojure team)19:12:20

but it doesn't see like that artifact/version exists in the repo (I do see a DEVELOP version)

lread22:12:49

Thanks Alex! > I think they are technically SNAPSHOT builds Oh, that would be good to know. Maven docs I read state that a -SNAPSHOT suffix should be used. But that was a https://maven.apache.org/guides/getting-started/index.html#What_is_a_SNAPSHOT_version, not a spec. Could be there is confusion with the various parseq libs... Clojars description page: https://clojars.org/com.gitlab.vise890/parseq/versions/SNAPSHOT Clojars repo: https://repo.clojars.org/com/gitlab/vise890/parseq/SNAPSHOT/ When I try to fetch:

$ clojure -Sdeps '{:deps {com.gitlab.vise890/parseq {:mvn/version "SNAPSHOT"}}}' 
Error building classpath. Could not find artifact com.gitlab.vise890:parseq:jar:SNAPSHOT in central ()
Oh maybe I need 0.0.0-SNAPSHOT?
❯ clojure -Sdeps '{:deps {com.gitlab.vise890/parseq {:mvn/version "0.0.0-SNAPSHOT"}}}'
Error building classpath. Could not find artifact com.gitlab.vise890:parseq:jar:0.0.0-SNAPSHOT in central ()
I'll dig around a bit for more info on SNAPSHOT version.

Alex Miller (Clojure team)22:12:25

that last link is typical I think of a snapshots (which is really a virtual version backed by timestamped versions), but I tested some stuff at lower levels in the api and afaict, the Maven apis can't see that, probably due to the version weirdness somehow

lread22:12:24

Thanks! My interpretation was that SNAPSHOT on its own does not signify a snapshot build, that clients see it that way, but clojars does not, hence a mismatch. But I'll dig around and learn more.

Alex Miller (Clojure team)22:12:47

Maven stuff is vague enough (and has rewritten impls enough) that I find it hard to deduce what is "right", and easy to believe different pieces of code would interpret this as either a textual version (which is allowed) or as a snapshot version with numbers omitted

lread22:12:36

Oh poo (but thanks, good to know!).

lread22:12:36

Since neither lein nor clojure tools deps seem to resolve artifacts with a SNAPSHOT version, maybe I'll just have cljdoc skip these artifacts.

tcrawley12:12:32

This is interesting. The sample project is stored as a snapshot (with timestamped versions) because whatever client deployed it decided it is a snapshot (the deploying client is responsible for creating the timestamped versions). But Clojars doesn't consider it a timestamp based on the version (the check in the code for snapshot is (.endsWith version "-SNAPSHOT")). But it doesn't matter what the Clojars code thinks it is when you are trying to pull it from the repo; the repo structure for the release is based on whatever the deploying client gave us.

lread14:12:14

Oh that clarifies tons @U06SGCEHJ, thanks! It is the deploying client that decides how the artifact is structured in the repo. So clojars is not doing any "classifying" as I earlier claimed/guessed.

lread15:12:06

So a deploying client can technically deploy an artifact that tools will not be able to retrieve.