Skip to content

Commit e13880e

Browse files
OracleLabsAutomationzapster
authored andcommitted
[GR-70822] [GR-70870] Update labsjdk to 25+37-jvmci-25.1-b07
PullRequest: graal/22402
2 parents 125643f + 4ec8215 commit e13880e

File tree

11 files changed

+492
-169
lines changed

11 files changed

+492
-169
lines changed

common.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@
4949
"graalvm-ee-25-ea": {"name": "graalvm-jdk", "version": "25.0.0", "ea": "36", "platformspecific": true },
5050

5151
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+37", "platformspecific": true, "extrabundles": ["static-libs"]},
52-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+37-jvmci-b06", "platformspecific": true },
53-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+37-jvmci-b06-debug", "platformspecific": true },
54-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+37-jvmci-b06-sulong", "platformspecific": true },
55-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+37-jvmci-b06", "platformspecific": true },
56-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+37-jvmci-b06-debug", "platformspecific": true },
57-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+37-jvmci-b06-sulong", "platformspecific": true }
52+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+37-jvmci-25.1-b07", "platformspecific": true },
53+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+37-jvmci-25.1-b07-debug", "platformspecific": true },
54+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+37-jvmci-25.1-b07-sulong", "platformspecific": true },
55+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+37-jvmci-25.1-b07", "platformspecific": true },
56+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+37-jvmci-25.1-b07-debug", "platformspecific": true },
57+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+37-jvmci-25.1-b07-sulong", "platformspecific": true }
5858
},
5959

6060
"eclipse": {

compiler/mx.compiler/mx_compiler.py

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -125,44 +125,41 @@ def feature(self):
125125

126126
@total_ordering
127127
class JVMCIVersionCheckVersion(object):
128-
def __init__(self, jdk_version, jvmci_major, jvmci_minor, jvmci_build):
128+
def __init__(self, jdk_version, release_name, jvmci_build):
129129
"""
130130
Python version of jdk.graal.compiler.hotspot.JVMCIVersionCheck.Version
131131
132132
jdk_version is a JavaLangRuntimeVersion
133133
jvmci_major and jvmci_minor might be 0 if not needed (JDK 22+)
134134
"""
135135
assert isinstance(jdk_version, JavaLangRuntimeVersion)
136-
assert isinstance(jvmci_major, int)
137-
assert isinstance(jvmci_minor, int)
138136
assert isinstance(jvmci_build, int)
139137
self.jdk_version = jdk_version
140-
self.jvmci_major = jvmci_major
141-
self.jvmci_minor = jvmci_minor
138+
self.release_name = release_name
142139
self.jvmci_build = jvmci_build
143140

144-
def _as_tuple(self):
145-
return (self.jdk_version, self.jvmci_major, self.jvmci_minor, self.jvmci_build)
146-
147141
def __eq__(self, other):
148142
if not isinstance(other, JVMCIVersionCheckVersion):
149143
return False
150-
return self._as_tuple() == other._as_tuple()
144+
return (self.jdk_version, self.release_name, self.jvmci_build) == (other.jdk_version, other.release_name, other.jvmci_build)
151145

152146
def __lt__(self, other):
153147
if not isinstance(other, JVMCIVersionCheckVersion):
154148
return NotImplemented
155-
return self._as_tuple() < other._as_tuple()
149+
if self.release_name != other.release_name:
150+
# cannot compare versions with different release_names
151+
return NotImplemented
152+
return (self.jdk_version, self.jvmci_build) < (other.jdk_version, other.jvmci_build)
156153

157154
def __str__(self):
158-
jdk_version, jvmci_major, jvmci_minor, jvmci_build = self._as_tuple()
159-
if jvmci_major == 0:
155+
jdk_version, release_name, jvmci_build = (self.jdk_version, self.release_name, self.jvmci_build)
156+
if not release_name:
160157
if jvmci_build == 0:
161158
return f'(openjdk|oraclejdk)-{jdk_version}'
162159
else:
163160
return f'labsjdk-(ce|ee)-{jdk_version}-jvmci-b{jvmci_build:02d}'
164161
else:
165-
return f'labsjdk-(ce|ee)-{jdk_version}-jvmci-{jvmci_major}.{jvmci_minor}-b{jvmci_build:02d}'
162+
return f'labsjdk-(ce|ee)-{jdk_version}-jvmci-{release_name}-b{jvmci_build:02d}'
166163

167164

168165
_jdk_jvmci_version = None
@@ -181,8 +178,8 @@ def _capture_jvmci_version(args=None):
181178
_run_jvmci_version_check(args, jdk=jdk, out=out)
182179
if out.data:
183180
try:
184-
(jdk_version, jvmci_major, jvmci_minor, jvmci_build) = out.data.split(',')
185-
return JVMCIVersionCheckVersion(JavaLangRuntimeVersion(jdk_version), int(jvmci_major), int(jvmci_minor), int(jvmci_build))
181+
(jdk_version, release_name, jvmci_build) = out.data.split(',')
182+
return JVMCIVersionCheckVersion(JavaLangRuntimeVersion(jdk_version), None if release_name == "null" else release_name, int(jvmci_build))
186183
except ValueError:
187184
mx.warn(f'Could not parse jvmci version from JVMCIVersionCheck output:\n{out.data}')
188185
return None
@@ -1224,7 +1221,7 @@ def _check_latest_jvmci_version():
12241221
the JVMCI version of the JVMCI JDKs in the "jdks" section of the
12251222
``common.json`` file and issues a warning if not.
12261223
"""
1227-
jvmci_re = re.compile(r'(?:ce|ee)-(?P<jdk_version>.+)-jvmci(?:-(?P<jvmci_major>\d+)\.(?P<jvmci_minor>\d+))?-b(?P<jvmci_build>\d+)')
1224+
jvmci_re = re.compile(r'(?:ce|ee)-(?P<jdk_version>.+)-jvmci(?:-(?P<release_name>.+))?-b(?P<jvmci_build>\d+)')
12281225
common_path = os.path.normpath(join(_suite.dir, '..', 'common.json'))
12291226

12301227
if _jdk_jvmci_version is None:
@@ -1242,13 +1239,13 @@ def get_latest_jvmci_version():
12421239
match = jvmci_re.match(version)
12431240
if not match:
12441241
mx.abort(f'Cannot parse version {version}')
1245-
(jdk_version, jvmci_major, jvmci_minor, jvmci_build) = match.groups(default=0)
1242+
(jdk_version, release_name, jvmci_build) = match.groups(default=None)
12461243
if _jdk_jvmci_version.jvmci_build == 0:
12471244
# jvmci_build == 0 indicates an OpenJDK version has been specified in JVMCIVersionCheck.java.
12481245
# The JDK does not know the jvmci_build number that might have been specified in common.json,
12491246
# as it is only a repackaged JDK. Thus, we reset the jvmci_build because we cannot validate it.
12501247
jvmci_build = 0
1251-
current = JVMCIVersionCheckVersion(JavaLangRuntimeVersion(jdk_version), int(jvmci_major), int(jvmci_minor), int(jvmci_build))
1248+
current = JVMCIVersionCheckVersion(JavaLangRuntimeVersion(jdk_version), release_name, int(jvmci_build))
12521249
if current.jdk_version.feature() == _jdk_jvmci_version.jdk_version.feature():
12531250
# only compare the same major versions
12541251
if latest == 'not found':
@@ -1284,12 +1281,18 @@ def get_latest_jvmci_version():
12841281
msg += ' suppress this error.'
12851282
mx.abort(msg)
12861283

1287-
if success and _jdk_jvmci_version < latest:
1288-
msg = f'JVMCI version of JAVA_HOME is older than in {common_path}: {_jdk_jvmci_version} < {latest} '
1289-
msg += os.linesep + 'This poses the risk of hitting JVMCI bugs that have already been fixed.'
1290-
msg += os.linesep + f'Consider using {latest}, which you can get via:'
1291-
msg += os.linesep + f'mx fetch-jdk --configuration {common_path}'
1292-
mx.abort_or_warn(msg, version_check_setting == 'strict')
1284+
if success:
1285+
msg_suffix = os.linesep + 'This poses the risk of hitting JVMCI bugs that have already been fixed.'
1286+
msg_suffix += os.linesep + f'Consider using {latest}, which you can get via:'
1287+
msg_suffix += os.linesep + f'mx fetch-jdk --configuration {common_path}'
1288+
try:
1289+
if _jdk_jvmci_version < latest:
1290+
msg = f'JVMCI version of JAVA_HOME is older than in {common_path}: {_jdk_jvmci_version} < {latest}' + msg_suffix
1291+
mx.abort_or_warn(msg, version_check_setting == 'strict')
1292+
except TypeError:
1293+
msg = f'JVMCI version of JAVA_HOME incompatible with the version specified in {common_path}: {_jdk_jvmci_version} vs. {latest}' + msg_suffix
1294+
mx.abort_or_warn(msg, version_check_setting == 'strict')
1295+
12931296

12941297
class GraalArchiveParticipant:
12951298
providersRE = re.compile(r'(?:META-INF/versions/([1-9][0-9]*)/)?META-INF/providers/(.+)')

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/JVMCIVersionCheckLTSTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,25 +24,26 @@
2424
*/
2525
package jdk.graal.compiler.hotspot.test;
2626

27-
import jdk.graal.compiler.core.test.GraalCompilerTest;
28-
import jdk.graal.compiler.hotspot.JVMCIVersionCheck;
2927
import org.junit.Assert;
3028
import org.junit.Test;
3129

30+
import jdk.graal.compiler.core.test.GraalCompilerTest;
31+
import jdk.graal.compiler.hotspot.JVMCIVersionCheck;
32+
3233
/**
3334
* Tests that {@link JVMCIVersionCheck} can strip the -LTS suffix.
3435
*/
3536
public class JVMCIVersionCheckLTSTest extends GraalCompilerTest {
3637

3738
private static void expect(String jdkVersionString, String expected) {
38-
JVMCIVersionCheck.Version version = JVMCIVersionCheck.createLabsJDKVersion(jdkVersionString, 1);
39+
JVMCIVersionCheck.Version version = JVMCIVersionCheck.createLabsJDKVersion(jdkVersionString, "myrelease", 1);
3940
Assert.assertEquals(expected, version.stripLTS().toString());
4041
}
4142

4243
@Test
4344
public void test() {
44-
expect("24+17", "24+17-jvmci-b01");
45-
expect("25+1", "25+1-jvmci-b01");
46-
expect("25+1-LTS", "25+1-jvmci-b01");
45+
expect("24+17", "24+17-jvmci-myrelease-b01");
46+
expect("25+1", "25+1-jvmci-myrelease-b01");
47+
expect("25+1-LTS", "25+1-jvmci-myrelease-b01");
4748
}
4849
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
package jdk.graal.compiler.hotspot.test;
26+
27+
import java.io.ByteArrayOutputStream;
28+
import java.io.PrintStream;
29+
import java.util.Arrays;
30+
31+
import org.junit.Assert;
32+
import org.junit.Test;
33+
34+
import jdk.graal.compiler.core.test.GraalCompilerTest;
35+
import jdk.graal.compiler.hotspot.JVMCIVersionCheck;
36+
37+
/**
38+
* Tests {@link JVMCIVersionCheck#main(String[])} argument handling. This focuses on covering all
39+
* accepted flags and the unknown-argument path while avoiding the default path that may call
40+
* System.exit on version check failure.
41+
*/
42+
public class JVMCIVersionCheckMain extends GraalCompilerTest {
43+
44+
private static String runMainCaptureOut(String... args) {
45+
PrintStream originalOut = System.out;
46+
ByteArrayOutputStream baos = new ByteArrayOutputStream();
47+
PrintStream capture = new PrintStream(baos);
48+
try {
49+
System.setOut(capture);
50+
JVMCIVersionCheck.main(args);
51+
} finally {
52+
System.setOut(originalOut);
53+
}
54+
return baos.toString();
55+
}
56+
57+
@Test
58+
public void testNoArgument() {
59+
String out = runMainCaptureOut();
60+
Assert.assertNotNull(out);
61+
Assert.assertFalse("no output produced", out.isEmpty());
62+
String[] split = out.strip().split(",");
63+
Assert.assertEquals("unexpected length of result: " + Arrays.toString(split), 3, split.length);
64+
JVMCIVersionCheck.createLabsJDKVersion(split[0], split[1], Integer.parseInt(split[2]));
65+
}
66+
67+
@Test
68+
public void testMinVersionTuple() {
69+
String out = runMainCaptureOut("--min-version");
70+
Assert.assertNotNull(out);
71+
Assert.assertFalse("no output produced", out.isEmpty());
72+
String[] split = out.strip().split(",");
73+
Assert.assertEquals("unexpected length of result: " + Arrays.toString(split), 3, split.length);
74+
JVMCIVersionCheck.createLabsJDKVersion(split[0], split[1], Integer.parseInt(split[2]));
75+
}
76+
77+
@Test
78+
public void testMinVersionAsTag() {
79+
String out = runMainCaptureOut("--min-version", "--as-tag");
80+
Assert.assertNotNull(out);
81+
Assert.assertFalse(out.contains("No minimum JVMCI version specified for JDK version"));
82+
// check that the output is a valid version
83+
Runtime.Version.parse(out.strip());
84+
}
85+
86+
@Test(expected = IllegalArgumentException.class)
87+
public void testUnknownArgument() {
88+
JVMCIVersionCheck.main(new String[]{"--unknown-flag"});
89+
}
90+
}

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/JVMCIVersionCheckMaxValueTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -36,24 +36,25 @@
3636
*/
3737
public class JVMCIVersionCheckMaxValueTest extends GraalCompilerTest {
3838

39-
public static final String EXPECTED_MSG = "Cannot read JVMCI version from java.vm.version property";
39+
public static final String EXPECTED_MSG_CANNOT_READ = "Cannot read JVMCI version from java.vm.version property";
40+
public static final String EXPECTED_MSG_INCOMPARABLE = "Graal expected a JVMCI release version";
4041

4142
@Test
42-
public void testLegacyVersion() {
43-
for (String version : new String[]{"20.0-b" + Long.MAX_VALUE, "20." + Long.MAX_VALUE + "-b1", Long.MAX_VALUE + ".0-b1"}) {
44-
testVersion(String.format("prefix-jvmci-%s-suffix", version));
43+
public void testCurrentVersion() {
44+
for (String version : new String[]{"20.0-b" + Long.MAX_VALUE, "20." + Long.MAX_VALUE + "-b1", Long.MAX_VALUE + ".0-b1", "myrelease"}) {
45+
testVersion(String.format("99.0.1-jvmci-%s-suffix", version));
4546
}
4647
}
4748

4849
@Test
49-
public void testNewVersion() {
50+
public void testVersionUntilGraalVmForJDK25() {
5051
// We only want to test jvmciBuild, not Runtime.Version, so we use a fixed jdkVersion string
5152
testVersion(String.format("99.0.1-jvmci-b%s-suffix", Long.MAX_VALUE));
5253
}
5354

5455
private static void testVersion(String javaVmVersion) {
5556
try {
56-
JVMCIVersionCheck.Version minVersion = JVMCIVersionCheck.createLegacyVersion(20, 0, 1);
57+
JVMCIVersionCheck.Version minVersion = JVMCIVersionCheck.createLabsJDKVersion("99.0.1", "20.0", 1);
5758
// Use a javaSpecVersion that will likely not fail in the near future
5859
String javaSpecVersion = "99";
5960
var props = JVMCIVersionCheckTest.createTestProperties(javaSpecVersion, javaVmVersion, null);
@@ -65,8 +66,8 @@ private static void testVersion(String javaVmVersion) {
6566
Assert.fail("expected to fail checking " + javaVmVersion + " against " + minVersion);
6667
}
6768
} catch (InternalError e) {
68-
if (!e.getMessage().contains(EXPECTED_MSG)) {
69-
throw new AssertionError("Unexpected exception message. Expected: " + EXPECTED_MSG, e);
69+
if (!e.getMessage().contains(EXPECTED_MSG_INCOMPARABLE) && !e.getMessage().contains(EXPECTED_MSG_CANNOT_READ)) {
70+
throw new AssertionError("Unexpected exception message. Expected: " + EXPECTED_MSG_INCOMPARABLE + " or " + EXPECTED_MSG_CANNOT_READ, e);
7071
}
7172
}
7273
}

0 commit comments

Comments
 (0)