Fork me on GitHub
#eastwood
<
2023-10-04
>
Bailey Kocin20:10:13

Can I get some help debugging an error that I can only seem to replicate on an M2 OSX machine... not sure how active this channel is!

Bailey Kocin20:10:38

Well I will post it here for now but this stack trace is not helping me. Right after eastwood loads its own configs it goes straight to this...

Unknown error: java.util.concurrent.ExecutionException: clojure.lang.ExceptionInfo: No reader function for tag elts. {:type :reader-exception, :ex-kind :reader-error}
java.util.concurrent.ExecutionException: clojure.lang.ExceptionInfo: No reader function for tag elts. {:type :reader-exception, :ex-kind :reader-error}
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at clojure.core$deref_future.invokeStatic(core.clj:2317)
        at clojure.core$future_call$reify__8544.deref(core.clj:7041)
        at clojure.core$deref.invokeStatic(core.clj:2337)
        at clojure.core$deref.invoke(core.clj:2323)
        at clojure.core$map$fn__5935.invoke(core.clj:2770)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:58)
        at clojure.lang.RT.seq(RT.java:535)
        at clojure.core$seq__5467.invokeStatic(core.clj:139)
        at clojure.core$keep$fn__8649.invoke(core.clj:7398)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:51)
        at clojure.lang.Cons.next(Cons.java:39)
        at clojure.lang.RT.next(RT.java:713)
        at clojure.core$next__5451.invokeStatic(core.clj:64)
        at clojure.core.protocols$fn__8249.invokeStatic(protocols.clj:169)
        at clojure.core.protocols$fn__8249.invoke(protocols.clj:124)
        at clojure.core.protocols$fn__8204$G__8199__8213.invoke(protocols.clj:19)
        at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
        at clojure.core.protocols$fn__8236.invokeStatic(protocols.clj:75)
        at clojure.core.protocols$fn__8236.invoke(protocols.clj:75)
        at clojure.core.protocols$fn__8178$G__8173__8191.invoke(protocols.clj:13)
        at clojure.core$reduce.invokeStatic(core.clj:6886)
        at clojure.core$reduce.invoke(core.clj:6868)
        at eastwood.copieddeps.dep9.clojure.tools.namespace.file$files_and_deps.invokeStatic(file.clj:74)
        at eastwood.copieddeps.dep9.clojure.tools.namespace.file$files_and_deps.invoke(file.clj:63)
        at clojure.lang.Var.invoke(Var.java:388)
        at eastwood.lint$filename_namespace_mismatches$fn__111237.invoke(lint.clj:434)
        at clojure.core$map$fn__5935.invoke(core.clj:2772)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:51)
        at clojure.lang.RT.seq(RT.java:535)
        at clojure.core$seq__5467.invokeStatic(core.clj:139)
        at clojure.core$map$fn__5935.invoke(core.clj:2763)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:51)
        at clojure.lang.RT.seq(RT.java:535)
        at clojure.core$seq__5467.invokeStatic(core.clj:139)
        at clojure.core$apply.invokeStatic(core.clj:662)
        at clojure.core$mapcat.invokeStatic(core.clj:2800)
        at clojure.core$mapcat.doInvoke(core.clj:2800)
        at clojure.lang.RestFn.invoke(RestFn.java:423)
        at eastwood.lint$filename_namespace_mismatches.invokeStatic(lint.clj:435)
        at eastwood.lint$filename_namespace_mismatches.invoke(lint.clj:427)
        at eastwood.lint$nss_in_dirs.invokeStatic(lint.clj:444)
        at eastwood.lint$nss_in_dirs.invoke(lint.clj:438)
        at clojure.lang.AFn.applyToHelper(AFn.java:165)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$memoize$fn__6946.doInvoke(core.clj:6388)
        at clojure.lang.RestFn.invoke(RestFn.java:457)
        at eastwood.lint$effective_namespaces.invokeStatic(lint.clj:541)
        at eastwood.lint$effective_namespaces.invoke(lint.clj:526)
        at eastwood.lint$eastwood$fn__111337.invoke(lint.clj:862)
        at eastwood.lint$with_memoization_bindings_STAR_.invokeStatic(lint.clj:335)
        at eastwood.lint$with_memoization_bindings_STAR_.invoke(lint.clj:322)
        at eastwood.lint$eastwood.invokeStatic(lint.clj:850)
        at eastwood.lint$eastwood.invoke(lint.clj:845)
        at eastwood.lint$eastwood.invokeStatic(lint.clj:847)
        at eastwood.lint$eastwood.invoke(lint.clj:845)
        at eastwood.lint$eastwood_from_cmdline.invokeStatic(lint.clj:886)
        at eastwood.lint$eastwood_from_cmdline.invoke(lint.clj:885)
        at eastwood.lint$_main.invokeStatic(lint.clj:1016)
        at eastwood.lint$_main.doInvoke(lint.clj:1000)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.main$main_opt.invokeStatic(main.clj:514)
        at clojure.main$main_opt.invoke(main.clj:510)
        at clojure.main$main.invokeStatic(main.clj:664)
        at clojure.main$main.doInvoke(main.clj:616)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.main.main(main.java:40)
Caused by: clojure.lang.ExceptionInfo: No reader function for tag elts. {:type :reader-exception, :ex-kind :reader-error}
        at eastwood.copieddeps.dep10.clojure.tools.reader.impl.errors$throw_ex.invokeStatic(errors.clj:34)
        at eastwood.copieddeps.dep10.clojure.tools.reader.impl.errors$throw_ex.doInvoke(errors.clj:24)
        at clojure.lang.RestFn.invoke(RestFn.java:442)
        at eastwood.copieddeps.dep10.clojure.tools.reader.impl.errors$reader_error.invokeStatic(errors.clj:40)
        at eastwood.copieddeps.dep10.clojure.tools.reader.impl.errors$reader_error.doInvoke(errors.clj:36)
        at clojure.lang.RestFn.invoke(RestFn.java:460)
        at eastwood.copieddeps.dep10.clojure.tools.reader.impl.errors$throw_unknown_reader_tag.invokeStatic(errors.clj:205)
        at eastwood.copieddeps.dep10.clojure.tools.reader.impl.errors$throw_unknown_reader_tag.invoke(errors.clj:204)
        at eastwood.copieddeps.dep10.clojure.tools.reader$read_tagged.invokeStatic(reader.clj:871)
        at eastwood.copieddeps.dep10.clojure.tools.reader$read_tagged.invoke(reader.clj:858)
        at eastwood.copieddeps.dep10.clojure.tools.reader$read_dispatch.invokeStatic(reader.clj:73)
        at eastwood.copieddeps.dep10.clojure.tools.reader$read_dispatch.invoke(reader.clj:68)
        at eastwood.copieddeps.dep10.clojure.tools.reader$read_STAR_.invokeStatic(reader.clj:935)
        at eastwood.copieddeps.dep10.clojure.tools.reader$read_STAR_.invoke(reader.clj:917)
        at eastwood.copieddeps.dep10.clojure.tools.reader$read.invokeStatic(reader.clj:988)
        at eastwood.copieddeps.dep10.clojure.tools.reader$read.invoke(reader.clj:961)
        at eastwood.copieddeps.dep9.clojure.tools.namespace.parse$read_ns_decl.invokeStatic(parse.clj:54)
        at eastwood.copieddeps.dep9.clojure.tools.namespace.parse$read_ns_decl.invoke(parse.clj:38)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$memoize$fn__6946.doInvoke(core.clj:6388)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at eastwood.copieddeps.dep9.clojure.tools.namespace.file$read_file_ns_decl.invokeStatic(file.clj:25)        at eastwood.copieddeps.dep9.clojure.tools.namespace.file$read_file_ns_decl.invoke(file.clj:17)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$memoize$fn__6946.doInvoke(core.clj:6388)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at eastwood.copieddeps.dep9.clojure.tools.namespace.file$files_and_deps$fn__108692.invoke(file.clj:66)
        at clojure.core$pmap$fn__8552$fn__8553.invoke(core.clj:7089)
        at clojure.core$binding_conveyor_fn$fn__5823.invoke(core.clj:2047)
        at clojure.lang.AFn.call(AFn.java:18)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1623)

seancorfield20:10:37

Sounds like Eastwood is finding a source file that you don't otherwise use and finding #elts in it?

Bailey Kocin20:10:40

We only use two tagged literals in our namespaces #uuid, #sql/param

Bailey Kocin20:10:57

What is really weird is this runs on every other machine but the M2 one so thats the only difference I can find since no code has changed....

seancorfield20:10:55

Are you running it with Leiningen or clojure?

seancorfield20:10:25

Hmm, I was just wondering if it was picking up some additional files from somewhere on that machine -- since it sounds like environment rather than project files.

seancorfield20:10:39

Do you perhaps have some temporary files in your project tree on this machine and it's reading those? Something created by an editor/IDE perhaps?

vemv20:10:59

I'd check that the data_readers.clj file that defines #elts is on the :paths that are provided to Eastwood

Bailey Kocin20:10:56

Yea we do not use any of those tags directly so must be a third party library?

vemv20:10:57

I see... in your vanilla repl, run this:

(->> (-> (Thread/currentThread)
         (.getContextClassLoader)
         (.getResources "data_readers.clj"))
     (enumeration-seq)
     (distinct)
     (mapv str))
For both the .clj and .cljc extension. It might tell you the transitive dependency that is introducing this reader

Bailey Kocin20:10:43

Oh this is fun! Thanks. I will dig into these files....

Bailey Kocin20:10:31

Turns out this does not work with the eastwood Leiningen plugin either.. we get the same error on the M2 mac so I might have to get someone else on an M2 to try and see if I can increase the sample size!

vemv21:10:01

Turth be told, this doesn't sound like a laptop problem - it's simply related to the classpath. A common pitfall is running Eastwood (or clj-kondo, for that matter) without the :test alias or profile in. Every 3rd-party dep and dirs such as test/, test-resources (if exists) should be passed to Eastwood, which is accomplished by e.g. lein with-profile +test eastwood Depending on the project you may also have to specify :dev for things to pass, although that is not ideal

Bailey Kocin21:10:45

I just find it weird that it works on everyone elses and not their machine, we used the same aliases, we even in fact run eastwood in the same docker containers with the same java versions and clojure tools We use the test alias to include those directories as well

Bailey Kocin21:10:20

Its never been a problem until they switched to an M2 infact its worked for 4 years

Bailey Kocin21:10:23

But I just think something is injecting into the classpath on their machine so I agree with you... Just hard to find what since we have a controlled docker container env for these things

vemv21:10:52

Maybe, ironically, the Docker setup is doing something funny :) Local Docker-less development tends to be quite reproducible - even more so with tools.deps. JVM and Clojure make that very natural. Perhaps give it a try following the Eastwood readme from scratch. git clean -fdx might help. If none of that worked, feel free to continue over a GH issue.

Bailey Kocin21:10:53

I actually just tried a fresh deps.edn project with an eastwood alias and it linted just fine baremetal... Now I am really starting to suspect that something is being added to the classpath without either of us knowing...... So thanks for that tip 🙂

🙌 1
andy.fingerhut01:10:37

I don't know if this information is helpful, but note that Eastwood evaluates all of the code that it lints, just as if you did require on all of the linted namespaces. If there are top-level forms that have side effects, using eastwood will cause those side effects to occur, e.g. creating a socket to some server, starting processes, etc. If you have any top level forms that can somehow add things to the classpath caused by eval'ing top level forms, that would happen while running eastwood on the project.

Bailey Kocin14:10:50

I always appreciate a thorough explanation. Helps me learn more 😄 . Thanks!