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/.
valerauko 2020-06-13T05:36:11.374500Z

is it possible to add reflection config for an interface? i'm playing with netty and while i got it to compile it now throws tons of "missing method" warnings at runtime, all the ChannelInboundHandler interface.

valerauko 2020-06-13T06:42:48.375500Z

hmm

[io.netty/netty-transport-native-epoll "4.1.50.Final" :classifier "linux-x86_64"]
installing that platform-specific binary won't let native-image compile. remove the :classifier and it works

borkdude 2020-06-13T06:50:29.376300Z

@vale yes, I have lots of interfaces in the reflection config for babashka

valerauko 2020-06-13T06:51:15.377Z

gonna check it out for reference. for now i ran the -agentlib=native-image-agent thing and had graal generate the config files

borkdude 2020-06-13T06:52:44.378400Z

That works but only for classes it actually runs during execution. In babashka it is unknown which classes are going to be used by a user

borkdude 2020-06-13T06:53:21.379400Z

I generate the config using a script, the config itself it gitignored

valerauko 2020-06-13T06:53:47.380Z

yeah my goal was to just check if this will build at all (gonna turn it into a library eventually)

valerauko 2020-06-13T06:56:09.380300Z

what script do you use to generate the config?

borkdude 2020-06-13T07:00:28.380800Z

script/reflection

👍 1
kwrooijen 2020-06-13T15:19:01.383Z

Hey, I'm trying to get HikariCP to work with GraalVM, but hitting a wall atm.

(hikari-cp/make-datasource {:jdbc-url "jdbc:<postgresql://localhost:5432/postgres?user=postgres&amp;password=postgres%22|postgresql://localhost:5432/postgres?user=postgres&amp;password=postgres">})
This line, with GraalVM, returns the following error:
Exception in thread "main" com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: null
	at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:576)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562)
	at com.zaxxer.hikari.pool.HikariPool.&lt;init&gt;(HikariPool.java:115)
	at com.zaxxer.hikari.HikariDataSource.&lt;init&gt;(HikariDataSource.java:81)
	at hikari_cp.core$make_datasource.invokeStatic(core.clj:248)
	at myapp.main$_main.invokeStatic(main.clj:65)
	at myapp.main$_main.doInvoke(main.clj:64)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at myapp.main.main(Unknown Source)
Caused by: java.lang.NullPointerException
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
However, when I run it with clj -m myapp.main it works. Anyone have an idea?

borkdude 2020-06-13T15:27:56.383900Z

@kevin.van.rooijen Take a look at the pgmig project, it uses hikari. Could be Postgres a driver problem. You need this flag for postgres: https://github.com/babashka/babashka-sql-pods/blob/5d0f2a2ce8c7b82a8df1a51e8a44411e01c93d4f/script/compile#L60

kwrooijen 2020-06-13T15:28:29.384500Z

haha I was litterally using that as reference, I actually have that flag enabled

kwrooijen 2020-06-13T15:28:43.384700Z

I'll take a deeper look, thanks

kwrooijen 2020-06-13T15:29:21.385400Z

Good to know that Hikari can work, I just need to figure it out

borkdude 2020-06-13T15:29:31.385700Z

Where are you creating the data-source, not top level I hope?

kwrooijen 2020-06-13T15:29:54.386Z

No, I just put it in main for debugging purposes

borkdude 2020-06-13T15:31:59.386200Z

right

borkdude 2020-06-13T15:32:22.386500Z

I think pgmig used a patched version of hikari.

kwrooijen 2020-06-13T15:37:42.386800Z

Yeah looks like it

nate 2020-06-13T22:27:25.387200Z

new project: https://github.com/justone/brisk

nate 2020-06-13T22:27:36.387600Z

many thanks to @borkdude for his help