graalvm

borkdude 2023-12-18T15:39:54.128739Z

If you're using graalvm, https://graalvm.typeform.com/survey and let's represent the Clojure community

✅ 6
Cody Heaps 2023-12-18T19:02:08.024479Z

Hi all! I'm trying to generate a native image with graalvm for a small PoC that uses cognitect aws api to invoke dynamodb ops...

native-image -jar target/migrator-0.0.1.jar \
--no-fallback \
--features=clj_easy.graal_build_time.InitClojureClasses
But it yields
Classes that should be initialized at run time got initialized during image building:
 org.eclipse.jetty.http.HttpCompliance$1 was unintentionally initialized at build time. To see why org.eclipse.jetty.http.HttpCompliance$1 got initialized use --trace-class-initialization=org.eclipse.jetty.http.HttpCompliance$1
org.eclipse.jetty.http.HttpCompliance was unintentionally initialized at build time. To see why org.eclipse.jetty.http.HttpCompliance ...
Tracing the class initialization leads to at cognitect.http_client$create.invokeStatic(http_client.clj:333) but unsure what to do about it. I've tried both pre-creating an http client for the ddb client and adding cognitect.http_client and cognitect.aws.http.cognitect to --initialize-at-run-time but seems to do nothing. Any insight would be huge. 🙌

borkdude 2023-12-18T19:04:27.753629Z

you could have a look at pod-babashka-aws which native-compiled aws-api. it is now deprecated in favor of awyeah-api which works with babashka, so you don't even have to native-compile anymore

👀 1
Cody Heaps 2023-12-18T19:46:29.959639Z

@borkdude Thanks for this - interesting. Any thoughts on if I still need to native compile?

borkdude 2023-12-18T19:47:45.955799Z

@cody.heaps It depends what you want to do. If your "migrator" app can run in bb + awyeah-api then you could avoid native compilation.

🙌 1