Closed kgston closed 3 years ago
Thanks a lot for brining this up 😊. I don't use the graalvm feature ( yet ). IIRC this is related to the build process itself, right?
I'm happy to merge any pull requests on this 🤗
cc @ScalaWilliam
Thanks for checking with me @muuki88!
I think the Docker usage for GraalVM was introduced in https://github.com/sbt/sbt-native-packager/pull/1251 by @jroper, are you by any chance able to look at this? I would love to look into it but my bandwidth is currently very limited.
Yes, this is used when building a native image in a Graalvm docker image. I actually took a look at the potential fix, and I think it would be a quick name change here: https://github.com/sbt/sbt-native-packager/blob/870e260238cdca3d58a48982d9af153834372991/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala#L30
The fix worked, but I couldn't figure out why the Graalvm test wouldn't pass... Something along the lines of output test native-image binary couldn't find the Main class. I haven't looked too deeply into what was causing the issue.
Currently I'm just working around the whole issue by using the setting (containerBuildImage in GraalVMNativeImage) := GraalVMNativeImagePlugin.generateContainerBuildImage(s"ghcr.io/graalvm/graalvm-ce:java11-21.0.0").value
p.s. the instructions on the web documentation related to this option seems to be outdated, thankfully the code itself was commented with the right example.
https://github.com/sbt/sbt-native-packager/blob/870e260238cdca3d58a48982d9af153834372991/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala#L152-L160
Thanks @kgston for giving it a shot :hugs: You could open a pull request with the change, which seems quite right. Then some one can take a look and see what the issue is. If there's something weird going on with the sbt scripted test setup, I'll surely look into this.
The docker hub page now returns 404: https://hub.docker.com/r/oracle/graalvm-ce Seems like it was migrated sometime back to Github container repository at
ghcr.io/graalvm/graalvm-ce
https://github.com/orgs/graalvm/packages/container/package/graalvm-ce