You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build an AOT'd uberjar using the Duct Leiningen template. I can use the template to build an uberjar, but it doesn't look like Duct modules and components are AOT compiled.
$ lein new duct foobar +api +cljs +postgres +site
$ lein uberjar
$ tar xzf target/foobar-0.1.0-SNAPSHOT-standalone.jar -C target/
$ ls target/duct/database/*target/duct/database/sql.cljtarget/duct/database/sql:hikaricp.clj
If I add an explicit :require for duct.database.sql.hikaricp in the foobar.mainns form, then the duct.database.sql and duct.database.sql.hikaricp namespaces are AOT compiled in the uberjar.
I'm guessing that this is happening because the Clojure compiler isn't able to tell at AOT compile time that those modules are needed.
This also causes issues when compiling with native-image, as the SubstrateVM compiler can't tell (without extra config) that some namespaces are going to be required at runtime based on info in the config.edn file.
A workaround is to add explicit requires on all namespaces which are dynamically required by Duct or add them manually in the project.clj, but this loses some of the benefits of Duct. Is there another way to get all of a Duct application automatically AOT compiled?
The text was updated successfully, but these errors were encountered:
I'm trying to build an AOT'd uberjar using the Duct Leiningen template. I can use the template to build an uberjar, but it doesn't look like Duct modules and components are AOT compiled.
If I add an explicit
:require
forduct.database.sql.hikaricp
in thefoobar.main
ns
form, then theduct.database.sql
andduct.database.sql.hikaricp
namespaces are AOT compiled in the uberjar.I'm guessing that this is happening because the Clojure compiler isn't able to tell at AOT compile time that those modules are needed.
This also causes issues when compiling with
native-image
, as the SubstrateVM compiler can't tell (without extra config) that some namespaces are going to be required at runtime based on info in theconfig.edn
file.A workaround is to add explicit requires on all namespaces which are dynamically required by Duct or add them manually in the
project.clj
, but this loses some of the benefits of Duct. Is there another way to get all of a Duct application automatically AOT compiled?The text was updated successfully, but these errors were encountered: