Skip to content

Commit d9161d8

Browse files
[GR-69961] [GR-69475] [GR-53685] Update JDK 25 for espresso.
PullRequest: graal/21692
2 parents 7c40635 + 0d952cc commit d9161d8

File tree

27 files changed

+597
-127
lines changed

27 files changed

+597
-127
lines changed

ci/common.jsonnet

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,26 @@ local common_json = import "../common.json";
5959
'oraclejdk24': jdk_base + common_json.jdks["oraclejdk24"] + { jdk_version:: 24 },
6060
} + {
6161
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: 25 }
62-
for name in ["oraclejdk25"] + variants("labsjdk-ce-25") + variants("labsjdk-ee-25")
62+
for name in ["oraclejdk25"]
63+
} + {
64+
# Synthesize labsjdk-*-25 from labsjdk-*-latest
65+
# This is intended for jobs that specifically need the 25 LTS JDK (e.g., espresso for its guest).
66+
# When running the compiler or the native image generator "latest" should be used instead.
67+
# When latest moves past 25, jobs using 25 should be reviwed and if they are still needed labsjdk-(ce|ee)-25 should
68+
# be added to common.json.
69+
# Note that the assert below unfortunately doesn't work in the sjsonnet version used currently in the CI (GR-40975).
70+
[std.strReplace(name, 'latest', '25')]: jdk_base + common_json.jdks[name] + { assert parse_labsjdk_version(self) == 25, jdk_version:: 25 }
71+
for name in variants("labsjdk-ce-latest") + variants("labsjdk-ee-latest")
6372
} + {
6473
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: parse_labsjdk_version(self), jdk_name:: "jdk-latest"}
6574
for name in ["oraclejdk-latest"] + variants("labsjdk-ce-latest") + variants("labsjdk-ee-latest")
6675
} + {
6776
'graalvm-ee-21': jdk_base + common_json.jdks["graalvm-ee-21"] + { jdk_version:: 21 },
6877
'graalvm-ee-25-ea': jdk_base + common_json.jdks["graalvm-ee-25-ea"] + { jdk_version:: 25 },
6978
},
70-
# We do not want to expose galahad-jdk
71-
assert std.assertEqual([x for x in std.objectFields(common_json.jdks) if x != "galahad-jdk"], std.objectFields(jdks_data)),
79+
# We do not want to expose galahad-jdk, labsjdk-(ce|ee)-25 are synthetized from latest
80+
local is_labsjdk_25(x) = std.startsWith(x, "labsjdk-ee-25") || std.startsWith(x, "labsjdk-ce-25"),
81+
assert std.assertEqual([x for x in std.objectFields(common_json.jdks) if x != "galahad-jdk"], [x for x in std.objectFields(jdks_data) if !is_labsjdk_25(x)]),
7282
# Verify oraclejdk-latest and labsjdk-ee-latest versions match
7383
assert
7484
local _labsjdk = common_json.jdks["labsjdk-ee-latest"];

common.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@
4545

4646
"oraclejdk24": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24.0.1+9", "platformspecific": true, "extrabundles": ["static-libs"]},
4747

48-
"oraclejdk25": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+30", "platformspecific": true, "extrabundles": ["static-libs"]},
49-
"labsjdk-ce-25": {"name": "labsjdk", "version": "ce-25+30-jvmci-b01", "platformspecific": true },
50-
"labsjdk-ce-25Debug": {"name": "labsjdk", "version": "ce-25+30-jvmci-b01-debug", "platformspecific": true },
51-
"labsjdk-ce-25-llvm": {"name": "labsjdk", "version": "ce-25+30-jvmci-b01-sulong", "platformspecific": true },
52-
"labsjdk-ee-25": {"name": "labsjdk", "version": "ee-25+30-jvmci-b01", "platformspecific": true },
53-
"labsjdk-ee-25Debug": {"name": "labsjdk", "version": "ee-25+30-jvmci-b01-debug", "platformspecific": true },
54-
"labsjdk-ee-25-llvm": {"name": "labsjdk", "version": "ee-25+30-jvmci-b01-sulong", "platformspecific": true },
48+
"oraclejdk25": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+37", "platformspecific": true, "extrabundles": ["static-libs"]},
5549
"graalvm-ee-25-ea": {"name": "graalvm-jdk", "version": "25.0.0", "ea": "36", "platformspecific": true },
5650

5751
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+37", "platformspecific": true, "extrabundles": ["static-libs"]},

compiler/mx.compiler/mx_compiler.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,13 +1253,12 @@ def get_latest_jvmci_version():
12531253
# only compare the same major versions
12541254
if latest == 'not found':
12551255
latest = current
1256-
# [GR-69961] temporarily disable until labsjdk-ce|ee-25 is gone from common.json
1257-
# elif latest != current:
1258-
# # All JVMCI JDKs in common.json with the same major version
1259-
# # are expected to have the same JVMCI version.
1260-
# # If they don't then the repo is in some transitionary state
1261-
# # (e.g. making a JVMCI release) so skip the check.
1262-
# return False, distribution
1256+
elif latest != current:
1257+
# All JVMCI JDKs in common.json with the same major version
1258+
# are expected to have the same JVMCI version.
1259+
# If they don't then the repo is in some transitionary state
1260+
# (e.g. making a JVMCI release) so skip the check.
1261+
return False, distribution
12631262
return not isinstance(latest, str), latest
12641263

12651264
version_check_setting = os.environ.get('JVMCI_VERSION_CHECK', None)

espresso/ci/ci_common/common.jsonnet

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];
192192
jdk21_on_demand_bench_darwin : self.onDemandBench + self.darwin_amd64_21,
193193
jdk21_on_demand_bench_windows : self.onDemandBench + self.windows_21,
194194

195-
jdk25_tier1_linux_amd64 : self.tier1 + self.linux_amd64_25,
196-
jdk25_tier2_linux_amd64 : self.tier2 + self.linux_amd64_25,
195+
jdk25_tier1_linux_amd64 : self.tier1 + self.linux_amd64_25,
196+
jdk25_tier2_linux_amd64 : self.tier2 + self.linux_amd64_25,
197197
jdk25_tier3_linux_amd64 : self.tier3 + self.linux_amd64_25,
198198
jdk25_tier3_linux_aarch64 : self.tier3 + self.linux_aarch64_25,
199199
jdk25_tier3_darwin_aarch64 : self.tier3 + self.darwin_aarch64_25,
@@ -205,6 +205,15 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];
205205
jdk25_daily_darwin_aarch64 : self.daily + self.darwin_aarch64_25,
206206
jdk25_daily_windows_amd64 : self.daily + self.windows_25,
207207
jdk25_weekly_linux_amd64 : self.weekly + self.linux_amd64_25,
208+
jdk25_weekly_linux_aarch64 : self.weekly + self.linux_aarch64_25,
209+
jdk25_weekly_darwin_amd64 : self.weekly + self.darwin_amd64_25,
210+
jdk25_weekly_darwin_aarch64 : self.weekly + self.darwin_aarch64_25,
211+
jdk25_weekly_windows_amd64 : self.weekly + self.windows_25,
212+
jdk25_monthly_linux_amd64 : self.monthly + self.linux_amd64_25,
213+
jdk25_monthly_linux_aarch64 : self.monthly + self.linux_aarch64_25,
214+
jdk25_monthly_darwin_amd64 : self.monthly + self.darwin_amd64_25,
215+
jdk25_monthly_darwin_aarch64 : self.monthly + self.darwin_aarch64_25,
216+
jdk25_monthly_windows_amd64 : self.monthly + self.windows_25,
208217

209218
jdkLatest_tier1_linux_amd64 : self.tier1 + self.linux_amd64_latest,
210219
jdkLatest_tier2_linux_amd64 : self.tier2 + self.linux_amd64_latest,

espresso/mx.espresso/suite.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#
2323

2424
suite = {
25-
"mxversion": "7.58.0",
25+
"mxversion": "7.59.0",
2626
"name": "espresso",
2727
"version" : "25.1.0",
2828
"release" : False,
@@ -175,6 +175,7 @@
175175
"java.logging",
176176
"jdk.unsupported", # sun.misc.Signal
177177
"java.management",
178+
"jdk.management",
178179
],
179180
"uses": [
180181
"com.oracle.truffle.espresso.ffi.NativeAccess.Provider",
@@ -229,7 +230,7 @@
229230
"requires": [
230231
"java.logging",
231232
],
232-
"javaCompliance" : "17+",
233+
"javaCompliance" : "21+",
233234
"checkstyle": "com.oracle.truffle.espresso",
234235
},
235236

@@ -288,7 +289,7 @@
288289
"os_arch": {
289290
"windows": {
290291
"<others>": {
291-
"cflags": ["-g", "-O3", "-Wall"],
292+
"cflags": ["-Zi", "-O2", "-Wall"],
292293
"multitarget": {
293294
"libc": ["default"],
294295
},
@@ -395,7 +396,7 @@
395396
},
396397
"windows": {
397398
"<others>": {
398-
"cflags": ["-g", "-O3", "-Wall"],
399+
"cflags": ["-Zi", "-O2", "-Wall", "-std:c11"],
399400
"multitarget": {
400401
"libc": ["default"],
401402
},

espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/Arguments.java

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@
3131
import java.util.Arrays;
3232
import java.util.BitSet;
3333
import java.util.Comparator;
34+
import java.util.Formatter;
3435
import java.util.List;
3536
import java.util.Map;
3637
import java.util.Set;
38+
import java.util.logging.Handler;
39+
import java.util.logging.Level;
40+
import java.util.logging.LogRecord;
3741

3842
import org.graalvm.nativeimage.RuntimeOptions;
3943
import org.graalvm.nativeimage.c.struct.SizeOf;
@@ -49,10 +53,8 @@
4953

5054
public final class Arguments {
5155
private static final PrintStream STDERR = System.err;
52-
private static final PrintStream STDOUT = System.out;
53-
54-
public static final String JAVA_PROPS = "java.Properties.";
5556

57+
private static final String JAVA_PROPS = "java.Properties.";
5658
private static final String AGENT_LIB = "java.AgentLib.";
5759
private static final String AGENT_PATH = "java.AgentPath.";
5860
public static final String JAVA_AGENT = "java.JavaAgent";
@@ -210,6 +212,16 @@ public static int setupContext(Context.Builder builder, JNIJavaVMInitArgs args,
210212
printFlagsFinal = true;
211213
} else if ("-XX:-PrintFlagsFinal".equals(optionString)) {
212214
printFlagsFinal = false;
215+
} else if ("-XX:+DisplayVMOutput".equals(optionString)) {
216+
handler.setDisplayVMOutput(true);
217+
} else if ("-XX:-DisplayVMOutput".equals(optionString)) {
218+
handler.setDisplayVMOutput(false);
219+
} else if ("-XX:+LogVMOutput".equals(optionString)) {
220+
handler.setLogVMOutput(true);
221+
} else if ("-XX:-LogVMOutput".equals(optionString)) {
222+
handler.setLogVMOutput(false);
223+
} else if (optionString.startsWith("-XX:LogFile=")) {
224+
handler.setLogFile(optionString.substring("-XX:LogFile=".length()));
213225
} else if (optionString.startsWith("--vm.")) {
214226
handler.handleVMOption(optionString);
215227
} else if (optionString.startsWith("-Xcomp")) {
@@ -260,15 +272,6 @@ public static int setupContext(Context.Builder builder, JNIJavaVMInitArgs args,
260272
RuntimeOptions.set(xOption.substring(2 /* drop the -X */), null);
261273
}
262274

263-
if (printFlagsFinal) {
264-
STDOUT.println("[Global flags]");
265-
List<RuntimeOptions.Descriptor> descriptors = RuntimeOptions.listDescriptors();
266-
descriptors.sort(Comparator.comparing((RuntimeOptions.Descriptor d) -> d.name()));
267-
for (RuntimeOptions.Descriptor descriptor : descriptors) {
268-
printOption(descriptor);
269-
}
270-
}
271-
272275
if (bootClasspathPrepend != null) {
273276
builder.option("java.BootClasspathPrepend", bootClasspathPrepend);
274277
}
@@ -285,10 +288,24 @@ public static int setupContext(Context.Builder builder, JNIJavaVMInitArgs args,
285288
}
286289

287290
handler.argumentProcessingDone();
291+
292+
if (printFlagsFinal) {
293+
// this must be called after argumentProcessingDone
294+
Handler logHandler = handler.getLogHandler();
295+
StringBuilder sb = new StringBuilder("[Global flags]");
296+
sb.append(System.lineSeparator());
297+
List<RuntimeOptions.Descriptor> descriptors = RuntimeOptions.listDescriptors();
298+
descriptors.sort(Comparator.comparing(RuntimeOptions.Descriptor::name));
299+
for (RuntimeOptions.Descriptor descriptor : descriptors) {
300+
printOption(descriptor, sb);
301+
}
302+
logHandler.publish(new LogRecord(Level.INFO, sb.toString()));
303+
}
304+
288305
return JNIErrors.JNI_OK();
289306
}
290307

291-
private static void printOption(RuntimeOptions.Descriptor descriptor) {
308+
private static void printOption(RuntimeOptions.Descriptor descriptor, StringBuilder sb) {
292309
// see JVMFlag::print_on
293310
Class<?> valueType = descriptor.valueType();
294311
String typeName;
@@ -305,7 +322,7 @@ private static void printOption(RuntimeOptions.Descriptor descriptor) {
305322
} else {
306323
typeName = valueType.getSimpleName();
307324
}
308-
STDOUT.printf("%21s %-39s = %s%n", typeName, descriptor.name(), RuntimeOptions.get(descriptor.name()));
325+
new Formatter(sb).format("%21s %-39s = %s%n", typeName, descriptor.name(), RuntimeOptions.get(descriptor.name()));
309326
}
310327

311328
private static void buildJvmArg(List<String> jvmArgs, String optionString) {

espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/ArgumentsHandler.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.Map;
3333
import java.util.Set;
3434
import java.util.function.Consumer;
35+
import java.util.logging.Handler;
3536

3637
import org.graalvm.nativeimage.c.struct.SizeOf;
3738
import org.graalvm.nativeimage.c.type.CCharPointer;
@@ -422,4 +423,20 @@ private void printHelp(Consumer<OptionCategory> printer) {
422423
printer.accept(OptionCategory.USER);
423424
}
424425
}
426+
427+
public void setLogFile(String logFileName) {
428+
polyglotAccess.setLogFile(logFileName);
429+
}
430+
431+
public void setDisplayVMOutput(boolean value) {
432+
polyglotAccess.setDisplayVMOutput(value);
433+
}
434+
435+
public void setLogVMOutput(boolean value) {
436+
polyglotAccess.setLogVMOutput(value);
437+
}
438+
439+
public Handler getLogHandler() {
440+
return polyglotAccess.getLogHandler();
441+
}
425442
}

0 commit comments

Comments
 (0)