This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-03
Channels
- # aleph (6)
- # announcements (4)
- # babashka (73)
- # beginners (117)
- # calva (25)
- # chlorine-clover (59)
- # cider (21)
- # clara (3)
- # cljdoc (8)
- # cljs-dev (54)
- # cljsrn (15)
- # clojure (65)
- # clojure-france (5)
- # clojure-spec (3)
- # clojure-uk (13)
- # clojurescript (79)
- # conf-proposals (1)
- # conjure (17)
- # core-logic (11)
- # datomic (21)
- # fulcro (82)
- # graalvm (11)
- # helix (7)
- # jobs-discuss (11)
- # joker (2)
- # juxt (3)
- # local-first-clojure (1)
- # luminus (5)
- # nrepl (61)
- # off-topic (12)
- # pathom (70)
- # re-frame (3)
- # reitit (3)
- # rum (1)
- # shadow-cljs (58)
- # sql (1)
- # tools-deps (26)
- # xtdb (3)
FYI I'm hitting: Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of http://java.io.FilePermission are allowed in the image heap as this class should be initialized at image runtime. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Detailed message: Trace: Object was reached by reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant java.util.concurrent.ConcurrentHashMap$Node@12f4cf5d reached by indexing into array constant java.util.concurrent.ConcurrentHashMap$Node[]@2ac46e53 reached by reading field java.util.concurrent.ConcurrentHashMap.table of constant java.util.concurrent.ConcurrentHashMap@12f4cf5d reached by reading field http://java.io.FilePermissionCollection.perms of constant http://java.io.FilePermissionCollection@afc768e reached by reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant java.util.concurrent.ConcurrentHashMap$Node@5e7666a1 reached by indexing into array constant java.util.concurrent.ConcurrentHashMap$Node[]@4b4549be reached by reading field java.util.concurrent.ConcurrentHashMap.table of constant java.util.concurrent.ConcurrentHashMap@5e7666a1 reached by reading field java.security.Permissions.permsMap of constant java.security.Permissions@773c8886 reached by reading field java.security.ProtectionDomain.permissions of constant java.security.ProtectionDomain@2f112965 reached by indexing into array constant java.security.ProtectionDomain[]@7374ce00 reached by reading field java.security.AccessControlContext.context of constant java.security.AccessControlContext@2f112965 reached by reading field http://java.net.URLClassLoader.acc of constant clojure.lang.DynamicClassLoader@1850c234 reached by reading field java.lang.Class.classLoader of constant java.lang.Class@18407f5c reached by Hub
https://github.com/latacora/wernicke master if anyone wants to try for themselves
looks like that's a fairly common jdk11 problem: https://github.com/BrunoBonacci/graalvm-clojure/search?q=java.io.FilePermission&unscoped_q=java.io.FilePermission
I'm working on something I want to compile to a native binary using GraalVM. I'm making somewhat heavy use of Java interop. To make the resulting binary work, I have to pepper my codebase with type hints. I can compile the binary (using clj.native-image) just fine, but when I neglect to add a type hint somewhere, the binary throws a type-related exception when I run it.
The problem is that the feedback loop is pretty long: to detect any missing type hints, I first need to compile the native image (which can take quite long) and then run it.
Is there any way to shorten the feedback loop? Is there an option I can pass to the native image compiler to make it report the type errors, for example? Or can I leverage *warn-on-reflection*
somehow?
@flowthing Yes, *warn-on-reflection*
is what you want to enable everywhere you do Java interop