Skip to content

Commit

Permalink
Warn users when using older GraalVM or Mandrel versions
Browse files Browse the repository at this point in the history
Although we try to keep backwards compatibility with older GraalVM or
Mandrel versions, these versions should not be considered as fully
supported by the users, as the compatibility might break at any
time (even at a minor level patch).
  • Loading branch information
zakkak committed Apr 3, 2024
1 parent 64382b5 commit c84ac1d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,21 @@ public static final class Version implements Comparable<Version> {
public static final Version VERSION_23_1_0 = new Version("GraalVM 23.1.0", "23.1.0", "21", Distribution.GRAALVM);
public static final Version VERSION_24_0_0 = new Version("GraalVM 24.0.0", "24.0.0", "22", Distribution.GRAALVM);

/**
* The minimum version of GraalVM supported by Quarkus.
* Versions prior to this are expected to cause major issues.
*/
public static final Version MINIMUM = VERSION_22_2_0;
/**
* The current version of GraalVM supported by Quarkus.
* This version is the one actively being tested and is expected to give the best experience.
*/
public static final Version CURRENT = VERSION_23_1_0;
/**
* The minimum version of GraalVM officially supported by Quarkus.
* Versions prior to this are expected to work but are not given the same level of testing or priority.
*/
public static final Version MINIMUM_SUPPORTED = CURRENT;

final String fullVersion;
public final Runtime.Version javaVersion;
Expand Down Expand Up @@ -227,6 +240,10 @@ boolean isObsolete() {
return this.compareTo(MINIMUM) < 0;
}

boolean isSupported() {
return this.compareTo(MINIMUM_SUPPORTED) >= 0;
}

boolean isMandrel() {
return distribution == Distribution.MANDREL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,15 @@ private void checkGraalVMVersion(GraalVM.Version version) {
log.info("Running Quarkus native-image plugin on " + version.distribution.name() + " " + version.getVersionAsString()
+ " JDK " + version.javaVersion);
if (version.isObsolete()) {
throw new IllegalStateException("Out of date version of GraalVM detected: " + version.getVersionAsString() + "."
throw new IllegalStateException(
"Out of date version of GraalVM or Mandrel detected: " + version.getVersionAsString() + "."
+ " Quarkus currently supports " + GraalVM.Version.CURRENT.getVersionAsString()
+ ". Please upgrade to this version.");
}
if (!version.isSupported()) {
log.warn("You are using an older version of GraalVM or Mandrel : " + version.getVersionAsString() + "."
+ " Quarkus currently supports " + GraalVM.Version.CURRENT.getVersionAsString()
+ ". Please upgrade GraalVM to this version.");
+ ". Please upgrade to this version.");
}
}

Expand Down

0 comments on commit c84ac1d

Please sign in to comment.