Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to and GraalVM slack:
sergey 2020-08-05T00:06:28.126800Z

ooh there's some interesting workarounds in that thread; thanks for the share!

sergey 2020-08-05T00:09:40.127Z

I've been playing around with adding the cognitect s3 client to to a native-image cli app and ended up getting blocked w/ a runtime Unsupported method java.lang.ClassLoader.defineClass1. (this was a bit before I saw the graalvm issue on the cognitect repo)


@sergey923 The defineClass1 error is very generic and it doesn’t point to one cause in my experience (e.g. it could be eval, but also something less dynamic). If you want to check where it breaks, probably good to start bottom up and keep adding stuff until you find the issue. Here is a start (forked some time ago though)


@borkdude I think it’s popular because of the possibility to have one interface to aws. Although the python cli tool is pretty user friendly, the installation is a bit fragile as it’s depending on specific python versions (or libs). I have had to reinstall the aws cli tool several times due to a change in underlying system (not the aws api). For me this causes unnecessary work and anxiety about my setup. So I would definitely welcome additional help here :)

sergey 2020-08-05T18:49:08.128100Z

gotcha, yea the full stack trace was:

Exception in thread "main" Syntax error compiling fn* at (cognitect/aws/http/cognitect.clj:1:1).
	at clojure.lang.Compiler.analyzeSeq(
	at clojure.lang.Compiler.analyze(
	at clojure.lang.Compiler.eval(
	at clojure.lang.Compiler.eval(
	at clojure.lang.Compiler.load(
	at clojure.lang.RT.loadResourceScript(
	at clojure.lang.RT.loadResourceScript(
	at clojure.lang.RT.load(
	at clojure.lang.RT.load(
	at clojure.core$load$fn__6844.invoke(core.clj:6128)
	at clojure.core$load.invokeStatic(core.clj:6127)
	at clojure.core$load.doInvoke(core.clj:6111)
	at clojure.lang.RestFn.invoke(
	at clojure.core$load_one.invokeStatic(core.clj:5910)
	at clojure.core$load_one.invoke(core.clj:5905)
	at clojure.core$load_lib$fn__6784.invoke(core.clj:5950)
	at clojure.core$load_lib.invokeStatic(core.clj:5949)
	at clojure.core$load_lib.doInvoke(core.clj:5930)
	at clojure.lang.RestFn.applyTo(
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$load_libs.invokeStatic(core.clj:5987)
	at clojure.core$load_libs.doInvoke(core.clj:5971)
	at clojure.lang.RestFn.applyTo(
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$require.invokeStatic(core.clj:6009)
	at clojure.lang.Delay.deref(
	at clojure.core$deref.invokeStatic(core.clj:2322)
	at shatest.local_sha$list_buckets.invokeStatic(local_sha.clj:8)
	at shatest.local_sha$_main.invokeStatic(local_sha.clj:13)
	at shatest.local_sha$_main.doInvoke(local_sha.clj:13)
	at clojure.lang.RestFn.invoke(
	at clojure.lang.AFn.applyToHelper(
	at clojure.lang.RestFn.applyTo(
	at shatest.local_sha.main(Unknown Source)
Caused by: Unsupported method java.lang.ClassLoader.defineClass1(String, byte[], int, int, ProtectionDomain, String) is reachable
	at java.lang.ClassLoader.defineClass1(
	at java.lang.ClassLoader.defineClass(
	at java.lang.ClassLoader.defineClass(
	at clojure.lang.DynamicClassLoader.defineClass(
	at clojure.lang.Compiler$ObjExpr.getCompiledClass(
	at clojure.lang.Compiler$FnExpr.parse(
	at clojure.lang.Compiler.analyzeSeq(
	... 40 more
all that I'm doing is calling :ListBuckets from the cognitect s3 library. I compiled the native-image exe after generating assisted config files for an uberjar w/ the same code (described

borkdude 2020-08-05T19:06:06.128400Z

Yeah, it's trying to load a namespace dynamically, that won't work

borkdude 2020-08-05T19:07:35.128600Z

Maybe it helps when you require that namespace as part of your program so dynaload does not load it

borkdude 2020-08-05T19:07:47.128800Z

Also use direct linking if you're not doing that already