Skip to content

Commit beda3cc

Browse files
committed
[GR-33729] Switch SVM gates from JDK 8 to JDK 17.
PullRequest: graal/9768
2 parents 591cdec + b0d20e7 commit beda3cc

File tree

9 files changed

+32
-30
lines changed

9 files changed

+32
-30
lines changed

substratevm/ci_includes/gate.hocon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ gate-svm-js: {
1818
}
1919

2020
builds += [
21-
${oraclejdk8} ${svm-common-linux-gate} ${gate-svm-js} ${svm-capabilities-base} {
21+
${labsjdk-ce-17} ${svm-common-linux-gate} ${gate-svm-js} ${svm-capabilities-base} {
2222
name: "gate-svm-js"
2323
timelimit: "35:00"
2424
}
25-
${oraclejdk8} ${svm-common-darwin-gate} ${gate-svm-js} {
25+
${labsjdk-ce-17} ${svm-common-darwin-gate} ${gate-svm-js} {
2626
name: "gate-svm-darwin-js"
2727
}
2828
${labsjdk-ce-11} ${svm-common-linux-gate} ${linux-deploy} {
@@ -49,7 +49,7 @@ builds += [
4949
${svm-cmd-gate} ["build,hellomodule,test"]
5050
]
5151
}
52-
${oraclejdk8} ${svm-common-linux-gate} ${eclipse} ${jdt} ${linux-deploy} {
52+
${labsjdk-ce-17} ${svm-common-linux-gate} ${eclipse} ${jdt} ${linux-deploy} {
5353
name: "gate-svm-style-fullbuild"
5454
timelimit: "45:00"
5555
environment : {
@@ -60,7 +60,7 @@ builds += [
6060
${svm-cmd-gate} ["style,fullbuild,helloworld,test,svmjunit,maven"]
6161
]
6262
}
63-
${oraclejdk8} ${svm-common-gate} ${svm-common-windows-oraclejdk8} {
63+
${labsjdk-ce-17} ${svm-common-gate} ${svm-common-windows-jdk17} {
6464
name: "gate-svm-windows-basics"
6565
environment: {
6666
PATH : "$MVN_HOME;$PATH" # workaround until GR-10735 is resolved

substratevm/mx.substratevm/mx_substratevm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ def native_unittests_task():
443443
'-H:AdditionalSecurityServiceTypes=com.oracle.svm.test.SecurityServiceTest$JCACompliantNoOpService'
444444
]
445445

446+
if svm_java_compliance() == '17':
447+
# The following tests fail with --builder-on-modulepath enabled (GR-34117)
448+
mx_unittest.add_global_ignore_glob('com.oracle.svm.test.jdk11.jfr.*')
449+
if mx.is_windows():
450+
mx_unittest.add_global_ignore_glob('com.oracle.svm.test.SecurityServiceTest')
451+
446452
native_unittest(['--builder-on-modulepath', '--build-args', _native_unittest_features] + additional_build_args)
447453

448454

substratevm/mx.substratevm/suite.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,7 @@
247247
"com.oracle.svm.core.jdk15": {
248248
"subDir": "src",
249249
"sourceDirs": ["src"],
250-
"dependencies": [
251-
"com.oracle.svm.core",
252-
"com.oracle.svm.core.jdk11"
253-
],
250+
"dependencies": ["com.oracle.svm.core.jdk11"],
254251
"requiresConcealed" : {
255252
"java.base" : [
256253
"jdk.internal.loader",

substratevm/src/com.oracle.svm.core.jdk11/src/com/oracle/svm/core/jdk11/JavaLangSubstitutions_JDK11OrLater.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ final class Target_jdk_internal_loader_BootLoader_JDK11OrLater {
5454
static Package getDefinedPackage(String name) {
5555
if (name != null) {
5656
Target_java_lang_Package pkg = new Target_java_lang_Package(name, null, null, null,
57-
null, null, null, null, null);
57+
null, null, null, null, null);
5858
return SubstrateUtil.cast(pkg, Package.class);
5959
} else {
6060
return null;
@@ -90,8 +90,8 @@ private static boolean hasClassPath() {
9090

9191
/**
9292
* All ClassLoaderValue are reset at run time for now. See also
93-
* {@link Target_java_lang_ClassLoader_JDK11OrLater#classLoaderValueMap} for resetting of individual class
94-
* loaders.
93+
* {@link Target_java_lang_ClassLoader_JDK11OrLater#classLoaderValueMap} for resetting of
94+
* individual class loaders.
9595
*/
9696
// Checkstyle: stop
9797
@Alias @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.NewInstance, declClass = ConcurrentHashMap.class)//

substratevm/src/com.oracle.svm.core.jdk11/src/com/oracle/svm/core/jdk11/ModuleUtil.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static void checkIsPackageContainedInModule(String pn, Module module) {
105105
Module actualModule = namedPackage.module;
106106
if (!actualModule.equals(module)) {
107107
throw new IllegalArgumentException("Package " + pn + " found in module " + actualModule.getName() +
108-
", not in module: " + module.getName());
108+
", not in module: " + module.getName());
109109
}
110110
}
111111
if (!module.getPackages().contains(pn)) {
@@ -115,23 +115,23 @@ public static void checkIsPackageContainedInModule(String pn, Module module) {
115115

116116
public static List<String> getPackagesDefinedToLoader(ClassLoader loader) {
117117
return getDefinedModules().getOrDefault(loader, Set.of())
118-
.stream()
119-
.flatMap(m -> m.getPackages().stream())
120-
.collect(Collectors.toUnmodifiableList());
118+
.stream()
119+
.flatMap(m -> m.getPackages().stream())
120+
.collect(Collectors.toUnmodifiableList());
121121
}
122122

123123
public static Object getModuleContainingPackage(ClassLoader loader, String pn) {
124124
return getDefinedModules().getOrDefault(loader, Set.of())
125-
.stream()
126-
.filter(m -> m.getPackages().contains(pn))
127-
.findFirst().orElse(null);
125+
.stream()
126+
.filter(m -> m.getPackages().contains(pn))
127+
.findFirst().orElse(null);
128128
}
129129

130130
public static boolean bootLayerContainsModule(String name) {
131131
return ModuleLayer.boot().modules().stream().anyMatch(m -> m.getName().equals(name));
132132
}
133133

134-
//Checkstyle: allow synchronization
134+
// Checkstyle: allow synchronization
135135
public static void defineModule(Module module, boolean isOpen, List<String> pns) {
136136
if (Objects.isNull(module)) {
137137
throw new NullPointerException("Null module object");
@@ -178,7 +178,7 @@ public static void defineModule(Module module, boolean isOpen, List<String> pns)
178178

179179
if (loader != ClassLoader.getPlatformClassLoader() && ModuleUtil.isPackageNameForbidden(pn)) {
180180
throw new IllegalArgumentException("Class loader (instance of): " + loader.getClass().getName() +
181-
" tried to define prohibited package name: " + pn);
181+
" tried to define prohibited package name: " + pn);
182182
}
183183
}
184184

@@ -202,11 +202,9 @@ public static void defineModule(Module module, boolean isOpen, List<String> pns)
202202
} else if (Objects.nonNull(definedPackage)) {
203203
Module moduleContainingDefinedPackage = SubstrateUtil.cast(ModuleUtil.getModuleContainingPackage(loader, definedPackage), Module.class);
204204
if (moduleContainingDefinedPackage.isNamed()) {
205-
throw new IllegalStateException("Package " + definedPackage + " is already in another module, "
206-
+ moduleContainingDefinedPackage.getName() + ", defined to the class loader");
205+
throw new IllegalStateException("Package " + definedPackage + " is already in another module, " + moduleContainingDefinedPackage.getName() + ", defined to the class loader");
207206
} else {
208-
throw new IllegalStateException("Package " + definedPackage
209-
+ " is already in the unnamed module defined to the class loader");
207+
throw new IllegalStateException("Package " + definedPackage + " is already in the unnamed module defined to the class loader");
210208
}
211209
}
212210

substratevm/src/com.oracle.svm.core.jdk15/src/com/oracle/svm/core/jdk15/Target_java_lang_Module_JDK15OrLater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
@TargetClass(value = Module.class, onlyWith = JDK15OrLater.class)
3939
public final class Target_java_lang_Module_JDK15OrLater {
4040

41-
//Checkstyle: allow synchronization
41+
// Checkstyle: allow synchronization
4242
@Substitute
4343
private static void defineModule0(Module module, boolean isOpen, String version, String location, Object[] pns) {
4444
if (Arrays.stream(pns).anyMatch(Objects::isNull)) {

substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/Target_jdk_internal_platform_CgroupMetrics_JDK17OrLater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2021, 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

substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEnabled.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static boolean get() {
4747
private static boolean jvmVersionSupported() {
4848
return JavaVersionUtil.JAVA_SPEC == 11 || JavaVersionUtil.JAVA_SPEC == 16 || JavaVersionUtil.JAVA_SPEC == 17;
4949
}
50+
5051
private static boolean osSupported() {
5152
return OS.getCurrent() == OS.LINUX || OS.getCurrent() == OS.DARWIN;
5253
}

substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/JVMFuncFallbackTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public class JVMFuncFallbackTest {
4040
public void testImageCodeMethods() {
4141
if (Boolean.getBoolean("never.be.true.but.compiler.doesn't.know")) {
4242
/*
43-
* Cause image to link to JVM_Clone. This will trigger a linker error if libjvm.a does
44-
* not contain the autogenerated JVM_* fallbacks.
43+
* Cause image to link to JVM_IHashCode. This will trigger a linker error if libjvm.a
44+
* does not contain the autogenerated JVM_* fallbacks.
4545
*/
46-
Jvm.JVM_Clone(WordFactory.nullPointer());
46+
Jvm.JVM_IHashCode(WordFactory.nullPointer());
4747
}
4848
}
4949
}
@@ -52,5 +52,5 @@ public void testImageCodeMethods() {
5252
@CLibrary(value = "jvm", requireStatic = true)
5353
class Jvm {
5454
@CFunction(transition = CFunction.Transition.NO_TRANSITION)
55-
public static native int JVM_Clone(Pointer jni);
55+
public static native int JVM_IHashCode(Pointer jni);
5656
}

0 commit comments

Comments
 (0)