This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-13
Channels
- # announcements (2)
- # beginners (15)
- # calva (6)
- # cider (3)
- # cljsrn (1)
- # clojure (33)
- # clojure-hk (4)
- # clojure-uk (9)
- # clojurescript (13)
- # cursive (5)
- # datomic (6)
- # figwheel-main (1)
- # fulcro (5)
- # graalvm (12)
- # instaparse (1)
- # kaocha (1)
- # nrepl (6)
- # off-topic (5)
- # pedestal (10)
- # quil (8)
- # reitit (2)
- # ring (5)
- # shadow-cljs (10)
- # sql (1)
- # vim (13)
Anyone been successful compiling http-kit into a native executable? I feel like there was a regression since the official release. Been getting errors that I haven't seen before
Note that if I include -H:+TraceClassInitialization
, native-image doesn't complete, and the java instance sits at 100% utilization. I only tried running it for about 10 minutes, so maybe i'll try running it for longer to see if it completes with a trace output
I haven’t tried to build this lately but it used to work https://github.com/taylorwood/lein-native-image/tree/master/examples/http-api simple web server using http-kit
I wonder if there’s anything in your code causing instances of that class to become initialized at compile-time? I think that could be a problem. Have you tried delaying initialization of the class?
@U3DAE8HMG not really sure how to go about delaying the initialization, how would I go about doing that?
it’s an option of native-image
https://github.com/oracle/graal/blob/master/substratevm/CLASS-INITIALIZATION.md
do you have any namespace-level def
s that might be starting up the server during compilation?
Here's the only use of the http-server https://github.com/benzap/eden/blob/master/src/eden/stdlib/http.cljc
I'm wrapping the functions up and running them in a scripting language. This used to work in older versions of GraalVM. From what you're saying, the native-image process is trying to initialize parts of http-kit that are not supported, and I need to tell native-image to 'back off!' Is this correct?
For example, scripts like this used to work, but I had to remove the http component https://github.com/benzap/eden/blob/master/examples/eden/basic_http_server.eden