This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-23
Channels
- # adventofcode (21)
- # announcements (4)
- # babashka (35)
- # beginners (36)
- # calva (76)
- # cider (16)
- # clj-kondo (24)
- # clj-on-windows (12)
- # clojure (70)
- # clojure-europe (7)
- # clojure-nl (13)
- # clojure-spec (3)
- # clojure-uk (3)
- # clojurescript (34)
- # conjure (11)
- # cursive (22)
- # datomic (30)
- # deps-new (2)
- # emacs (36)
- # fulcro (28)
- # gratitude (4)
- # honeysql (16)
- # hugsql (8)
- # introduce-yourself (6)
- # jobs (1)
- # malli (4)
- # missionary (6)
- # off-topic (129)
- # other-languages (34)
- # polylith (3)
- # reagent (9)
- # reitit (27)
- # releases (13)
- # remote-jobs (1)
- # reveal (1)
- # shadow-cljs (2)
- # tools-build (3)
- # tools-deps (18)
- # web-security (7)
- # xtdb (4)
can you explain what that means?
just collecting all the transitive jars without rebundling them?
if you use create-basis
, it has paths to all the libs in it, you could combine that with copy-file
https://gist.github.com/hiredman/d68cafb6aa8cea563c7b77d54f522421 does something like that. Uses sftp to copy jars and dirs (git deps) to a remote system and generates a premade classpath file, but it was never fully developed and is based on an older tools.deps
(let [target "target/libs"]
(doseq [[lib coord] (-> (b/create-basis nil) :libs)]
(doseq [path (:paths coord)]
(b/copy-file {:src path
:target (str target "/" (.getName (jio/file path)))}))))
something like thatif you care about local/git libs, you'd want to be a little more careful what you copy out of :paths
I'm using https://github.com/seancorfield/build-clj (thanks, @seancorfield!) to create an AOT uberjar. I'm using clojure 1.11.0-alpha3. When I compile the uber jar, I get a couple of reflection warnings and several warnings like WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-keys
. I'm not concerned about any of these warnings. When I run my application using java -jar uber.jar
, I get the same set of warnings as the application starts up. This surprises me. I expect the warnings during AOT compilation but I do not expect them when running as a set of AOT classes. Maybe my understanding of how executing an AOT jar is wrong. Is this behavior expected?
@markaddleman I think there is a new version of tools.analyzer which solves these warnings. they are caused by same-named vars in clojure.core in clojure 1.11
Thanks. I think analyzer is getting pulled in transitively (probably through core.async but I haven't investigated)
But, that's not really my worry. I'm wondering why I'm getting these warnings when executing an AOT jar. I expected that these warnings occur when loading the namespace for compilation but the resulting bytecode would not re-evaluate.
vars in clojure are still dynamically created at load time, even when source has already been AOT-ed
Oh, duh, of course. The warnings are not about the namespace loading per se, they are about creating the vars. Thanks!
that is all correct, and most recent core.async / tools.analyzer.jvm will fix the warnings
https://clojurians.slack.com/archives/C015AL9QYH1/p1640286580108400
(note: version above was supposed to be 1.10.3.1053)