Fork me on GitHub
#tools-build
<
2021-11-27
>
FiVo16:11:13

I am getting

[Use -Dgraal.LogFile=<path> to redirect Graal log output to a file.]
org.graalvm.libgraal.jni.JNIExceptionWrapper: java.lang.NullPointerException
	at org.graalvm.compiler.hotspot.management.Factory.unregister(Factory.java:133)
	at org.graalvm.compiler.hotspot.management.JMXFromLibGraalEntryPoints.unregister(JMXFromLibGraalEntryPoints.java:66)
...
when running `clj -T:build jar` .

1
FiVo16:11:02

@U04V15CAJ you wouldn't know about this one?

borkdude16:11:35

doesn't ring a bell

FiVo16:11:38

ok thanks a bunch anyway

FiVo16:11:52

I tried clj -J-Dgraal.LogFile=test.log -T:build jar as well as adding :jvm-opts ["-Dgraal.LogFile=test.log"] to my build alias.

FiVo16:11:51

Now to my main issue, having switched to openjdk

FiVo16:11:18

java -version gives me

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

FiVo16:11:43

I am getting a cyclic load dependency for clj -T:build jar when switching from v0.5.1 to v0.6.x

FiVo16:11:33

Actually only tried v0.6.0 and v0.6.8.

FiVo16:11:17

This is what my build.clj looks like

(ns build
  (:require [clojure.tools.build.api :as b]))

(def lib 'rundherum/rundherum-activemq-example)
(def version (format "0.1.%s" (b/git-count-revs nil)))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) version))

(defn clean
  "Cleans the target path."
  [_]
  (b/delete {:path "target"}))

(defn jar [_]
  (b/copy-dir {:src-dirs ["consumer" "producer"]
               :target-dir class-dir})
  (b/compile-clj {:basis basis
                  :src-dirs ["consumer" "producer"]
                  :class-dir class-dir})
  (b/uber {:class-dir class-dir
           :uber-file jar-file
           :basis basis}))

FiVo16:11:42

The actual error is

Unexpected error macroexpanding clojure.core.async/go at (org/ramper/activemq_util.clj:56:23).
Cyclic load dependency: [ /producer ]->/org/ramper/activemq_util->/org/ramper/api->[ /producer ]

FiVo16:11:05

but the error also happens on non graal

borkdude16:11:30

what I pointed to doesn't have anything to do with graal

borkdude16:11:16

check the ask link

borkdude16:11:31

not sure if you're hitting that, but worth a shot

FiVo16:11:49

ok, tried your two lines, but it didn't help

FiVo16:11:12

downgrading to v.0.5.1 for now

seancorfield20:11:06

If you're using v0.6.4 or later, you can specify :java-opts to compile-clj and pass that Graal log output option. See https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-compile-clj

🙏 1
seancorfield20:11:34

(btw, kind of unusual to compile code into a JAR -- normally you only compile code into an uberjar)

1
FiVo14:11:17

@U04V70XH6 maybe my naming is misleading, but doesn't this create an uberjar?

seancorfield18:11:48

Oh, yes, that's very confusing.

seancorfield18:11:44

Yes, you are calling uber in a function called jar 👀

vxe05:08:13

java-opts and not the easily typo’d jvm-opts , additionally the environment variable JAVA_OPTS is not respected if set