cljdoc

https://cljdoc.org/ & https://github.com/cljdoc/cljdoc
awb99 2020-06-10T04:54:32.098900Z

@dominicm So you say this issue was fixed in the last 24 hours? I ran the cljdoc generation yesterday when the error happened.

seancorfield 2020-06-10T05:04:02.099200Z

That commit was a month ago.

seancorfield 2020-06-10T05:06:59.099800Z

The problem is that Reagent 0.10.0 doesn't use a string require for React, so cljdoc thinks it's a normal dependency https://github.com/reagent-project/reagent/blob/v0.10.0/src/reagent/core.cljs#L4

seancorfield 2020-06-10T05:07:25.100500Z

If that was (:require ["react" :as react] I think it would work.

seancorfield 2020-06-10T05:07:58.101Z

(at least, as I'm understanding the change that was made in that commit above)

dominicm 2020-06-10T08:21:26.101100Z

@seancorfield No, that commit is to adjust for non-string requires of react.

seancorfield 2020-06-10T08:22:02.101500Z

Ah, OK. So... why is awb99's build failing?

dominicm 2020-06-10T08:23:33.101600Z

No idea. I ran out of time while looking into it.

martinklepsch 2020-06-10T16:54:44.102Z

Hm, that issue is odd indeed.

martinklepsch 2020-06-10T16:55:09.102600Z

Running this in https://github.com/cljdoc/cljdoc-analyzer reproduces the problem

clj -m cljdoc-analyzer.cljdoc-main '{:project "org.pinkgorilla/gorilla-ui", :version "0.1.66", :jarpath "<https://repo.clojars.org/org/pinkgorilla/gorilla-ui/0.1.66/gorilla-ui-0.1.66.jar>", :pompath "<https://repo.clojars.org/org/pinkgorilla/gorilla-ui/0.1.66/gorilla-ui-0.1.66.pom>", :repos {"clojars" {:url "<https://repo.clojars.org/>"}, "central" {:url "<https://repo.maven.apache.org/maven2/>"}}}'

martinklepsch 2020-06-10T16:55:37.103200Z

But as @dominicm pointed out react should be shimmed.

martinklepsch 2020-06-10T16:56:42.104300Z

@hoertlehner would you mind opening an issue in the repo mentioned above so we don’t lose track of this?

martinklepsch 2020-06-10T16:57:12.105Z

@dominicm did you by any chance test this with your deps.cljs fork (which I haven’t had a chance to look at yet unfortunately)

martinklepsch 2020-06-10T16:58:54.105500Z

@seancorfield there’s no open issues related to this after we thought we fixed them all 😄

🙂 1
dominicm 2020-06-10T17:45:00.105700Z

@martinklepsch yeah I did, it didn't fix it unfortunately.

dominicm 2020-06-10T17:45:55.105800Z

I did narrow it down to being the result of analyzing a file which required reagent, but didn't go further than that. react was definitely in the js dependency index though. It might be that it goes elsewhere too, I've been hacking a bit on cljs lately, so this might be a fun one to dig into if I find time/energy.

👍 1
dominicm 2020-06-10T21:12:26.106Z

after much fiddling, I figured out how to use a custom build of clojurescript. I'll slowly hack on this as I find a few minutes in the evening.

dominicm 2020-06-10T21:13:03.106100Z

Somehow our js-dependency-index is being lost, here's the keys we end up with (excluding goog*) ("fake.BaseClass" "proto2.TestAllTypes" "proto2.TestAllTypes.RepeatedGroup" "proto2.TestAllTypes.NestedMessage" "someprotopackage.TestPackageTypes" "fake.ChildClass" "proto2.TestDefaultChild" "proto2.TestAllTypes.NestedEnum" "proto2.TestAllTypes.OptionalGroup" "proto2.TestDefaultParent")

dominicm 2020-06-10T21:34:42.106400Z

The call to analyze-file should be (ana/analyze-file state file nil), by not passing a state, it defaults to a fresh, empty, state.

dominicm 2020-06-10T21:35:06.106500Z

Getting this now:

2020-06-10 22:34:02,728 ERROR cljdoc-analyzer.runner - Spec assertion failed
{:publics ()} - failed: (contains? % :name) in: [:analysis "cljs" 1 0] at: [:analysis 1] spec: :cljdoc.analysis/namespace
might be my hacking though :)

martinklepsch 2020-06-10T21:36:24.106600Z

Noticed a similar error before but couldn’t quite figure out what’s causing it, this was with

clj -m cljdoc-analyzer.cljdoc-main '{:project "exoscale/coax", :version "1.0.0-alpha4", :jarpath "<https://repo.clojars.org/exoscale/coax/1.0.0-alpha4/coax-1.0.0-alpha4.jar>", :pompath "<https://repo.clojars.org/exoscale/coax/1.0.0-alpha4/coax-1.0.0-alpha4.pom>", :repos {"clojars" {:url "<https://repo.clojars.org/>"}, "central" {:url "<https://repo.maven.apache.org/maven2/>"}}}'

martinklepsch 2020-06-10T21:36:36.106800Z

I think there is an open issue for it

martinklepsch 2020-06-10T21:37:24.107Z

I remember reviewing this and remember something like if you use with-state (or whatever its called) you don’t need to explicitly pass it. @fabien.rozar might know more

dominicm 2020-06-10T21:37:32.107200Z

It might be my fault from printlns

dominicm 2020-06-10T21:37:48.107400Z

oh, no, it reads from a file, so probably not that

dominicm 2020-06-10T21:38:47.107600Z

Yeah, real problem.

dominicm 2020-06-10T21:39:33.107800Z

The problem is that ana/analyze-file calls "with-compiler-env" :(

dominicm 2020-06-10T21:43:29.108300Z

Some of the output files are:

{:publics ()}
         {:publics ()}
         {:publics ()}
         {:publics ()}
         {:publics ()}
         {:publics ()}
         {:publics ()}
         {:publics ()}

dominicm 2020-06-10T21:44:09.108500Z

Going to inject the ns-name in and see what happens :)

dominicm 2020-06-10T21:45:52.108700Z

Okay, so… guessing ahead of time that it's related to this: DoneWARNING: JavaScript file found on classpath for library leaflet, but does not contain a corresponding goog.provide declaration: jar:file:/tmp/cljdoc-org.pinkgorilla-gorilla-ui-0.1.6616162605126260294040/downloaded.jar!/leaflet.js WARNING: JavaScript file found on classpath for library leaflet, but does not contain a corresponding goog.provide declaration: jar:file:/tmp/cljdoc-org.pinkgorilla-gorilla-ui-0.1.6616162605126260294040/downloaded.jar!/leaflet.js

dominicm 2020-06-10T21:46:17.108900Z

Woah, what the:

{:publics (), :ns cljs.user.alert9CC2A73} - failed: (contains? % :name) in: [:analysis "cljs" 1 0] at: [:analysis 1] spec: :cljdoc.analysis/namespace
{:publics (), :ns cljs.user.tab87C64B4} - failed: (contains? % :name) in: [:analysis "cljs" 1 1] at: [:analysis 1] spec: :cljdoc.analysis/namespace
{:publics (), :ns cljs.user.modal1423A26} - failed: (contains? % :name) in: [:analysis "cljs" 1 2] at: [:analysis 1] spec: :cljdoc.analysis/namespace
{:publics (), :ns cljs.user.sidebar3B38213} - failed: (contains? % :name) in: [:analysis "cljs" 1 3] at: [:analysis 1] spec: :cljdoc.analysis/namespace
{:publics (), :ns cljs.user.dropdown94C22E7} - failed: (contains? % :name) in: [:analysis "cljs" 1 4] at: [:analysis 1] spec: :cljdoc.analysis/namespace
{:publics (), :ns cljs.user.description_listF24A57B} - failed: (contains? % :name) in: [:analysis "cljs" 1 5] at: [:analysis 1] spec: :cljdoc.analysis/namespace
{:publics (), :ns cljs.user.menu74859A5} - failed: (contains? % :name) in: [:analysis "cljs" 1 6] at: [:analysis 1] spec: :cljdoc.analysis/namespace
{:publics (), :ns cljs.user.badgeB08BC2D} - failed: (contains? % :name) in: [:analysis "cljs" 1 7] at: [:analysis 1] spec: :cljdoc.analysis/namespace

dominicm 2020-06-10T21:50:06.109400Z

this would be why!

dominicm 2020-06-10T21:52:38.109600Z

@martinklepsch to handle the empty file problem, I propose that we just don't return anything at all if we can't find the ns after analysis. How does that sound?

dominicm 2020-06-10T21:53:44.109700Z

> 2020-06-10 22:52:35,214 INFO cljdoc-analyzer.runner - Analysis succeeded. Oh yeah :) Now I can go to bed