boot

:boot-clj: https://boot-clj.github.io/ — build tooling for Clojure. Dev chat in #boot-dev
pleasetrythisathome 2019-08-15T03:17:13.028600Z

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?

alexmiller 2019-08-15T12:06:34.037500Z

No, they don’t. import is for classes, and classes are already compiled. compilation happens as part of loading under require

pleasetrythisathome 2019-08-15T04:10:23.028900Z

hmm adding a require of the ns seems to fix it

pleasetrythisathome 2019-08-15T04:14:03.032Z

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

pleasetrythisathome 2019-08-15T04:14:17.032400Z

i’d say it works maybe 50% of the time, pretty randomly

pleasetrythisathome 2019-08-15T04:15:50.033300Z

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?

alexmiller 2019-08-15T12:08:32.038900Z

That question doesn’t make sense - java classes are always compiled by java, never by Clojure aot

pleasetrythisathome 2019-08-15T04:18:38.033900Z

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

pleasetrythisathome 2019-08-15T04:20:16.035200Z

@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?

pleasetrythisathome 2019-08-15T04:49:52.035500Z

and if so is this possible to do at the repl?

alexmiller 2019-08-15T12:10:22.040700Z

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

pleasetrythisathome 2019-08-17T01:44:43.050Z

thanks that makes sense!

alexmiller 2019-08-15T12:11:00.041500Z

But it’s ok from in a clj to require an aot compiled class