Clojure AOT compilation will compile unwanted classes
My build file specifies the namespaces to AOT compile but if I include another namespace (even from a JAR dependency) that is not AOT compiled, the other namespace will be compiled as well.
In my case, I was using clojure-contrib's clojure.contrib.str-utils2 namespace, and I got a bunch of clojure/contrib/str_utils2 classes in my output directory.
I think that the AOT compiler should NOT precompile any namespaces that are transitively reached, only namespaces in the set specified by the command line are appropriate.
As currently coded, you will frequently find unwanted third-party dependencies in your output JARs; further, if multiple parties depend on the same JARs, this could cause bloating and duplication in the eventual runtime classpath.
Note: I'm tracking against master for both clojure and clojure-contrib.
In my case, I was using clojure-contrib's clojure.contrib.str-utils2 namespace, and I got a bunch of clojure/contrib/str_utils2 classes in my output directory.
I think that the AOT compiler should NOT precompile any namespaces that are transitively reached, only namespaces in the set specified by the command line are appropriate.
As currently coded, you will frequently find unwanted third-party dependencies in your output JARs; further, if multiple parties depend on the same JARs, this could cause bloating and duplication in the eventual runtime classpath.
Note: I'm tracking against master for both clojure and clojure-contrib.
Leave a comment
on 2010-02-03 17:08 *
By stuartsierra
I don't quite understand this ticket, but clojure-contrib is no longer AOT-compiled by default except for those namespaces that need it.
Note that Clojure generates one class per fn, so one AOT-compiled namespace produces many classes.
Note that Clojure generates one class per fn, so one AOT-compiled namespace produces many classes.
This is a Clojure issue, not a Contrib issue.