forked from Karm/mandrel-integration-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Mandrel IT runs with JDK 22-based builds
- Loading branch information
Showing
1 changed file
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
|
@@ -69,6 +70,12 @@ | |
* GraalVM Runtime Environment GraalVM CE (build 20+34-jvmci-23.0-b10) | ||
* Substrate VM GraalVM CE (build 20+34, serial gc) | ||
* | ||
* or | ||
* | ||
* native-image 22 2024-03-19 | ||
* GraalVM Runtime Environment GraalVM CE 22-dev+15.1 (build 22+15-jvmci-b01) | ||
* Substrate VM GraalVM CE 22-dev+15.1 (build 22+15, serial gc) | ||
* | ||
* @author Michal Karm Babacek <[email protected]> | ||
*/ | ||
public class UsedVersion { | ||
|
@@ -97,6 +104,11 @@ public static int jdkUpdate(boolean inContainer) { | |
// Implements version parsing after https://github.com/oracle/graal/pull/6302 | ||
static final class VersionParseHelper { | ||
|
||
private static final Map<Integer, String> GRAAL_MAPPING = Map.of(22, "24.0", | ||
23, "24.1", | ||
24, "25.0", | ||
25, "25.1"); | ||
|
||
private static final String JVMCI_BUILD_PREFIX = "jvmci-"; | ||
private static final String MANDREL_VERS_PREFIX = "Mandrel-"; | ||
|
||
|
@@ -145,7 +157,7 @@ static MVersion parse(List<String> lines) { | |
String vendorVersion = secondMatcher.group(VENDOR_VERSION_GROUP); | ||
|
||
String buildInfo = secondMatcher.group(BUILD_INFO_GROUP); | ||
String graalVersion = graalVersion(buildInfo); | ||
String graalVersion = graalVersion(buildInfo, v.feature()); | ||
String mandrelVersion = mandrelVersion(vendorVersion); | ||
String versNum = (isMandrel(vendorVersion) ? mandrelVersion : graalVersion); | ||
Version vers = versionParse(versNum); | ||
|
@@ -191,7 +203,11 @@ private static String matchVersion(String version) { | |
return null; | ||
} | ||
|
||
private static String graalVersion(String buildInfo) { | ||
private static String graalVersion(String buildInfo, int jdkFeatureVers) { | ||
if (jdkFeatureVers >= 22) { | ||
// short-circuit new version scheme with a mapping | ||
return GRAAL_MAPPING.get(Integer.valueOf(jdkFeatureVers)); | ||
} | ||
if (buildInfo == null) { | ||
return null; | ||
} | ||
|