This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-10
Channels
- # announcements (3)
- # babashka (16)
- # beginners (41)
- # biff (4)
- # calva (14)
- # circleci (1)
- # clj-http (24)
- # clj-kondo (9)
- # clj-on-windows (31)
- # cljs-dev (52)
- # clojure (162)
- # clojure-australia (10)
- # clojure-europe (52)
- # clojure-nl (2)
- # clojure-spec (1)
- # clojure-uk (5)
- # clojurescript (40)
- # conjure (6)
- # core-async (3)
- # cursive (5)
- # datalevin (11)
- # datomic (7)
- # emacs (12)
- # etaoin (19)
- # events (1)
- # figwheel-main (17)
- # fulcro (4)
- # graalvm (3)
- # gratitude (13)
- # honeysql (8)
- # introduce-yourself (7)
- # london-clojurians (1)
- # off-topic (9)
- # polylith (9)
- # rdf (1)
- # re-frame (21)
- # releases (5)
- # remote-jobs (4)
- # sci (28)
- # shadow-cljs (15)
- # spacemacs (2)
- # vim (4)
- # xtdb (15)
@alexmiller hrm I'm realizing I looked at the AOT issue probably 4 years ago but gave up - in the assembly I tried to elide the namespaces, but I had commented it out
after fiddling w/ clojure-maven-plugin - I figured out how to elide AOTed classes for the deps
{:clojure.main/message
"Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:382).\nclojure.tools.reader.reader_types.IndexingReader\n",
:clojure.main/triage
{:clojure.error/class java.lang.ClassNotFoundException,
:clojure.error/line 382,
:clojure.error/cause
"clojure.tools.reader.reader_types.IndexingReader",
:clojure.error/symbol java.net.URLClassLoader/findClass,
:clojure.error/source "URLClassLoader.java",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type clojure.lang.ExceptionInfo,
:message "Unexpected error during REPL initialization",
:data {:cljs.repl/error :init-failed},
:at [cljs.repl$repl_STAR_ invokeStatic "repl.cljc" 1218]}
{:type java.lang.NoClassDefFoundError,
:message "clojure/tools/reader/reader_types/IndexingReader",
:at [cljs.repl$repl_STAR_$fn__8140 invoke "repl.cljc" 1038]}
{:type java.lang.ClassNotFoundException,
:message "clojure.tools.reader.reader_types.IndexingReader",
:at
[java.net.URLClassLoader findClass "URLClassLoader.java" 382]}],
:trace
[[java.net.URLClassLoader findClass "URLClassLoader.java" 382]
[java.lang.ClassLoader loadClass "ClassLoader.java" 424]
[sun.misc.Launcher$AppClassLoader loadClass "Launcher.java" 349]
[java.lang.ClassLoader loadClass "ClassLoader.java" 357]
[cljs.repl$repl_STAR_$fn__8140 invoke "repl.cljc" 1038]
[cljs.repl$repl_STAR_$fn__8172 invoke "repl.cljc" 1212]
[cljs.compiler$with_core_cljs invokeStatic "compiler.cljc" 1477]
[cljs.compiler$with_core_cljs invoke "compiler.cljc" 1466]
[cljs.repl$repl_STAR_ invokeStatic "repl.cljc" 1166]
[cljs.repl$repl_STAR_ invoke "repl.cljc" 1033]
[cljs.cli$repl_opt invokeStatic "cli.clj" 325]
[cljs.cli$repl_opt invoke "cli.clj" 312]
this defies my expectation a bit, because line 1038 in repl.cljc is just a function call
so the deftype classes are or are not in the output jar?
so what's in the jar - just clojurescript, but compiled?
AOTed ClojureScript, changing the clojure-maven-plugin settings elides all AOTed fns from data.json, tools.reader, and transit-clj
yeah, this is kind of a rocky area wrt protocols
so it seems like AOTed ClojureScript just cannot get rid of the potential conflict w/o vendorizing tools.reader and causing a different kind of breakage
this is the problem described (and closed) in https://clojure.atlassian.net/browse/CLJ-1544
ok so unless you think different I don't think anything can be done about this problem same as 4 years ago
and what were the difficulties in vendorizing? knobs were exposed up through CLJS with the original names?
because ...
they use those foundations directly in some cases?
I'm trying to be specific enough to push on this, I just don't know this area enough
stuff like this is typical - https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer.cljc#L4784-L4809
so anyone who doing custom analysis, or custom reading stuff and these other entrypoints - they would break
so how big is that surface area? like bindings could be copied if we're talking just a few things like reader/*alias-map*
there are like 4 dynamic vars in tools.reader
(I understand this is all a big pain in the ass)
just trying to understand the scope of the effort
data.json and transit-clj are both single namespace libs so should be relatively easy to vendor
I mean, seems like it would be pretty easy to bind cljs.tools.reader/alias-map to tools.reader/alias-map if it exists
ok looks like vendorzing data.json, transit-clj worked - tools.reader going to be way more annoying
What's the annoying bit? (I have vendorized tools reader in clj-kondo for years now. )
I don't think there is a reason not to AOT once you vendor
I think the "don't want to pull that into AOT" above is re referencing tools.reader/alias-map
for tools reader I used https://github.com/benedekfazekas/mranderson to inline that dependency, it worked reasonably well, perhaps I had to change one or two things manually
I don't fully understand the problem around the dynamic var though, that is probably the real "pain"?
and it's ok to look it up and re-bind, IF it exists (but not if it doesn't)