Fork me on GitHub
#graalvm
<
2022-10-17
>
viesti12:10:40

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 ?

borkdude13:10:14

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

borkdude13:10:23

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

viesti15:10:54

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

viesti14:10:48

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

viesti14:10:59

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

viesti18:10:51

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