Skip to content

Commit 6391b63

Browse files
authored
Merge pull request #48692 from zakkak/2025-06-30-fix-mandrel-25-version-parsing
Fix version parsing for Mandrel 25
2 parents 882c029 + 0b1237b commit 6391b63

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public void testGraalVMVersionDetected() {
3434
Version.of(Stream.of(("native-image 26 2026-03-17\n"
3535
+ "GraalVM Runtime Environment GraalVM CE 26-dev+1.1 (build 26+1-jvmci-b01)\n"
3636
+ "Substrate VM GraalVM CE 26-dev+1.1 (build 26+1, serial gc)").split("\\n"))));
37+
assertVersion(new Version("GraalVM 25.0.0", "25.0.0", GRAALVM), MANDREL,
38+
Version.of(Stream.of(("native-image 25-beta 2025-09-16\n" +
39+
"OpenJDK Runtime Environment Mandrel-25.0.0.0-dev2df1dd18912 (build 25-beta+29-ea)\n" +
40+
"OpenJDK 64-Bit Server VM Mandrel-25.0.0.0-dev2df1dd18912 (build 25-beta+29-ea, mixed mode)")
41+
.split("\n"))));
3742
// Version detection after: https://github.com/oracle/graal/pull/6302 (3 lines of version output)
3843
assertVersion(new Version("GraalVM 23.0.0", "23.0.0", GRAALVM), MANDREL,
3944
Version.of(Stream.of(("native-image 17.0.6 2023-01-17\n"
@@ -223,6 +228,7 @@ public void testGraalVMVersionsOlderThan() {
223228
"GraalVM CE 25-dev+26.1|25.0|25|0",
224229
"GraalVM CE 24.0.1+9.1 |24.2|24|1",
225230
// Mandrel
231+
"Mandrel-25.0.0.0-dev2df1dd18912|25.0|25|0",
226232
"Mandrel-24.2.1.0-Final|24.2|24|1",
227233
"Mandrel-23.1.7.0-1b2 |23.1|21|7",
228234
// Liberica-NIK

core/runtime/src/main/java/io/quarkus/runtime/graal/GraalVM.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ private static String communityJDKvers(String communityVersion) {
167167
String feature = MANDREL_JDK_REV_MAP.getOrDefault(mandrelMajorMinor, parts[0]);
168168
// Heuristic: The update version of Mandrel and the JDK match.
169169
// Interim is usually 0 for the JDK version.
170+
// Skip trailing zeroes, as they are not supported by java.lang.Runtime.Version.parse.
171+
if ("0".equals(parts[2])) {
172+
return feature;
173+
}
170174
return String.format("%s.%s.%s", feature, "0", parts[2]);
171175
}
172176
} catch (Throwable e) {

0 commit comments

Comments
 (0)