Deploying AOT compiled libraries?

The main problem is that AOT will compile your code and all its dependencies to .class files that cannot be separated from each other. So you cannot just ship your library AOT compiled as it would also contain at least clojure.core. Clojure AOT currently as far as I’m aware can not load .clj files from .class files. So AOT produces the .class files and will fail if one of the dependent classes is missing although the .clj file is present.

This leads to hard to track errors like if you lib includes a different version than may be specified in the projects dependencies as the .clj files will be of that version but only the AOT compiled versions that you shipped will be used.

2 Likes