clojure-dev 2022-11-15

when I bump shadow-cljs to use core.async 1.6.673 I get a weird failure I can't explain. any ideas? https://app.circleci.com/pipelines/github/thheller/shadow-cljs/524/workflows/1545b5a9-c989-433b-89ea-30dbacb1811b/jobs/1204 (full stacktrace available)

Execution error (NoSuchFieldError) at clojure.tools.analyzer.jvm.utils__init/load (REPL:259).
__thunk__0__

Alex Miller (Clojure team) 2022-11-15T18:39:57.788089Z

from 1.5.x?

Alex Miller (Clojure team) 2022-11-15T18:40:43.026709Z

the only change in 1.6 is to dynaload the ioc-macros namespace (which uses the analyzer) in the Clojure version

Alex Miller (Clojure team) 2022-11-15T18:41:38.882239Z

I'm assuming you're using the cljs side though

no, the CLJ version

Alex Miller (Clojure team) 2022-11-15T18:44:33.921759Z

are you aot compiling?

this happens when loading shadow-cljs, which uses core.async. didn't even get to the CLJS compiler yet. from 1.5.648 yes

it is a AOT compiled release yes

Alex Miller (Clojure team) 2022-11-15T18:45:37.290509Z

if aot compiling, then the analyzer will be dynamically loaded (requiring-resolve) during compilation and is not needed at runtime

Alex Miller (Clojure team) 2022-11-15T18:45:57.087339Z

I'm not sure how that translates to your error though

Alex Miller (Clojure team) 2022-11-15T18:47:36.254129Z

maybe has something to do with compilation order?

Alex Miller (Clojure team) 2022-11-15T18:50:48.451209Z

is this lein aot or tools.build or something else?

aot compile works fine though, it just happens when running after

Alex Miller (Clojure team) 2022-11-15T18:56:50.440689Z

this change will definitely affect when/if tools.analyzer is going to be loaded during aot. in the aot'ed classes, can you diff the set of compiled classes from clojure.tools.analyzer. when using core.async 1.5.x vs 1.6.x ? I would consider maybe including one or more of the analyzer entry points in the compiled namespace list at the top

Alex Miller (Clojure team) 2022-11-15T19:02:09.670429Z

or just clojure.core.async.impl.ioc-macros

sorry, got distracted. adding the clojure.core.async.impl.ioc-macros to the :aot list seems to have fixed it

Alex Miller (Clojure team) 2022-11-15T21:14:02.114079Z

👍

it does seem to cause trouble for other people as well, even when fixed in the shadow-cljs part. https://clojurians.slack.com/archives/C6N245JGG/p1668672181550289

I'll see if I can figure out a minimal repro later

downgraded core.async for now