Fork me on GitHub
#cljdoc
<
2018-11-09
>
borkdude15:11:49

it seems cljdoc has trouble analyzing a namespace: https://circleci.com/gh/martinklepsch/cljdoc-builder/6831

borkdude15:11:55

I’ll try to update the code, see if that helps

borkdude15:11:28

I tried to fix the code, but now it complains about #'clojure.spec.test.alpha/explain-check

4
martinklepsch15:11:44

Thanks for the heads up — seems the error only occurs with ClojureScript analysis and Clojure actually works just fine.

borkdude15:11:13

does it use a clojurescript dependency defined in project.clj or deps.edn?

martinklepsch15:11:37

@U04V15CAJ it used 1.10.339, there's no version of clojurescript specified in the projects dependencies

borkdude15:11:59

right, I was confused there because we use 439 🙂

martinklepsch15:11:14

if you add 439 as a "provided" dependency it will get picked up by cljdoc

borkdude15:11:41

I now added it to the dev profile in project.clj. It was already a :extra-dep in deps.edn. Not sure what cljdoc uses

martinklepsch15:11:02

cljdoc uses the .pom that's uploaded to the Maven repository

martinklepsch15:11:28

[org.clojure/clojurescript "1.10.439" :scope "provided"] add this to your :dependencies in project.clj if you want that version to be used

martinklepsch15:11:17

dependencies with scope "provided" will be ignored during dependency resolution (roughly speaking)

borkdude15:11:48

yeah I know how it works. I didn’t do that yet, because our lib strictly speaking doesn’t require you to provide a version of cljs. it can be used only with clj

borkdude15:11:04

so it’s scope “test”

borkdude15:11:21

it has to work only with clj. making it provided will introduce issues I think, because we won’t be able to test without this dep

borkdude15:11:02

but even then, I don’t think it will fix this issue

borkdude15:11:18

I’ll try locally when I have the time.

martinklepsch16:11:32

I think having CLJS as a "provided" dependency shouldn't cause any issues in this regard but not a maven expert 😄

martinklepsch16:11:28

@U04V15CAJ if you want I can also give it a try myself

borkdude16:11:49

I’m not an expert either, but hey:

provided
This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. 
test
This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. This scope is not transitive.
I think it communicates something, even if the technical effect is the same.

borkdude16:11:50

interesting question though, should clojurescript be provided or test for a .cljc file that can be used with or without cljs

borkdude16:11:01

I’m not sure either. I’ll ask in cljs

martinklepsch16:11:39

Actually test would be fine as well

martinklepsch16:11:53

(from a cljdoc POV)

borkdude16:11:11

test includes provided, so I think it makes sense

martinklepsch16:11:29

but that said things still break with 439

borkdude16:11:39

yeah, I expect this to be an analyzer bug

martinklepsch16:11:39

Unable to resolve var: \instrument-enabled\ in this context at line 93 speculative/test.cljc

borkdude16:11:48

ooh… a different error?

borkdude16:11:57

that’s actually good 🙂

borkdude16:11:06

let me look

martinklepsch16:11:10

I don't see how 😄

borkdude16:11:33

the macro clojure.spec.test.alpha/with-instrument-disabled uses that var. don’t know how the analyzer works, but it seems that it does a macroexpansion

borkdude16:11:07

and then expects the variable used from that macro to be present inside the namespace where the macro is called.

martinklepsch16:11:57

as I mentioned there's been a similar issue with Orchestra, I haven't had time to get to the ground of this but something with spec seems to be breaking the analyzer https://circleci.com/gh/martinklepsch/cljdoc-builder/6786

martinklepsch16:11:30

(might be that the orchestra issue is also/just a versioning problem)

martinklepsch16:11:25

but orchestra also uses 439 it seems

borkdude16:11:49

trying locally

borkdude16:11:07

is it possible to make a small repro for whatever analyzer is running this? (clojure.spec.test.alpha/with-instrument-disabled (+ 1 2 3)) should be able to trigger this

borkdude16:11:29

in a .cljc file + the require

borkdude16:11:42

then we could post it to the proper project to fix it

borkdude16:11:45

maybe it’s a cljs issue

martinklepsch16:11:55

I'll take a stab at creating the repro

borkdude16:11:52

so it’s probably tools.namespace

martinklepsch16:11:33

@U04V15CAJ reproduced it with your minimal snippet

martinklepsch16:11:33

Doesn't happen with 339

borkdude16:11:53

nice, a regression.

borkdude16:11:08

there has been a change in that area, so could very well be one

martinklepsch16:11:19

let me put some instructions in a branch

borkdude18:11:57

so did this conversation in cljs-dev lead to a solution?

martinklepsch18:11:48

I think so but still testing