[GR-52835] Support OpenJDK versions in JVMCIVersionCheck #8699
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support to check OpenJDK versions in
JVMCIVersionCheck
.Motivation
Up until now, we have always used a custom JDK build, also referred to as LabsJDK. A LabsJDK would identify as such via the
-jvmci
suffix:While building a custom JDK provides great flexibility, it is also an overhead, both in terms of time and computational resources. Especially for mainline development, where we update to the latest early access build every week, building our own JDK is a burden.
Thus, we are moving mainline development to use official early access builds of the JDK instead of building our own. This helps us move faster and is also more resource-friendly.
As a consequence, the JDK will no longer identify itself as a LabsJDK, because it is none:
Version Checking
Since various parts of GraalVM, such as the Graal compiler or Native Image, are tightly coupled with the JDK, a given revision of GraalVM only runs on a specific JDK version, namely the version that is specified in
JVMCIVersionCheck#JVMCI_MIN_VERSIONS
.Both Graal and Native Image verify that the JDK version is not outdated and abort if it is. Up until now, however, the check was only performed when running a LabsJDK, i.e., a JDK with the
-jvmci
version suffix. When switching to official early access JDK builds, we will extend the check to OpenJDK versions, since the check greatly reduces the number of bug reports due to running on an outdated JDK version.For regular users of GraalVM deployments, nothing changes because GraalVM will always ship with the correct JDK. However, extending the scope of the version check to OpenJDK impacts all users that run individual GraalVM components with a custom JDK. Ideally, it will help find wrong setups eagerly, so it can be seen as a usability improvement for these use cases. However, we cannot know all the different scenarios in which GraalVM is used with a custom JDK, so in case the version check complains but the user is certain that the custom JDK is in sync with the GraalVM sources, the check can be disabled by setting the
JVMCI_VERSION_CHECK
environment variable toignore
.OpenJDK vs LabsJDK Version Checking Clarifications
If
JVMCIVersionCheck#JVMCI_MIN_VERSIONS
specifies a LabsJDK, for example23+17-jvmci-b03
, all OpenJDK versions based on the same build (in the example23+17
) or higher are considered recent enough, i.e., the version check is successful. So the JVMCI build number (b03
in the example) is ignored.If an OpenJDK version is specified, e.g.,
23+17
, all JDKs (OpenJDKs, LabsJDKs, or any other JDK following the same version scheme) based on the same build are considered valid.See
JVMCIVersionCheckOpenJDKTest.java
for more examples.GraalVM Releases
The current plan is to use the official early access builds only during development. In the stabilization phase before a release and for the release itself, we will switch back to self-built LabsJDKs, as we did for previous releases.
Note: this PR does not yet moves mainline development to an official early access JDK build. It only adds the version checking capabilities in preparation for the move.