Has the image size also reduced?
Yes, it seems so :) With 5mb, now 72mb in total
Wow, cool!
Yeah, it's amazing, it seems to shrink now every time, unlike before where the image size grew every time ;)
Interesting: https://github.com/oracle/graalvm-reachability-metadata
Yeah, i stopped investing in this after I spoken with few guys from Oracle and they told me about having plans of publishing repository of GraalVM metadata of popular open source libraries.
we should probably open PRs with the libs we have on graal-config?
I’m not sure yet. I thought that they will distribute it in a way it’s accessible by all Clojure build tools, but it doesn’t seem so.
It's like we did on https://github.com/clj-easy/graal-config :)
> • Improved many internal data structures of the native-image generator to reduce the memory footprint. This makes Native Image builds more robust when running on memory-constraint environments like cloud-based build services, https://github.com/marketplace/actions/github-action-for-graalvm, or in https://www.graalvm.org/downloads/. Many larger application now build successfully with 2 GByte of Java heap size available for the native-image generator.
🙏
I’m using graal v 22.1 with microsoft sql; this in the deps.edn:
com.github.clj-easy/graal-config-next {:git/url ""
:git/sha "0dc2862e1b1c9871eef4c306ef77da3610a2bd93"
:deps/root "config/com.github.seancorfield/next.jdbc"}
@bocaj I'm assuming you're going to post a question after this, right? Check out https://github.com/babashka/babashka-sql-pods which has configs for that. Perhaps we can move them to graal-config.
I’m terrible at formatting messages 🙂
"-H:IncludeResourceBundles=com.microsoft.sqlserver.jdbc.SQLServerResource"
(str "--initialize-at-run-time="
",com.microsoft.sqlserver.jdbc.SQLServerFMTQuery"
",com.microsoft.sqlserver.jdbc.SQLServerFMTQuery"
",com.microsoft.sqlserver.jdbc.SQLServerBouncyCastleLoader"
",com.microsoft.sqlserver.jdbc.SQLServerBulkCSVFileRecord"
",com.microsoft.sqlserver.jdbc.SQLServerBulkCopyOptions"
",com.microsoft.sqlserver.jdbc.SQLServerBulkCopy"
",com.microsoft.sqlserver.jdbc.SQLServerResource"
",com.microsoft.sqlserver.jdbc.SQLServerMSAL4JUtils"
)The question is about this error:
com.microsoft.sqlserver.jdbc.SQLServerResource the class was requested to be initialized at run time (from command line with 'com.microsoft.sqlserver.jdbc.SQLServerResource'). To see why com.microsoft.sqlserver.jdbc.SQLServerResource got initialized use --trace-class-initialization=com.microsoft.sqlserver.jdbc.SQLServerResourceFailed generating ' --trace-class-initialization=com.microsoft.sqlserver.jdbc.SQLServerResource' after 49.9s.I see this is working well with clj-easy, which reports
Registering packages for build time initialization: clojure, com.github.ztellman, next, camel_snake_kebab, dbloader, com.climate, charred, tech.v3, babashka, taoensso, clj_easy, hyperfiddleso I’m curious if next.jdbc is initializing sql server resources at build time, but I need to somehow force portions of the next dependencies to initialize at run time so that the sql server driver works
Got it, thanks! I like that idea
@bocaj It depends. It could also be in your own program, something which is initialising stuff on the top level
@bocaj This is the only thing for mssql that the bb pod has, I think: https://github.com/babashka/babashka-sql-pods/blob/7fd0d1a78b19f0fab3ecc5babada88f41194de7b/script/compile.clj#L65-L68
ah right
Have you built the sql server pod with graal 22?
I think this might be the issue, as well. I’ll start with 21 and work forward. Thank you!
not sure
I've seen an issue in bb where I had to initialize-at-build-time= another yaml class this morning with 22.2