graalvm

viesti 2022-10-17T12:48:40.083309Z

Hmm, dabbling into native-image, have a project that use buddy and ran into https://github.com/babashka/pod-babashka-buddy, is this https://github.com/babashka/pod-babashka-buddy/blob/main/java/graalvm/feature/BouncyCastleFeature.java more preferred way than using --initialize-at-build-time=list,of,classes ?

borkdude 2022-10-17T13:30:14.670549Z

I think that approach is mostly about the security thing which didn't work otherwise

borkdude 2022-10-17T13:30:23.123679Z

You can of course try without and then find out why we did it this way

viesti 2022-10-17T15:02:54.295759Z

did some whack-a-mole compile/add class/compile until I got native-image to pass with an app that does jwt signature checking

viesti 2022-10-19T14:07:48.152909Z

but after compile, got (java exception in Throwable->map form)

{
        "type": "java.security.NoSuchProviderException",
        "message": "no such provider: BC",
        "at": [
          "sun.security.jca.GetInstance",
          "getService",
          "GetInstance.java",
          83
        ]
      }
so went back to using that BouncyCastleFeature.java compiled with graalvm and that worked I initially thought that native-image would have this RuntimeClassInitializationSupport.rerunInitialization thing available as a flag, instead of needing to compile a class that looks like configuration to me, but didn't found such a flag

viesti 2022-10-19T14:10:59.502429Z

hmm well, from https://www.graalvm.org/sdk/javadoc/index.html?org/graalvm/nativeimage/hosted/Feature.html > Features allow clients to intercept the native image generation and run custom initialization code at various stages so Feature classes are something that cannot be covered with flags only

viesti 2022-10-19T18:27:51.265949Z

Thinking that maybe a minimal setup of making buddy work in native-image could be extracted under https://github.com/clj-easy/graalvm-clojure even

borkdude 2022-10-19T18:28:41.742879Z

sure