This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-29
Channels
- # announcements (1)
- # babashka (83)
- # beginners (67)
- # chlorine-clover (22)
- # cider (11)
- # circleci (6)
- # clj-kondo (12)
- # cljs-dev (137)
- # cljsrn (15)
- # clojure (124)
- # clojure-europe (40)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-serbia (3)
- # clojure-spec (19)
- # clojure-uk (14)
- # clojuredesign-podcast (5)
- # clojurescript (80)
- # conjure (49)
- # core-async (62)
- # cursive (18)
- # datascript (1)
- # datomic (64)
- # docker (28)
- # emacs (20)
- # figwheel-main (249)
- # fulcro (95)
- # graalvm (2)
- # jobs-discuss (11)
- # joker (2)
- # juxt (4)
- # lambdaisland (9)
- # leiningen (1)
- # meander (14)
- # mount (6)
- # off-topic (16)
- # pathom (46)
- # re-frame (35)
- # reagent (6)
- # reitit (5)
- # shadow-cljs (28)
- # spacemacs (6)
- # sql (18)
- # tools-deps (26)
- # vim (8)
- # xtdb (23)
- # yada (1)
Guten Morgen!
Anybody here knowing about graalvm and native image generation?
I recently played with it for Funnel (https://github.com/lambdaisland/funnel) @ordnungswidrig. What do you want to know?
https://github.com/plexus/clj.native-image -> fork of clj.native-image with some improved cli arg handling
I'm trying to native compile a project using Crux and netty give a lot of headache. Also analysis take >15min easily
I've enabled direct linking in the uberjar build. But I'm missing the tools and knowledge to check what's actually going on.
@plexus I'm going to try clj.native-image I've tried cambada and manually invoking native-image so far.
it's really just a wrapper around invoking native-image directly, not sure it'll make a huge difference. You still need to specify a lot of the flags that get passed down
I use these
"--initialize-at-build-time"
"--no-fallback"
"--enable-https"
"--allow-incomplete-classpath"
"-H:Name=funnel"
"-H:Log=registerResource"
"-H:ResourceConfigurationFiles=resource-config.json"
but yeah I can't imagine doing this on an established project, I basically just had this running in a loop so that I could immediately see if something broke the compilation
analysis takes a few minutes for me too, and that's on a tiny project, so not too suprised about the 15mins
also anecdote I started with graal 19, worked fine, upgraded to 20 and compilation would fail. I have not yet gotten to the bottom of it, just went back to 19
Oh, that might explain why I remember have fewer problems before.
@ordnungswidrig My 2 cts: I do not recommend using wrappers, just write a shell script. Wrappers just limit what you can do, sooner or later it's going to be a blocker. I use leiningen for creating uberjars. Then I pass those to native-image with the -jar argument. Also use direct linking, warn-on-reflection etc. A lot of the problems I've had with GraalVM native-image are documented here: https://github.com/lread/clj-graal-docs
Makes sense…
I've upgraded babashka, which is by far the most involved GraalVM project I've had so far, to 20.1.0 java 11 recently.
How can I (set! warn-on-reflection true)`` for every namespace with clj? With leiningen I
lein check
but clj tooling is new to me.
I usually just put this at the top of the namespace. Just to make it tooling independent.
I’ve got many namespaces 😛
You can also run the project every so often with leiningen, there you can set it using :globals {*warn-on-reflection* true}
good point.
For java 11 there is an issue with clojure lang Reflector, which is described in clj-graal-docs. I've also got a library which you can include which fixes this automatically
here's a blog on how to enable direct linking and how it can help compilation times: https://epiccastle.io/blog/faster-graalvm-clojure-compilation-times/
I had read that article and it was helpful.
Looking for the lib now
@borkdude using emacs macros is always the right decision 😄