Fork me on GitHub

Hello all, I see the difference btw depstar and, from depstar I see clj non .class generated and from I see the .class references for .clj. To the application, what is the impact of it?


The configuration is

:build {:deps {io.github.clojure/ {:git/tag "v0.7.2" :git/sha "0361dde"}}
          :ns-default build}
:uberjar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.297"}}
            :exec-fn      hf.depstar/uberjar
            :exec-args    {:aot        true
                           :jar        "myjar.jar"
                           :main-class "my-app.core"}}


what is the difference been aot compiled and not?

delaguardo12:12:30 this article covers most of the differences.


so, should I consider build with aot or not?


I nether use aot to package my applications. It usually complicate things. But if you think one of the reasons given in the first section of the article is relevant to you - you can try it out. Problems (if any) should pop up right away

Alex Miller (Clojure team)13:12:00

Clojure code must be compiled to classes to be loaded by the jvm. This is either done on demand at runtime or ahead of time and saved in your uberjar. Doing the latter will make your app load faster as that work is done already


So, I see that it includes both, is that why?

Alex Miller (Clojure team)14:12:50

If both are included, the compiler classes are preferred


@U0YJJPFRA If you use my build-clj wrapper for, it will AOT compile your main namespace and since AOT is transitive, that will generally compile "everything". The build-clj equivalent to what you were doing with depstar would be something like:

(ns build
    (:require [ :as bb]))

(defn uberjar [opts]
    (bb/uber (merge {:main 'my-app.core :uber-file "myjar.jar"} opts)))
Then you'd run clojure -T:build uberjar and you can provide any options you want for the compile and uber steps (and influence the copying steps too).


build-clj is intended to provide sane defaults for the various functions and to simplify your build.clj file -- it's a very thin wrapper 🙂


@U04V70XH6 Thank you, I´ll try it