Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gu not found #83

Open
ckipp01 opened this issue Feb 27, 2024 · 1 comment
Open

gu not found #83

ckipp01 opened this issue Feb 27, 2024 · 1 comment

Comments

@ckipp01
Copy link

ckipp01 commented Feb 27, 2024

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:

val graalVmHome = Option(System.getenv("GRAALVM_HOME")).getOrElse {
import sys.process._
(csCommand ++ Seq("java-home", "--jvm", jvmId, "--jvm-index", jvmIndex, "--update", "--ttl", "0")).!!.trim
}
val ext = if (Properties.isWin) ".cmd" else ""
val nativeImage = s"$graalVmHome/bin/native-image$ext"
if (!os.isFile(os.Path(nativeImage))) {
val ret = os.proc(s"$graalVmHome/bin/gu$ext", "install", "native-image").call(

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
Copy link
Collaborator

carlosedp commented Feb 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants