clojure-dev

thheller 2022-11-15T18:38:36.853709Z

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

thheller 2022-11-15T18:44:14.680149Z

no, the CLJ version

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

are you aot compiling?

thheller 2022-11-15T18:44:43.097769Z

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

thheller 2022-11-15T18:44:58.245659Z

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?

thheller 2022-11-15T18:52:15.350119Z

lein aot building two variants https://github.com/thheller/shadow-cljs/blob/master/project.clj#L79-L88

thheller 2022-11-15T18:54:55.885479Z

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

thheller 2022-11-15T20:03:31.964879Z

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

👍

thheller 2022-11-17T08:29:44.921199Z

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

thheller 2022-11-17T08:30:09.913879Z

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

thheller 2022-11-17T08:30:22.249119Z

downgraded core.async for now