Hi all. Just getting started with this project. I thought I would try to diagnose and fix a build failure. Looking at: https://circleci.com/gh/cljdoc/builder/2587
I have no idea how to begin to diagnose it. I read https://github.com/cljdoc/cljdoc/blob/master/doc/fixing-builds.md but I can't really figure out how to troubleshoot from that article.
Is diagnosing and fixing a build too advanced of a task for a cljdoc noob?
Hi Lance, that page admittedly could use some work. Let's work through that build together and maybe we can update the docs afterwards
@lkcampbell This might be useful in re-running the analysis locally https://github.com/cljdoc/cljdoc/blob/master/doc/running-cljdoc-locally.md
./script/cljdoc ingest -p loco -v 0.3.1
This reproduces the issue that is breaking the CircleCI job:
clojure.lang.PersistentList$EmptyList cannot be cast to clojure.lang.Symbol, compiling:(loco/problem.clj:3:1)
Now in the loco
git repo there's no problem.clj
so we'll need to figure out where that file is coming from to actually look at the problematic code
So there's problem.clj
in the jar with the following contents:
(ns loco.problem)
(defrecord LocoProblem
[variable-domains constraints optimize]
())
"x in [1,5]
y in [1,5]
z in {1,3,9}
(= (+ x y) 10)
(= (nth [x y z] 3) 50)
It seems that this might have been included during packaging but was never committed to Git. In this case there are two options:
1. We get the maintainer to cut a new release without the problematic file.
2. We hardcode a thing that will delete loco/problem.clj
from the jar before analysis.Or make cljdoc more โacceptingโ just skipping over the namespaces it couldnโt parse?
More generally this would also be solved by https://github.com/cljdoc/cljdoc/issues/228 (making the analysis fail more granularly, i.e. at the namespace level)
Yes, that's a good idea. I have set up a local server and it is working great. i have not yet rerun the analysis locally so I will try that.
Agreed. This is where I got stuck. I couldn't find problem.clj.
To clarify, when you say "in the jar", where is that jar being created? Is it an artifact produced by rerunning the analysis locally?
the jar is downloaded from Clojars and then serves as the basis for the analysis
You can see something like this:
ERROR Analysis with local AnalysisService failed
STDOUT -----------------------------------------------------
{:project "loco",
:version "0.3.1",
:jarpath "<https://repo.clojars.org/loco/loco/0.3.1/loco-0.3.1.jar>",
:pompath "<https://repo.clojars.org/loco/loco/0.3.1/loco-0.3.1.pom>",
:repos
{"clojars" {:url "<https://repo.clojars.org/>"},
"central" {:url "<http://central.maven.org/maven2/>"}}}
After an initial run local jars (from ~/.m2/repository
) may be used where you can also inspect them
jar tf some.jar
and unzip
are your friends here
ERROR Analysis with local AnalysisService failed
STDOUT -----------------------------------------------------
{:project "loco",
:version "0.3.1",
:jarpath "/Users/martinklepsch/.m2/repository/loco/loco/0.3.1/loco-0.3.1.jar",
:pompath "/Users/martinklepsch/.m2/repository/loco/loco/0.3.1/loco-0.3.1.pom",
:repos
{"clojars" {:url "<https://repo.clojars.org/>"},
"central" {:url "<http://central.maven.org/maven2/>"}}}
โ๏ธ second runthen
jar tf /Users/martinklepsch/.m2/repository/loco/loco/0.3.1/loco-0.3.1.jar
lists the contentsand you can even use emacs to browse jars and open files inside them
Okay, thanks I will play around with this and see if I can recreate the troubleshooting experience you describe for myself
๐ let me know if something is confusing
probably everything is a little confusing though hahahah ๐
good luck ๐
cljdoc is so great โค๏ธ
I just generated https://cljdoc.org/d/org.clojure/core.memoize/0.7.1/api/clojure.core.memoize rather than have to read docstrings on GH.
@marc-omorain thanks for the kind words โค๏ธ ๐
actually pretty decent docstrings as well ๐
And it works great on mobile!
โ which obviously is the most important thing of all! ๐
(I'm always joking about how mobile is something nobody ever asked for but I'm glad to see some people get something out of it ๐)
reading docs on mobile is great when youโre bored on the train or something ๐