Fork me on GitHub
#graalvm
<
2019-08-07
>
benzap20:08:32

Anyone else unable to compile a native image using clojure 1.10? Is this a known issue?

borkdude20:08:39

Depends what you are doing.

benzap20:08:11

Yeah idk, I can't even get clojure 1.9 working. Haven't touched graalvm in a while

benzap20:08:06

@borkdude Does this error look familiar? Any ideas?

benzap20:08:34

I've compiled this native image before using older versions without issues, so i'm not sure what's going on

borkdude20:08:22

> Caused by: java.io.FileNotFoundException: Could not locate clojure/core__init.class or clojure/core.clj on classpath. that bit looks weird. how are you compiling? do you have a link to a project?

borkdude20:08:59

what I do most of the time: compile with leiningen to an uberjar with AOT all and feed this into graalvm

benzap20:08:57

Yeah, I switched up the command, since native-image seems to have new optional arguments

benzap20:08:01

The new build command is this:

benzap20:08:38

I haven't tried compiling a native image for a few versions now, so it's unclear what i'm missing. I should probably comb over some of the changes to see if they affect it, but I haven't added any new dependencies that might conflict. Mostly just version bumps.

borkdude20:08:03

@benzap feel free to compare it to clj-kondo or jet: https://github.com/borkdude/clj-kondo https://github.com/borkdude/jet which are tools I'm using on clojure 1.10.1

borkdude20:08:16

one common pitfall is the locking issue which arises when you require clojure.pprint or clojure.spec.alpha

benzap20:08:59

Is the locking issue in more recent versions of graalvm?

benzap20:08:20

The latest (working) fif version that I compiled into an executable has pprint

benzap20:08:37

I wonder if I should try recompiling it using the latest graalvm to see if there was some sort of a regression

borkdude20:08:20

it used to work on clojure 1.9 but not with clojure 1.10 if I have it correctly.

borkdude20:08:35

it's a reason why I went with fipp in jet

borkdude20:08:07

I have no logical explanation why this locking issue props up when requiring pprint

benzap20:08:36

That is strange, maybe i'll try replacing pprint with fipp and see what happens

borkdude21:08:23

in your trace I didn't see the locking issue, so that may be something entirely different in your case