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

[GR-46219] Remove the GraalVM Updater #6855

Closed
fniephaus opened this issue Jun 21, 2023 · 20 comments
Closed

[GR-46219] Remove the GraalVM Updater #6855

fniephaus opened this issue Jun 21, 2023 · 20 comments
Assignees
Labels
gu Graal Updater

Comments

@fniephaus
Copy link
Member

fniephaus commented Jun 21, 2023

TL;DR

We plan to remove the GraalVM Updater and provide GraalVM language plugins and other GraalVM extensions in new ways.

Goals

  • Installed applications and runtimes are supposed to stay immutable. GraalVM Updater modified the installation, making it hard to work with systems and package managers requiring immutability. We, therefore, will remove GraalVM Updater and find replacements for its use cases with the GraalVM for the JDK 21 release.

  • For polyglot embedding, all languages should be usable as Maven dependency.

  • Language launcher users should be guided to use standalone distributions instead of using the launchers installed by gu.

All non-language components and their migration:

Component ID Component Name How to use in GraalVM for JDK 21+
jipher Jipher JCE Provider to be included in Oracle GraalVM
(not available in GraalVM CE)
llvm-toolchain LLVM.org toolchain Build from source or usable as part of the Ruby standalone
native-image-llvm-backend Native Image LLVM backend Build from source
visualvm VisualVM GitHub release (VisualVM standalone)

Non-Goals

  • Remove any of the components themselves
  • Introduce a new component installer or rework gu
@Glavo
Copy link

Glavo commented Jun 26, 2023

Sounds like good news.

So after completing this change, can you provide an apt/yum repository to provide GraalVM CE/Oracle GraalVM? I think this will be very helpful to users.

@fniephaus
Copy link
Member Author

So after completing this change, can you provide an apt/yum repository to provide GraalVM CE/Oracle GraalVM? I think this will be very helpful to users.

I'm not sure the deprecation of gu is a prerequisite for this, maybe we could provide apt/yum repos sooner.

@Glavo
Copy link

Glavo commented Jun 26, 2023

I'm not sure the deprecation of gu is a prerequisite for this

I think maybe it is. gu will modify GraalVM itself, which is very unfriendly to the package manager.

@fniephaus
Copy link
Member Author

You could be right, let us check anyway. :)

@rubyFeedback
Copy link

(This is just info, in the event it may be useful to the GraalVM devs.)

In the past I used the openjdk download; since perhaps 2 years (or
a bit less than that) I use the GraalVM release as-is, such as here:

https://github.com/graalvm/graalvm-ce-builds/releases

For both linux and windows. Linux is my main dev platform though;
I try to make sure my java and ruby code works on windows.

I avoid all kind of automatic updaters in general, always doing the
manual way of downloading (or downloading via a set of ruby
scripts, e. g. I compile from source and batch-download via these
scripts, e. g. "update kde" to download all new KDE source releases,
then "compile kde" where update and compile point to the .rb file
that handles the compile/install-logic. This is kind of one big reason
why I default to a single downloadable file (perhaps that also provides
a bit more context to my older suggestion for "fat downloads" - I
just find it easier to have everything that is useful for, say, 95% of
the devs or so, available in one place. Since GraalVM seems to work
perfectly fine I kind of replaced openjdk with it, since I also get
native-image with it, which is nifty.)

@ezzarghili
Copy link
Member

I'm not sure the deprecation of gu is a prerequisite for this

I think maybe it is. gu will modify GraalVM itself, which is very unfriendly to the package manager.

Yum packages are already available publically for community and we are looking into adding the new Oracle GraalVM too (now available only for customers and OCI users)
i.e https://yum.oracle.com/repo/OracleLinux/OL7/graalvm/community/x86_64/
And in this implementation gu is removed to not impact the package installed with in place updates.

@fniephaus fniephaus changed the title Deprecate the GraalVM Updater Retire the GraalVM Updater Sep 6, 2023
@fniephaus fniephaus changed the title Retire the GraalVM Updater Remove the GraalVM Updater Sep 6, 2023
@fniephaus fniephaus changed the title Remove the GraalVM Updater [GR-46219] Remove the GraalVM Updater Sep 6, 2023
eregon added a commit to eregon/ruby-build that referenced this issue Sep 14, 2023
* In TruffleRuby 23.1+, the GraalVM Updater (`gu`) is no longer available in GraalVM,
  instead JVM Standalones and Maven artifacts are provided to replace `gu`.
* See oracle/graal#6855
eregon added a commit to rbenv/ruby-build that referenced this issue Sep 14, 2023
* In TruffleRuby 23.1+, the GraalVM Updater (`gu`) is no longer available in GraalVM,
  instead JVM Standalones and Maven artifacts are provided to replace `gu`.
* See oracle/graal#6855
@chumer
Copy link
Member

chumer commented Sep 19, 2023

GU was removed with the GraalVM for JDK 21 release.

@chumer chumer closed this as completed Sep 19, 2023
@liudonghua123
Copy link

If gu was removed, how can I install native-image via gu install native-image like before?

@liudonghua123
Copy link

If gu was removed, how can I install native-image via gu install native-image like before?

I found the native-image is included in the new graalvm.

@fniephaus
Copy link
Member Author

I found the native-image is included in the new graalvm.

Correct, the native-image component is included since the release of GraalVM for JDK 17: #5995

@qidian99
Copy link

After updating to GraalVM 23.1, TOO many stuffs were broken. For instance mvn -Pnative -DskipTests package always fail b/c:

'gu' tool wasn't found. This probably means that JDK at isn't a GraalVM distribution.

@fniephaus
Copy link
Member Author

Apologies, @qidian99. We actually planned to include a script that prints a useful deprecation message, but due to a configuration issue, the script wasn't included in the release.

The problem should go away if you upgrade the Maven plugin in your pom.xml to at least 0.9.27.

@Rob287
Copy link

Rob287 commented Oct 15, 2023

Even with 0.9.27 compilation is broken (on MacOS):

[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.27:compile (default-cli) on project demo: 'gu' tool was not found. This probably means that JDK at is not a GraalVM distribution. -> [Help 1]

@BlueCloudDev
Copy link

[ERROR] Internal error: java.lang.RuntimeException: org.apache.maven.plugin.MojoExecutionException: 'gu' tool wasn't found. This probably means that JDK at isn't a GraalVM distribution. -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.apache.maven.plugin.MojoExecutionException: 'gu' tool wasn't found. This probably means that JDK at isn't a GraalVM distribution. at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:577) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357) Caused by: java.lang.RuntimeException: org.apache.maven.plugin.MojoExecutionException: 'gu' tool wasn't found. This probably means that JDK at isn't a GraalVM distribution. at org.graalvm.buildtools.maven.NativeExtension.getGraalvmJava(NativeExtension.java:359) at org.graalvm.buildtools.maven.NativeExtension.lambda$configureAgentForSurefire$6(NativeExtension.java:316) at org.graalvm.buildtools.maven.NativeExtension.lambda$updatePluginConfiguration$8(NativeExtension.java:333) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.graalvm.buildtools.maven.NativeExtension.updatePluginConfiguration(NativeExtension.java:331) at org.graalvm.buildtools.maven.NativeExtension.configureAgentForSurefire(NativeExtension.java:309) at org.graalvm.buildtools.maven.NativeExtension.lambda$null$0(NativeExtension.java:131) at java.base/java.util.Optional.ifPresent(Optional.java:178) at org.graalvm.buildtools.maven.NativeExtension.withPlugin(NativeExtension.java:193) at org.graalvm.buildtools.maven.NativeExtension.lambda$afterProjectsRead$4(NativeExtension.java:127) at java.base/java.util.Optional.ifPresent(Optional.java:178) at org.graalvm.buildtools.maven.NativeExtension.withPlugin(NativeExtension.java:193) at org.graalvm.buildtools.maven.NativeExtension.afterProjectsRead(NativeExtension.java:120) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) ... 9 more Caused by: org.apache.maven.plugin.MojoExecutionException: 'gu' tool wasn't found. This probably means that JDK at isn't a GraalVM distribution. at org.graalvm.buildtools.Utils.getJavaHomeNativeImage(Utils.java:89) at org.graalvm.buildtools.Utils.getNativeImage(Utils.java:121) at org.graalvm.buildtools.maven.NativeExtension.getGraalvmJava(NativeExtension.java:357) ... 23 more [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException

Trying to work with the Fortune demo. I can build a hello-world with native-image, but this fails. How can I resolve?

@fniephaus
Copy link
Member Author

We are working on a new release of the Native Build Tools to resolve this issue. It seems the error is similar to what was reported in graalvm/native-build-tools#521. The problem here is that JAVA_HOME was not set correctly. Please check your environment variables.

@BlueCloudDev
Copy link

BlueCloudDev commented Oct 18, 2023

I followed native-hello-module example, which includes JAVA_HOME in the build process. It built and ran without issues. Could you specify what I'm supposed to be looking for to identify that my environment variables are correct? It seems like they're correct for other graalvm examples.

I'm not an expert in the Java build process, so I'm not sure what is and isn't correct. I just know that example isn't working when others are.

@fniephaus
Copy link
Member Author

No problem, @BlueCloudDev. What JAVA_HOME do you use when building the examples? What operating system do you use?

JAVA_HOME needs to point to a GraalVM installation, e.g. /home/fniephaus/bin/graalvm-jdk-17.0.7+8.1 or /Library/Java/JavaVirtualMachines/graalvm-jdk-21+35.1/Contents/Home.

@BlueCloudDev
Copy link

I'm running Oracle Linux 7.9

I had not set JAVA_HOME, so it was likely using the installation of java that came with the image which is Java 18

After setting JAVA_HOME, to the place where I extracted graalvm: /home/opc/nosql/graalvm-jdk-21.0.1+12.1

I get a different error:
[ERROR] Could not find goal 'exec@java-agent' in plugin org.codehaus.mojo:exec-maven-plugin:3.0.0 among available goals exec, help, java -> [Help 1]

I have another example with less dependencies working, so I'm not sure its necessary to get this one working, unless this build issue is indicative of a larger problem.

@fniephaus
Copy link
Member Author

Could you please file a ticket for the guide(s) that you can get working so that we can take a look? It's a bit hard to guess what's going wrong without knowing what you are running on what machine and with what GraalVM.

@me-her
Copy link

me-her commented Nov 7, 2023

Even with 0.9.27 compilation is broken (on MacOS):

[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.27:compile (default-cli) on project demo: 'gu' tool was not found. This probably means that JDK at is not a GraalVM distribution. -> [Help 1]

19.31 [INFO] ------------------------------------------------------------------------
19.31 [INFO] BUILD FAILURE
19.31 [INFO] ------------------------------------------------------------------------
19.31 [INFO] Total time: 18.322 s
19.31 [INFO] Finished at: 2023-11-07T06:59:40Z
19.31 [INFO] ------------------------------------------------------------------------
19.31 [ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.28:compile (default-cli) on project helloworld: 'gu' tool was not found in your JAVA_HOME.This probably means that the JDK at '/usr/lib64/graalvm/graalvm-community-java17' is not a GraalVM distribution. ->

I get this error with maven-plugin 0.9.28 as well. I was trying to build the image through a multi-stage docker builder, so that it goes well with CI/CD. I keep getting gu not found, and later I got to know that it was deprecated. What do I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gu Graal Updater
Projects
Status: Released
Development

No branches or pull requests

10 participants