graalvm

igrishaev 2024-06-24T12:29:36.680339Z

Did anyone try docjure with GraalVM? I've faced a situation when I need to produce an Excel file (instead of CSV as before), and I'm getting plenty of errors when compiling the uberjar. Just interesting if someone has already gone through that path.

borkdude 2024-06-24T12:29:58.065679Z

Perhaps reflection issues?

igrishaev 2024-06-24T12:31:33.935749Z

Not really, I've checked my namespaces for reflections. I've got many errors like >

sun.awt.UNIXToolkit the class was requested to be initialized at run time
and there are plenty of http://sun.awt.XXX classes

borkdude 2024-06-24T12:31:43.948479Z

hmm

igrishaev 2024-06-24T12:32:20.303049Z

I already have this in the arguments to native image

--initialize-at-run-time=sun.awt

borkdude 2024-06-24T12:33:32.470649Z

the issue might be that the clojure library initializes something at the top level which should be done in a delay or function

igrishaev 2024-06-24T12:36:56.828309Z

I've gone through its source code, there is a single file and I see only functions and multimethods: https://github.com/mjul/docjure/blob/master/src/dk/ative/docjure/spreadsheet.clj

lread 2024-06-24T14:46:37.289309Z

docjure depends on poi, have you added any config for that? Or run the agent?

igrishaev 2024-06-24T14:47:41.190639Z

No I haven't done any of these. Honestly, I haven't been doing any graalvm compilation for a long time and forgot it a little

igrishaev 2024-06-24T14:48:20.023289Z

Could you point me to the right direction? What config do you mean?

igrishaev 2024-06-24T14:50:55.558669Z

Personally I'm thinking about trying org.dhatim/fastexcel, it's a small lib for Excel which might work with graal without all that workarounds.

igrishaev 2024-06-24T14:51:32.294309Z

POI is a monstrosity in fact

lread 2024-06-24T14:51:51.552019Z

Sure, good idea

igrishaev 2024-06-24T14:52:44.835939Z

the very idea of sun.aws.* classes being used somewhere deep inside POI brings cold sweat

igrishaev 2024-06-25T08:18:45.570259Z

Quick update: fastexcel and fastexcel-reader worked fine, both compiled by GraalVM with no issues

🎉 2
valerauko 2024-06-24T14:03:21.400749Z

Anyone has experience running com.nilenso/goose on graal? = does it need serious tweaking to work or just runs out of the box?