mill-native-image icon indicating copy to clipboard operation
mill-native-image copied to clipboard

`gu` not found

Open ckipp01 opened this issue 4 months ago • 1 comments

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)

ckipp01 avatar Feb 27 '24 12:02 ckipp01