Fork me on GitHub
#graalvm
<
2022-07-27
>
Karol Wójcik11:07:35

Has the image size also reduced?

borkdude11:07:55

Yes, it seems so :) With 5mb, now 72mb in total

borkdude11:07:19

Yeah, it's amazing, it seems to shrink now every time, unlike before where the image size grew every time ;)

👍 1
Karol Wójcik12:07:28

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.

👍 1
ericdallo12:07:15

we should probably open PRs with the libs we have on graal-config?

Karol Wójcik12:07:10

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.

😢 1
ericdallo11:07:14

> • 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. 🙏

bocaj15:07:31

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

borkdude15:07:45

@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.

👍 1
bocaj15:07:16

I’m terrible at formatting messages 🙂

bocaj15:07:23

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

bocaj15:07:55

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.SQLServerResource

bocaj15:07:02

Failed generating ' --trace-class-initialization=com.microsoft.sqlserver.jdbc.SQLServerResource' after 49.9s.

bocaj15:07:27

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, hyperfiddle

bocaj15:07:30

so 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

bocaj15:07:51

Got it, thanks! I like that idea

borkdude15:07:05

@bocaj It depends. It could also be in your own program, something which is initialising stuff on the top level

bocaj15:07:04

Have you built the sql server pod with graal 22?

bocaj15:07:29

I think this might be the issue, as well. I’ll start with 21 and work forward. Thank you!

borkdude15:07:49

I've seen an issue in bb where I had to initialize-at-build-time= another yaml class this morning with 22.2