tools-build

FiVo 2021-11-27T16:18:13.272300Z

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
FiVo 2021-11-27T16:55:02.277700Z

@borkdude you wouldn't know about this one?

borkdude 2021-11-27T16:55:35.277900Z

doesn't ring a bell

FiVo 2021-11-27T16:56:38.278100Z

ok thanks a bunch anyway

FiVo 2021-11-27T16:18:52.272900Z

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.

FiVo 2021-11-27T16:29:51.273500Z

Now to my main issue, having switched to openjdk

FiVo 2021-11-27T16:30:18.273600Z

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)

FiVo 2021-11-27T16:32:43.275200Z

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

FiVo 2021-11-27T16:33:33.275300Z

Actually only tried v0.6.0 and v0.6.8.

FiVo 2021-11-27T16:34:17.275500Z

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}))

FiVo 2021-11-27T16:40:42.275900Z

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 ]

FiVo 2021-11-27T16:43:05.276500Z

but the error also happens on non graal

borkdude 2021-11-27T16:43:30.276700Z

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

borkdude 2021-11-27T16:44:16.276900Z

check the ask link

borkdude 2021-11-27T16:44:31.277100Z

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

FiVo 2021-11-27T16:46:49.277300Z

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

FiVo 2021-11-27T16:54:12.277500Z

downgrading to v.0.5.1 for now

seancorfield 2021-11-27T20:21:06.278300Z

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
seancorfield 2021-11-27T20:21:34.278500Z

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

➕ 1
vxe 2023-08-10T05:16:13.517849Z

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

FiVo 2021-11-28T14:01:17.278900Z

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

seancorfield 2021-11-28T18:13:48.279300Z

Oh, yes, that's very confusing.

seancorfield 2021-11-28T18:14:44.279500Z

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