Fork me on GitHub
#cljdoc
<
2023-01-23
>
Sam Ritchie18:01:17

can anyone help me see why I’m getting “We could not find the git repository for your project or link a commit to this release. API docs work regardless of this but consider https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#git-sources.” on https://cljdoc.org/builds/65430, for #sicmutils? obviously something is wrong, since clojars also agrees: https://clojars.org/sicmutils

Sam Ritchie18:01:13

hmm, analysis failed too… looks like cljdoc’s analyzer is taking the clj path in the forked macro: https://github.com/sicmutils/sicmutils/blob/main/src/sicmutils/util/def.cljc#L139

lread19:01:27

Sure @U017QJZ9M7W, I can take a peek!

lread19:01:28

If I look https://repo.clojars.org/sicmutils/sicmutils/0.23.0/sicmutils-0.23.0.pom, I see the following for scm config:

<scm>
    <tag>v0.23.0</tag>
  </scm>
The tag looks good, I see it on the https://github.com/sicmutils/sicmutils/tags, but the other entries are missing from scm , which means cljdoc (and clojars for that matter) won't know where your sources are.

1️⃣ 2
lread19:01:48

Oh right.. 2nd problem API analysis failure... please hold...

2️⃣ 2
lread19:01:59

Ok... Clojure analysis is passing. It is ClojureScript analysis that is failing...

2️⃣ 2
lread19:01:45

Huh, you are attempting import-vars-ish-ness for cljs. At one point, I did have an import-vars version working for cljs. It is buried in the history of rewrite-cljc. But as part of that effort I also updated cljdoc to understand such manipulations for cljs.

2️⃣ 2
lread19:01:17

(personally, I abandoned load time import-vars due to too many oddities, I got fed up and went for code generation instead)

2️⃣ 2
lread19:01:03

@U017QJZ9M7W how do you run our cljs unit tests for sicmutils?

2️⃣ 2
lread19:01:06

I'd like to see stuff in cljs passing/working before taking a deeper peek into what might be happening with cljdoc here.

2️⃣ 2
❤️ 2
lread20:01:15

Back to problem 1, https://github.com/sicmutils/sicmutils/blob/02e7a6edaab345e5c6a516f663ecaeb6507cda26/build.clj#L42. That's fine if you also have a pom.xml that specifies the other scm values, but you don't seem to have that.

1️⃣ 2
Sam Ritchie20:01:18

“Npm run test “ will do it!

👍 2
Sam Ritchie20:01:26

Ohhh @UE21H2HHD nice catch. Locally weirdly the entries from my Pom.xml template were making it in, vs getting bumped by what you found. That would have taken me forever to find, thank you!

lread20:01:17

My pleasure. That's some extensive test suite @U017QJZ9M7W, it is still running...

Sam Ritchie20:01:34

Close to 7300 and counting

Sam Ritchie20:01:58

Lots of generative tests too… it is a little nuts for sure

lread20:01:05

Ah done after 11m!

lread20:01:35

One person's crazy, is another person's thorough! simple_smile

😉 2
lread20:01:36

So... dunno yet about the cljs failure. Can take a peek. One diff is that cljdoc uses the plain old ClojureScript compiler, and your test runs under shadow-cljs.

Sam Ritchie20:01:37

I’m happy to rewrite that macro- I really just want (def something somewhereelse.something) in cljs, nothing fancier

lread20:01:23

Yeah, it seems so simple, I remember. simple_smile

Sam Ritchie20:01:00

Haha I definitely found other trip reports of clojurists dashed against these surprisingly rocky shores, just like us

lread20:01:39

The parenthe-seas can be rough!

😂 2
Sam Ritchie20:01:21

Woah, mind blown

😂 2
Sam Ritchie20:01:01

That’s fine, the APIs are the same so I’ll turn it off for now, fix the scm entry and publish an incremental version

Sam Ritchie20:01:10

Do you want me to file a ticket with the build etc,

lread20:01:27

You can do it in your https://github.com/sicmutils/sicmutils/blob/main/doc/cljdoc.edn, you have to fix that pom anyway, so would get will get picked in next release.

lread20:01:31

I don't know much about how shadow-cljs works but I'm thinking that might be the difference. If I try to run sicmutils under plain old (outside cljdoc) ClojureScript I get a similar error.

Sam Ritchie20:01:34

Okay I can use that info to make a small repro. What command do you use to run it with vanilla cljs?

lread20:01:57

Lemme get back to you on that. I'm just pasting from other projects to explore. Have to knock the rust off my cljs knowledge, it has been a while!

lread20:01:34

Ok, this seems like a maybe a simple way to trigger the issue in sicmutils with plain old ClojureScript: First, I added a :lee-cljs alias to sicmutils deps.edn

:lee-cljs
  {:extra-deps {org.clojure/clojurescript {:mvn/version "1.11.60"}}}
Then I fired up a REPL using this alias:
❯ clj -M:lee-cljs -m cljs.main --repl-env node 
ClojureScript 1.11.60
Then I required the namespace I saw failing on cljdoc to see a similar error:
❯ clj -M:lee-cljs -m cljs.main --repl-env node
ClojureScript 1.11.60
cljs.user=> (require '[pattern.rule :as rule])
Unexpected error (AssertionError) macroexpanding cljs.core/resolve at (def.cljc:140:14).
Assert failed: Argument to resolve must be a quoted symbol
(core/and (seq? quoted-sym) (= (quote quote) (first quoted-sym)))
Very possible I am missing something you are doing via some shadow config...

Sam Ritchie20:01:22

I can make a tiny version of that macro and get a repro up

Sam Ritchie20:01:35

thanks for this, @UE21H2HHD, I should have some time this evening and I’ll see what the cljs folks think

lread21:01:56

Here's me naively trying the same thing under shadow-cljs:

❯ npx shadow-cljs node-repl 
shadow-cljs - config: /home/lee/proj/oss/sicmutils/sicmutils/shadow-cljs.edn
shadow-cljs - starting via "clojure"
shadow-cljs - server version: 2.20.14 running at 
shadow-cljs - nREPL server started on port 32805
cljs.user=> shadow-cljs - #4 ready!
cljs.user=> (require '[pattern.rule :as rule])
nil

lread21:01:31

(no assert fail this time)

lread21:01:03

Lemme know how it goes. If you are really married to roughing the choppy seas with an import-vars type approach, I can dig up my old rewrite-cljc work for you.

lread21:01:40

(my advice: don't do it, but you are the captain of your ship, sir!)

😂 2
Sam Ritchie21:01:58

I have to do it to give folks a namespace that has everything , so they can use it as a replacement for the original scheme library… and MIT scheme has no namespaces at all

lread21:01:02

@U017QJZ9M7W interesting recent https://clojurians.slack.com/archives/CQT1NFF4L/p1674180518666799 about import-vars that might interest you

❤️ 2