Fork me on GitHub
#graalvm
<
2024-03-21
>
jcf00:03:54

Has anyone had any lucky generating a native image with Pedestal and all of its Metrics and SLF4J dependencies? I’m working my way through various issues and have hit a bit of a wall here.

Warning: Aborting stand-alone image build. Detected a FileDescriptor in the image heap. File descriptors opened during image generation are no longer open at image runtime, and the files might not even be presen>The culprit object has been instantiated by the 'com.codahale.metrics.ScheduledReporter' class initializer with the following trace:
        at java.io.FileDescriptor.(FileDescriptor.java:127)
        at java.io.FileOutputStream.(FileOutputStream.java:226)
        at ch.qos.logback.core.recovery.ResilientFileOutputStream.(ResilientFileOutputStream.java:26)
        at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:206)
        at ch.qos.logback.core.FileAppender.start(FileAppender.java:126)
        at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:104)
        at ch.qos.logback.core.model.processor.AppenderModelHandler.postHandle(AppenderModelHandler.java:84)
I’ve seen an example of an older Pedestal app working in the https://github.com/clj-easy/graalvm-clojure/tree/master/pedestal but with clj-nix and Pedestal 0.6.3 things don’t work quite so nicely.

jcf00:03:28

I might be able to push a minimal repro up to GitHub in the coming days, if that helps.

jcf00:03:49

In the meantime, any pointers from anyone who’s already walked this path would be immensely appreciated!

borkdude12:03:19

This is likely due to a top level expression in some code. Pushing it to a delay will likely solve the issue

💯 1
jcf13:03:08

I could open a PR to delay initialising telemetry on Pedestal. My concern is the effect such a change might have on downstream code.

borkdude13:03:11

well, you could at the very least first fork the project to see if this is the issue

borkdude14:03:22

@U06FTAZV3 which GraalVM version are you using?

borkdude15:03:08

I'm asking because this might solve the issue in graalvm 22, not sure: https://medium.com/graalvm/welcome-graalvm-for-jdk-22-8a48849f054c#df1e

👀 1
jcf16:03:56

@U04V15CAJ I haven’t upgraded from 21 yet. I can give 22 a try and loop back.