Fork me on GitHub
#depstar
<
2021-02-22
>
awb9909:02:49

How does depstar compare to leiningen uberjar?

seancorfield16:02:28

@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.

seancorfield16:02:17

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

awb9916:02:21

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

seancorfield16:02:23

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.

awb9917:02:27

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?

awb9917:02:54

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

seancorfield17:02:20

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

awb9917:02:47

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

awb9917:02:06

What kind of problems could it generate for a library?

seancorfield18:02:11

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.

seancorfield18:02:58

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.