Fork me on GitHub

How does depstar compare to leiningen uberjar?


@hoertlehner Not sure how to "compare" them -- If you're using lein, you would use lein uberjar to build an application JAR file; if you're using the CLI and deps.edn, you would use depstar to do it.


I use depstar to build all the library JAR files that I deploy to for my open source projects. I also use it at work to build all the production artifacts we deploy to our servers.


I was thinking perhaps depstar has some additional features compared to lein uberjar


Well, you can't use depstar with lein and project.clj, only with the Clojure CLI and deps.edn -- and I don't really pay much attention to what Leiningen does as I haven't used it for years.


If I would build an uberjar with aot for a LIBRARY .. would this means that functions from that library would load faster in case the app is not an uberjar with aot compilation?


Also would this aot library be dependent on the java version or the cpu architecture?


You should never AOT compile a LIBRARY -- it can cause problems for users.


I understand that. But I have a special usecase. A notebook application that needs to load dependencies dynamically.


What kind of problems could it generate for a library?


It can cause conflicts for users of your library with other dependencies in applications they are building with it because the code may be tied to specific versions of things your library depends on (such as Clojure) -- also AOT compilation is transitive so you end up with more than just your own compiled code in the library.


The general advice is: never AOT compile a library, end users can AOT an application for deployment safely -- and it's the AOT of the application that gets them the startup time improvements.