This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-15
Channels
- # announcements (1)
- # beginners (101)
- # boot (13)
- # cider (38)
- # cljdoc (10)
- # cljs-dev (37)
- # cljsrn (6)
- # clojure (74)
- # clojure-dev (8)
- # clojure-europe (3)
- # clojure-italy (36)
- # clojure-losangeles (2)
- # clojure-nl (5)
- # clojure-spec (15)
- # clojure-uk (49)
- # clojuredesign-podcast (2)
- # clojurescript (52)
- # cursive (6)
- # datomic (19)
- # fulcro (35)
- # graalvm (16)
- # graphql (4)
- # kaocha (1)
- # leiningen (26)
- # luminus (3)
- # re-frame (10)
- # reagent (14)
- # ring-swagger (37)
- # rum (2)
- # schema (4)
- # shadow-cljs (148)
- # spacemacs (13)
- # specter (1)
- # sql (46)
- # tools-deps (3)
- # vim (4)
so when i try (aot :all true) i get a failure on an import statement of a .clj file that imports a class that also needs to be aot compiled since boot is trying to compile it before the other namespace. do import’s not get considered in a dependency graph for aot compilation?
No, they don’t. import is for classes, and classes are already compiled. compilation happens as part of loading under require
hmm adding a require of the ns seems to fix it
so the issue i’m attempting around is that i’m extending a class that is used by java code i’m running from clojure. i’d run into inconsistent issues where aoting the class before the clojure runtime is started (either boot or a clojure repl started by boot) gives me an abstractmethoderror for a method defined as abstract by the superclass i’m extending. based on this https://clojure.org/reference/compilation#_runtime it sounds like the var may not be bound when the class is instantiated, but I don’t understand why that would be since the code instantiating the class requires the namespace that is generating said class
i’d say it works maybe 50% of the time, pretty randomly
https://clojure.atlassian.net/browse/CLJ-1544#comment-43558 refers to protocols needing to be aot’d if they exist in an external library, does that mean i need to aot compile the java superclass as well?
That question doesn’t make sense - java classes are always compiled by java, never by Clojure aot
there’s a lot here https://groups.google.com/forum/#!searchin/clojure/aot%7Csort:date/clojure/aejqMwraPk8/UnJhurORBAAJ that i’m not sure i entirely understand…but i have a feeling might contain answers
@alexmiller specifically your comment about anything “downstream” should be AOT’d as well. does that mean that any clojure code calling a class created with gen-class should be AOT’d?
and if so is this possible to do at the repl?
No to the prior question, it means that any aot compiled class should never load a ns in a clj file, only aot compiled code
thanks that makes sense!
But it’s ok from in a clj to require an aot compiled class