Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to and GraalVM slack:
sergey 2020-08-04T16:20:35.125700Z

has anyone here gotten the cognitect aws library to run on a native-image build? (specifically the s3 client)


@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

sergey 2020-08-06T21:39:15.129Z

hmm how do I require the namespace so that it doesn't get loaded via dynaload?

sergey 2020-08-06T21:40:15.129200Z

(I'm already compiling with )

borkdude 2020-08-06T21:41:00.129400Z

just require it by hand somewhere top-level

sergey 2020-08-06T21:51:12.129600Z

gotcha, will give it a shot and report back

sergey 2020-08-06T21:53:30.129800Z

FWIW, I'm seeing similar behavior in the as well


A related question was asked last week

borkdude 2020-08-04T20:03:04.126600Z

That must be the most requested native-image library right now