alexarchambault / mill-native-image

Apache License 2.0
18 stars 6 forks source link

`gu` not found #83

Open ckipp01 opened 7 months ago

ckipp01 commented 7 months ago

I've been having issues running mill cli[2.12.18].mostly-static-image.nativeImage on the coursier codebase and I went down a rabbit hole of why this wasn't working. It looks like with some of the new installations of Graal gu isn't where this plugins thinks it is. For example you can see some logic in this plugin here:

https://github.com/alexarchambault/mill-native-image/blob/b97f73908203f561fa80d3bac99e77b202ab9fff/plugin/src/io/github/alexarchambault/millnativeimage/NativeImage.scala#L351-L360

This is supposed to get the graal home and use it to find gu, but this doesn't seem to always work. For example if I do this command locally:

 cs java-home
/Users/ckipp/Library/Caches/Coursier/arc/https/github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_macos-aarch64_bin.tar.gz/graalvm-community-openjdk-21.0.2+13.1/Contents/Home

I'll see what it ends up using for the graal home. However when I look in bin/gu it's not there like it is in some of my older graalvm installations. This then causes nativeImage to blow up since gu can't be found.

/data/run-native-image.sh: line 13: gu: command not found
1 targets failed
cli[2.12.18].mostly-static-image.nativeImage os.SubprocessException: Result of docker…: 127

    os.proc.call(ProcessOps.scala:95)
    io.github.alexarchambault.millnativeimage.NativeImage.$anonfun$nativeImage$8(NativeImage.scala:219)
    mill.define.Task$TraverseCtx.evaluate(Task.scala:71)
carlosedp commented 7 months ago

I've read here that on recent GraalVM packages (21), native-image already comes with the default installer and gu was removed. I'm using it and gu isn't present and native-image comes installed