Closed lread closed 2 years ago
(Thanks to @NoahTheDuke for raising the failure on Slack #cljdoc!)
Thanks for the detailed writeup/investigation! (And thanks to @NoahTheDuke!) Yes, we like to keep the Cljdoc build green, since the only other source of API documentation is the source code itself. I've fixed similar issues with Lambda Island libraries and Cljdoc before—if I remember correctly, it's just a matter of excluding "test" from the main list of source directories and moving it to the appropriate alias (:test
in this case).
Hiya @alysbrooks! It all depends on what decides what goes in the release jar.
Looking at the deps.edn
I agree "test"
should not be in the top level paths, not sure why it ended up in there. There's no reason to bundle tests in the release jar, they blow up the size of the artifact for no apparent benefit.
So I think moving "test"
to the :test
alias is the right thing to do here. Note that we also have a mechanism in our tooling for dealing with optional dependencies, which is mainly there to appease cljdoc. E.g. if you look at cljbox2d its bin/proj
looks like this
#!/usr/bin/env bb
(ns proj (:require [lioss.main :as lioss]))
(lioss/main
{:license :mpl
:inception-year 2021
:description "Clojure/ClojureScript wrapper for the Box2D physics engine"
:group-id "com.lambdaisland"
:aliases-as-scope-provided [:quil4 :clojure2d :testbed]})
Those :aliases-as-scope-provided
are deps.edn
aliases whose :extra-deps
end up in the pom.xml
with <scope>provided</scope>
. This means they won't be transitively installed when depending on this library, but cljdoc will pick them up. Just pointing that out if other cases like this pop up.
You can read the latest documentation here: https://cljdoc.org/d/lambdaisland/deep-diff2/2.3.127/doc/readme.
Issue
Cljdoc analysis is failing for the much loved deep-diff2
(I'm going to assume you care because you have a cljdoc badge on your readme 🙂)
Symptom
Analysis job shows (logs aren't saved forever so I'll paste too):
Diagnosis
If I list the jar contents:
we can see all test sources are included (ex.
deep_diff2_test.cljc
) - most likely not on purpose.When cljdoc tries to analyze the jar, the test libs the test sources depend on aren’t included as deps for the jar therefore they won’t be found and… then analysis fails.
I'm not sure how the release jar is built, but the
pom.xml
currently includes the test dir which might be the causing those test sources to be included.