Skip to content

Commit b4eb722

Browse files
Fix GrasalVM version checker in order to accept other implementations
1 parent 3c1d1a0 commit b4eb722

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/GraalVM.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ static final class VersionParseHelper {
3131

3232
private static final String VENDOR_VERS = "(?<VENDOR>.*)";
3333
private static final String JDK_DEBUG = "[^\\)]*"; // zero or more of >anything not a ')'<
34-
private static final String RUNTIME_NAME = "(?<RUNTIME>(?:OpenJDK|GraalVM) Runtime Environment) ";
34+
private static final String RUNTIME_NAME = "(?<RUNTIME>(?:.*) Runtime Environment) ";
3535
private static final String BUILD_INFO = "(?<BUILDINFO>.*)";
36-
private static final String VM_NAME = "(?<VM>(?:OpenJDK 64-Bit Server|Substrate) VM) ";
36+
private static final String VM_NAME = "(?<VM>(?:.*) VM) ";
3737

3838
private static final String FIRST_LINE_PATTERN = "native-image " + VSTR_FORMAT + " .*$";
3939
private static final String SECOND_LINE_PATTERN = RUNTIME_NAME

core/deployment/src/test/java/io/quarkus/deployment/pkg/steps/GraalVMTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ public void testGraalVMVersionDetected() {
6363
+ "GraalVM Runtime Environment GraalVM CE (build 20+34-jvmci-23.0-b10)\n"
6464
+ "Substrate VM GraalVM CE (build 20+34, serial gc)").split("\\n"))));
6565

66+
// Should also work for other unknown implementations of GraalVM
67+
assertVersion(new Version("GraalVM 23.0", "23.0", GRAALVM), GRAALVM,
68+
Version.of(Stream.of(("native-image 20 2023-07-30\n"
69+
+ "Foo Runtime Environment whatever (build 20+34-jvmci-23.0-b7)\n"
70+
+ "Foo VM whatever (build 20+34, serial gc)").split("\\n"))));
71+
assertVersion(new Version("GraalVM 23.0", "23.0", GRAALVM), GRAALVM,
72+
Version.of(Stream.of(("native-image 20 2023-07-30\n"
73+
+ "Another Runtime Environment whatever (build 20+34-jvmci-23.0-b7)\n"
74+
+ "Another VM whatever (build 20+34, serial gc)").split("\\n"))));
75+
6676
// Older version parsing
6777
assertVersion(new Version("GraalVM 20.1", "20.1", GRAALVM), GRAALVM,
6878
Version.of(Stream.of("GraalVM Version 20.1.0 (Java Version 11.0.7)")));

0 commit comments

Comments
 (0)