Fork me on GitHub
#clj-kondo
<
2023-09-07
>
dpsutton18:09:12

anyone ever see this error? > user=> (require ’[clj-kondo.hooks-api :as hooks]) > Syntax error compiling at (clj_kondo/impl/analysis/java.clj:61:6). > Unable to find static field: ASM9 in interface org.objectweb.asm.Opcodes

borkdude18:09:21

what java version are you using? (not sure if it's relevant..)

borkdude18:09:50

perhaps one of your dependencies downgrades ASM

dpsutton18:09:58

it seems we have a conflict on ASM

❯ clj -Sdeps '{:deps {clj-kondo/clj-kondo {:mvn/version "2023.09.07"}}}'
Clojure 1.11.1
user=> (require '[clj-kondo.hooks-api :as hooks])
nil
user=>

dpsutton18:09:08

sorry for the noise 🙂

👍 2
dpsutton18:09:01

if anyone else finds this, it was eastwood on the classpath

jonase/eastwood 1.4.0
  . org.clojars.brenton/google-diff-match-patch 0.1
  . org.ow2.asm/asm-all 5.2
and that asm-all brings in a seriously old version
user=> (io/resource "org/objectweb/asm/Opcodes.class")
#object[java.net.URL
        "0x37e9d2e2"
        "jar:file:/Users/dan/.m2/repository/org/ow2/asm/asm-all/5.2/asm-all-5.2.jar!/org/objectweb/asm/Opcodes.class"]
versus the org.ow2.asm/asm 9.4 :superseded expected by clj-kondo

👍 2
borkdude18:09:50

when using tools, it's usually best to separate their classpaths. deps.edn got this right with -T(ools) usage

borkdude18:09:08

unless you want to invoke them all from the same JVM of course

dpsutton18:09:43

agree. we have a dev alias which has some stuff that we’ve been pretty casual about. i guess the classpath finally shifted around and now it’s finding those bundled 5.2 versions instead of a 9.4 version

dpsutton18:09:22

i think eastwood needs to live on your regular classpath because it runs your tests and requires all of your code. but your point is still valid

borkdude18:09:06

good point about eastwood

seancorfield21:09:48

I run Eastwood as a standalone process via build.clj in HoneySQL https://github.com/seancorfield/honeysql/blob/develop/build.clj -- why do you have it on the dev classpath @U11BV7MTK?

dpsutton21:09:09

that’s a great question. i think because dev became a grab bag of “handy” stuff. Although I’m not sure if there’s a dev related workflow for eastwood. we even have an alias for it for CI. I suspect it was considered “dev” tooling and perhaps someone might want it

dpsutton21:09:57

i need to build a tool to identify all classes on the classpath that are duplicated. because it’s wild that we have asm-all and asm with such different versions. and so the version of that class you get is completely undefined. i guess bumping some versions shifted which came first on the classpath

seancorfield21:09:18

This is why I don't even really like nREPL/CIDER on my dev classpath 😉

dpsutton21:09:31

hasn’t been on mine for years now

dpsutton21:09:59

i thought you were exclusively nrepl these days

seancorfield21:09:35

Yeah. Calva needs it. And CIDER for all things to work.

seancorfield21:09:19

With remote processes, I only have nREPL, no CIDER, and only in a couple of internal-facing apps (they have "everything" so I don't need to connect to any other processes).

dpsutton21:09:39

cider-nrepl shades everything so it shouldn’t be an offender for that reason

seancorfield21:09:29

cider/cider-nrepl 0.37.0
  . nrepl/nrepl 1.0.0
  . mx.cider/logjam 0.1.1
So... not too bad... but it's still a lot of extra code 😐

dpsutton21:09:18

oh yeah. a decent chunk of code. but the classes will be renamed. i’m not familiar with logjam. i haven’t followed development too much recently

seancorfield21:09:18

I don't follow nREPL/CIDER dev at all -- I mostly just pretend it doesn't exist and let Calva add the dependencies at jack-in or pull a "RELEASE" version from an alias 🙂

vemv16:09:09

I hit this issue, but for another reason: mranderson was part of the Lein :plugins. > when using tools, it's usually best to separate their classpaths. deps.edn got this right with -T(ools) usage This. Normally I try for every tool to go under a separate Lein profile e.g.:

:clj-kondo {:plugins [[com.github.clj-kondo/lein-clj-kondo "2023.09.07"]]}