Fork me on GitHub
#graalvm
<
2022-06-16
>
Dumch10:06:51

Can't make Dart->Clojure translator work with graalvm, need help šŸ™. Seems like I have problems with reflection:

ā•°$ ./dartclj "Text('1')"
Exception in thread "main" java.lang.IllegalArgumentException: No matching method substring
 found taking 2 args for class java.lang.String
        at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:127)
        at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:102)
Here is a https://github.com/Liverm0r/DartClojure/blob/main/compile.sh file. I pass a flag -H:ReflectionConfigurationFiles with json, where I ask to remain allMethods, constructors, etc. But it doesn't work.

Dumch10:06:32

graalvm -v 22.1, java 11

Dumch10:06:31

I have also found this @U04V15CAJ https://github.com/borkdude/clj-reflector-graal-java11-fix and tryied to add

{ 
    "name": "java.lang.reflect.AccessibleObject",
    "methods" : [{"name":"canAccess"}]
  },
— didn't work

borkdude10:06:13

Just add the String class in your reflection config file

borkdude10:06:24

or get rid off your reflection using type hints in Clojure which is even better

borkdude11:06:19

and then it will warn you about the reflective .substring usage

borkdude11:06:26

but you can just use subs there as well btw

Dumch12:06:54

Thank you!