Fork me on GitHub
#graalvm
<
2019-10-13
>
benzap16:10:42

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

benzap16:10:41

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

taylor18:10:04

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

👀 4
taylor18:10:54

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?

benzap14:10:38

@U3DAE8HMG not really sure how to go about delaying the initialization, how would I go about doing that?

taylor14:10:35

do you have any namespace-level defs that might be starting up the server during compilation?

benzap15:10:14

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?

benzap15:10:40

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

benzap15:10:51

It's possible I pulled the latest version of http-kit which encompasses changes that don't work with GraalVM