Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to and GraalVM slack:
borkdude 2021-02-27T14:46:43.023400Z

Slides from babashka talk at GraalVM Workshop 2021

ericdallo 2021-02-27T16:05:32.025Z

I'll doing a POC on clojure-lsp to use datalevin , it worked really well, but having issues compiling the clojure-lsp native-image, should I manually compile the datalevin/native/src libs manually? I thought we could have the libs compiled in the classpath just like

ericdallo 2021-02-28T12:46:19.029900Z

Oh that was fast haha! I'm new too don't worry ;)

ericdallo 2021-02-28T12:46:25.030100Z

Thank you for the quick response

ericdallo 2021-02-28T12:46:56.030300Z

I'll test it with the 0.4.0 as soon you release it, excited for that!

ericdallo 2021-02-28T13:25:41.030500Z

Thanks for the help @huahaiy, with your PR merged I'm getting a

java.lang.IllegalArgumentException: No method in multimethod 'open-kv' for dispatch value: :graal

ericdallo 2021-02-28T13:33:36.030700Z

Does the key-value store lmdb work with graal?

Huahai 2021-02-28T16:11:53.030900Z

you mean when you run the binary?

Huahai 2021-02-28T16:17:38.031100Z

it looks to me that the graal version of the LMDB binding is not compiled in, did you include datalevin’s reflect-config.json?

Huahai 2021-02-28T16:24:07.031300Z

ldd ./clojure-lsp (0x00007ffcc5ff9000) => /usr/lib/x86_64-linux-gnu/ (0x00007f57728c4000) => /lib/x86_64-linux-gnu/ (0x00007f57728a1000) => /lib/x86_64-linux-gnu/ (0x00007f577289b000) => /lib/x86_64-linux-gnu/ (0x00007f577287f000) => /lib/x86_64-linux-gnu/ (0x00007f577268d000) => /lib/x86_64-linux-gnu/ (0x00007f577253e000) /lib64/ (0x00007f57790e9000) => /lib/x86_64-linux-gnu/ (0x00007f5772521000)

Huahai 2021-02-28T16:24:40.031500Z

so is missing

ericdallo 2021-02-28T16:34:41.031700Z

Yes, I merged the reflect-config json with datalevin one

Huahai 2021-02-28T16:34:44.031900Z

ok, had this warning, so the release jar doesn’t include graal version

Huahai 2021-02-28T16:34:45.032100Z

WARNING: Could not resolve datalevin.binding.graal.LMDB for reflection configuration. Reason: java.lang.ClassNotFoundException: datalevin.binding.graal.LMDB.

ericdallo 2021-02-28T16:35:09.032300Z

BTW i'm having the same issue with a JVM version, not graal one but the defmethod warn about the :java one

Huahai 2021-02-28T16:35:11.032500Z

let me figure out how to include that jar

Huahai 2021-02-28T16:35:36.032800Z


ericdallo 2021-02-28T16:35:59.033Z

ericdallo 2021-02-28T16:36:55.033200Z

> WARNING: Could not resolve datalevin.binding.graal.LMDB for reflection configuration. Reason: java.lang.ClassNotFoundException: datalevin.binding.graal.LMDB. I had this one too

ericdallo 2021-02-28T16:37:28.033400Z

But right now the issue seems to be the defmethod not recognizing the defmulti implementations

Huahai 2021-02-28T16:38:30.033600Z

i think i know what’s wrong, hold on, let me fix it

Huahai 2021-02-28T17:18:23.033900Z

please test the updated PR, i tested locally, it seems to include now

ericdallo 2021-02-28T17:19:43.034100Z

Alright, testing it

ericdallo 2021-02-28T18:44:32.034300Z

Thanks for the help @huahaiy,the issue is fixed and it seems to work properly 🙂 I just needed to add the require [datalevin.binding.graal] as well. But probably clojure-lsp will follow a simpler way persisting the db with spit as we just need to persist things and read on time when clojure-lsp initializes. Anyway, thanks for helping on this POC, datalevin seems really cool!

Huahai 2021-02-28T19:44:14.034500Z

Thanks for trying it out. You gave me some ideas on how to improve the packaging

ericdallo 2021-02-28T19:49:22.034700Z

Glad to hear 😄

ericdallo 2021-02-27T16:05:50.025300Z

WDYT @huahaiy?

ericdallo 2021-02-27T16:07:06.025600Z

Otherwise should I need to compile it like besides the need to install liblmdb-dev?

ericdallo 2021-02-27T16:23:08.025900Z

I mean, I can copy the c files to clojure-lsp, manually gcc them during CI but it seems odd to me, it'd be great to have those libs from datalevin somehow

ericdallo 2021-02-27T17:00:51.026100Z

Even manually compiling and including in my graalvm compile, I get a JNI error:

ericdallo 2021-02-27T17:00:52.026300Z    192
                                     java.util.concurrent.ThreadPoolExecutor$  628
                                      java.util.concurrent.ThreadPoolExecutor.runWorker 1128
                                    java.util.concurrent.Executors$           515
                            org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen   94
                     org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage  194
                                       org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume      190
                                 org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest      261
             $null$0      65
                                                                 clojure-lsp.main/fn/fn                         main.clj:  288
                                                        clojure-lsp.handlers/initialize                     handlers.clj:   39
                                                 clojure-lsp.crawler/initialize-project                      crawler.clj:  197
                                                    clojure-lsp.crawler/analyze-project                      crawler.clj:  192
                                                  clojure-lsp.crawler/analyze-classpath                      crawler.clj:  170
                                                               clojure-lsp.db/read-deps                           db.clj:   39
                                                                 clojure-lsp.db/make-db                           db.clj:   25
                                                               datalevin.lmdb/open-lmdb                         lmdb.clj:  841
                                                               datalevin.lmdb/open-lmdb                         lmdb.clj:  851
                                                          org.lmdbjava.Env$                 512
                                                          org.lmdbjava.Env$                 486
                                                        com.kenai.jffi.Invoker.invokeN1             997
java.lang.UnsatisfiedLinkError: com.kenai.jffi.Foreign.invokeN1O1(JJJLjava/lang/Object;III)J [symbol: Java_com_kenai_jffi_Foreign_invokeN1O1 or Java_com_kenai_jffi_Foreign_invokeN1O1__JJJLjava_lang_Object_2III]

borkdude 2021-02-27T17:30:02.026800Z

^ @denik might also know, since he's also working on something native datalevin related