This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-13
Channels
- # announcements (1)
- # babashka (29)
- # beginners (64)
- # calva (4)
- # cider (5)
- # cljs-dev (3)
- # cljsrn (2)
- # clojure (100)
- # clojure-australia (2)
- # clojure-conj (7)
- # clojure-dev (9)
- # clojure-europe (31)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-uk (13)
- # clojured (2)
- # clojurescript (62)
- # community-development (2)
- # conjure (1)
- # cursive (21)
- # datomic (39)
- # events (2)
- # fulcro (7)
- # graalvm (24)
- # graalvm-mobile (11)
- # holy-lambda (3)
- # jobs (7)
- # lsp (15)
- # malli (26)
- # music (1)
- # nyc (2)
- # off-topic (18)
- # reagent (23)
- # reitit (5)
- # remote-jobs (1)
- # shadow-cljs (2)
- # tools-deps (26)
- # vim (6)
- # xtdb (17)
Has anyone been able to use Hawk in a native image? I'm having a hard time going through all the reflection. Alternatively, is there another file watcher that plays nicely with native image AND allow to watch individual files?
If you're looking to solve reflection issues you could take a look at https://github.com/borkdude/refl
Is it really a problem to have many false positive? Perf-wise?
Sometimes false positives will trigger warnings on GraalVM
if it's a reference to a class that can't be found yes. this can happen with the gensym-ed function symbols
Like aws-api generates tons of false spec, eval$fn positives.
@borkdude "But excluding all calls from `clojure.lang.RT` may be too coarse for some programs" Would you have an example? I am trying to better understand what is at stake and how to ensure that reflection is configured appropriately (as opposed to running the binary and seeing it fail at some point)
Has anyone ever encountered the following error stemming from the reflection config file when creating an image?
[build/native/app/run:27454] classlist: 5,146.55 ms, 0.96 GB
[build/native/app/run:27454] (cap): 962.60 ms, 0.96 GB
[build/native/app/run:27454] setup: 1,949.40 ms, 0.96 GB
Error: Error parsing reflection configuration in /home/adam/projects/foo/clj/tool/foo/reflect-config.json:
Method java.lang.reflect.Method.canAccess(Object) not found. To allow unresolvable reflection configuration, use option -H:+AllowIncompleteClasspath
Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option ReflectionConfigurationFiles.
com.oracle.svm.core.util.UserError$UserException: Error parsing reflection configuration in /home/adam/projects/convex/clj/tool/foo/reflect-config.json:
Method java.lang.reflect.Method.canAccess(Object) not found. To allow unresolvable reflection configuration, use option -H:+AllowIncompleteClasspath
Adding -H:+AllowIncompleteClasspath
seems to work (my binary seems to behave well) but it sounds scary and it still produces a warning when creating the image:
[build/native/app/run:27699] classlist: 7,491.46 ms, 0.96 GB
[build/native/app/run:27699] (cap): 818.44 ms, 0.96 GB
WARNING: Method java.lang.reflect.Method.canAccess(Object) not found.
[build/native/app/run:27699] setup: 5,448.74 ms, 0.96 GB
...
@adam678 I don't recommend using that option. You have to fix your reflection config manually. See borkdude/refl. This is a bug in the native-image agent I think
Also you seems to have a broken reflection config:
Error: Error parsing reflection configuration in /home/adam/projects/foo/clj/tool/foo/reflect-config.json
Thanks, it seems to work, and googling wasn't helping
In my case at least, agent was also adding an isVarArgs
method to java.lang.reflect.Method
, I simply removed it and kept canAccess