graalvm

Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to https://github.com/clj-easy/graal-docs and https://github.com/BrunoBonacci/graalvm-clojure. GraalVM slack: https://www.graalvm.org/slack-invitation/.
katox 2021-03-02T17:21:33.038Z

@borkdude I tried to compile deps.clj locally but I can't find a graal version that is able to actually build it. With 20.1.0 I get Fatal error:java.lang.NoSuchMethodError: 'org.graalvm.compiler.options.OptionDescriptor org.graalvm.compiler.options.OptionDescriptor.create(java.lang.String, org.graalvm.compiler.options.OptionType, java.lang.Class, java.lang.String, java.lang.Class, java.lang.String, org.graalvm.compiler.options.OptionKey, boolean)'. Something familiar?

borkdude 2021-03-02T17:22:53.039Z

@katox huh? deps.clj is a pretty standard project that should work with most any graalvm version. I haven't seen this error before, but fwiw, deps.clj is also used in babashka, so you might be able to check how it's used there

borkdude 2021-03-02T17:23:02.039200Z

Try 21.0.0 btw

borkdude 2021-03-02T17:23:18.039600Z

And perhaps Java 11. This is what I use for most of my projects now

katox 2021-03-02T17:23:28.039800Z

I did, Fatal error:com.oracle.svm.core.util.VMError$HostedError: Option name "HotSpotPostOnExceptions" has multiple definitions: org.graalvm.compiler.hotspot.meta.HotSpotExceptionDispatchPlugin$Options.HotSpotPostOnExceptions and org.graalvm.compiler.hotspot.meta.HotSpotNodePlugin$Options.HotSpotPostOnExceptions

katox 2021-03-02T17:23:40.040Z

it is java11

borkdude 2021-03-02T17:23:43.040200Z

and 21?

borkdude 2021-03-02T17:23:57.040500Z

My wife is calling me, I must go now :/

borkdude 2021-03-02T17:24:02.040800Z

dinner time ;)

katox 2021-03-02T17:24:06.041Z

the multiple deps is graalvm-ce-java11-21.0.0.2

katox 2021-03-02T17:24:18.041300Z

I can build other things just fine

katox 2021-03-02T17:24:39.041600Z

np, enjoy your dinner

borkdude 2021-03-02T18:13:14.042200Z

@katox I'm back. Just for the record. Are you using deps.clj as a library or are you trying to compile the project to native as is?

katox 2021-03-02T18:13:54.042400Z

as is to native

katox 2021-03-02T18:14:07.042700Z

it seems like a some kind of a compatibility error

katox 2021-03-02T18:14:38.043400Z

I can't build the latest babashka either but it fails uberjaring it so I don't really know

katox 2021-03-02T18:14:42.043700Z

$ env BABASHKA_LEAN=true script/uberjar
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06, mixed mode, sharing)
OpenJDK 64-Bit Server VM warning: forcing TieredStopAtLevel to full optimization because JVMCI is enabled
OpenJDK 64-Bit Server VM warning: forcing TieredStopAtLevel to full optimization because JVMCI is enabled
Syntax error (FileNotFoundException) compiling at (babashka/impl/transit.clj:1:1).
Could not locate sci/impl/namespaces__init.class, sci/impl/namespaces.clj or sci/impl/namespaces.cljc on classpath.

Full report at:
/tmp/clojure-9354290185570760188.edn
Error encountered performing task 'do' with profile(s): 'base,system,user,provided,dev,transit,hiccup,test-check,reflection'
Suppressed exit
katox@oryx ~/p/babashka (master)$ cat /tmp/clojure-9354290185570760188.edn
{:clojure.main/message
 "Syntax error (FileNotFoundException) compiling at (babashka/impl/transit.clj:1:1).\nCould not locate sci/impl/namespaces__init.class, sci/impl/namespaces.clj or sci/impl/namespaces.cljc on classpath.\n",

borkdude 2021-03-02T18:15:41.044600Z

@katox As for babashka: you should clone the repo with --recursive so it clones the submodules. Sci is a submodule of babashka

katox 2021-03-02T18:15:48.044800Z

i did

borkdude 2021-03-02T18:16:29.045700Z

As for deps.clj, it's currently based on 20.3.0: https://github.com/borkdude/deps.clj/blob/0b70844983bf23fff4c2991dadb3fd14c4102b27/project.clj#L18 This is a hard dependency but this can be removed when upgrading to 21.0.0

borkdude 2021-03-02T18:16:45.046400Z

A PR to upgrade that project to 21.0.0 is welcome

katox 2021-03-02T18:16:51.046600Z

I also tried that but it failed as well

katox 2021-03-02T18:17:06.047Z

kinda getting errors everywhere .)

borkdude 2021-03-02T18:17:21.047200Z

It builds on CI

borkdude 2021-03-02T18:17:38.047800Z

with 20.3.0 java 11

katox 2021-03-02T18:17:41.047900Z

what's puzzling is that it bb doesnt uberjar in docker build

katox 2021-03-02T18:18:10.048400Z

I have 6 graal versions here, let me try .)

katox 2021-03-02T18:23:20.048700Z

hmm, yes, it seems to build with this one

katox 2021-03-02T18:24:00.049200Z

it doesn't with 20.1 or 21 on my machine

katox 2021-03-02T18:24:06.049400Z

nor 19.x

borkdude 2021-03-02T18:24:48.049800Z

yes, you MUST use 20.3.0 java 11 to compile it. > This is a hard dependency

borkdude 2021-03-02T18:25:00.050100Z

But this will change from 21.0.0 on

katox 2021-03-02T18:25:14.050300Z

my bad, thanks

borkdude 2021-03-02T18:25:23.050500Z

babashka is already on 21.0.0

borkdude 2021-03-02T18:25:31.050800Z

PR to upgrade deps.clj welcome

katox 2021-03-02T18:25:42.051100Z

I'll have a look

borkdude 2021-03-02T18:25:49.051400Z

(mainly the CI config and removal of the reflector fix lib)

katox 2021-03-02T23:08:10.052Z

@borkdude mostly done but I can't guess what's the right gu filepath on mac

borkdude 2021-03-02T23:08:51.052200Z

I'll have a look tomorrow

katox 2021-03-02T23:19:33.052400Z

last try .)

katox 2021-03-02T23:21:55.052700Z

hmm, not /Users/distiller/graalvm-ce-java11-21.0.0.2/Contents/Home/bin/gu: No such file or directory either

katox 2021-03-02T23:22:38.053100Z

nvm, someone with a mac would know

2021-03-04T09:44:10.063100Z

you can use brew install delaguardo/graalvm/graalvm-ce-java11@21.0.0.2 and follow instructions given in Caveats

katox 2021-03-02T23:31:38.053400Z

green, stupid copy-and-paste .)