Closed elliot42 closed 9 years ago
@andrewberls FYI
Mm I dont think I understand everything at play here fully. Why is this affected by 1.7? Is AOT required to specify a main? Does a main here affect a main in including parents?
Yes, AOT is required to specify a main--it works by AOT compiling to a Java .class
. (This is because "main" is serving double duty as the Java public static void main() {}
as well as designating the namespace that Leiningen starts off as.).
The only reason 1.7 is involved, as far as I understand, is that AOTing here pre-determines the versions everything is compiled against--because it's pre-compiling against the versions that resolve against the rules in the overseer
project. If any of those versions are incompatible with versions in the parent application, they can't be changed (I think?) because Overseer has already been pre-compiled against the other versions. If AOT is not on, then the parent resolves all the versions and compiles Overseer against those versions, I think.
It's not that main in a library affects main in the parent application, so much as, AOT in a library affects compilation and dependency in a parent application, I think.
I've confirmed that AOT is breaking dependency/Clojure 1.7 compatibility in our main project. Because AOT is only used to enable
overseer.runner
, which no one currently actually uses yet, this commit disables AOT for this project as a library by default. This unblocks our main project to upgrade to Clojure 1.7.Note that this is specifically to serve the use case of Overseer as a library in something else, which is the primary/only use case for now--but you can still accomplish the goal of AOT compiling
overseer.runner
using a trivial shim or by including the library in your primary project and then designatingrunner
as your main and AOTing your primary project.So, disabling AOT here enables much more flexibility for other applications depending upon Overseer as a library, and one should still be able to get the
runner
functionality if one chooses, so theoretically this shouldn't be much of a tradeoff.