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/.
Reily Siegel 2020-12-18T01:27:10.232700Z

Hello, I'm having a bit of trouble generating a native image. I have pinpointed the problem to the function resolve . Assuming that the problem was with this function, I tried to rebuild resolve. Eventually, I found the minimal working code:

(defn -main [& args]
  ((fn [^clojure.lang.Namespace ns] (.getName ns)) *ns*))
which compiles, and
(defn -main [& args]
  ((fn [^clojure.lang.Namespace ns] (.getMappings ns)) *ns*))
which does not. As a quick look at the java code for clojure.lang.Namespace shows, both methods do simple field access, and I am unsure as to why one would compile successfully and the other would fail (Unless maybe AtomicReference is causing issues?). Any suggestions you might have would be wonderful. Edit: As a quick note, when ignoring unsupported features with --report-unsupported-features-at-runtime, everything works as intended, even when using clojure.core/resolve.