Skip to content

Commit

Permalink
[GR-36495] Port JDK8 jobs to JDK11.
Browse files Browse the repository at this point in the history
PullRequest: graal/10859
  • Loading branch information
ansalond committed Feb 3, 2022
2 parents 3e600e0 + 43143c1 commit 413017d
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 61 deletions.
2 changes: 1 addition & 1 deletion sdk/mx.sdk/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# SOFTWARE.
#
suite = {
"mxversion" : "5.309.1",
"mxversion" : "5.317.17",
"name" : "sdk",
"version" : "22.1.0",
"release" : False,
Expand Down
1 change: 0 additions & 1 deletion vm/ci_common/common-bench.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ local vm_common = import '../ci_common/common.jsonnet';
vm_common.bench_daily_vm_linux_amd64 + self.vm_bench_polybench_linux_warmup + {name: 'daily-bench-vm-' + vm.vm_setup.short_name + '-polybench-warmup-linux-amd64'},
vm_common.bench_daily_vm_linux_amd64 + self.vm_bench_polybench_linux_allocated_bytes + {name: 'daily-bench-vm-' + vm.vm_setup.short_name + '-polybench-allocated-bytes-linux-amd64'},

vm_common.bench_daily_vm_linux_amd64 + self.vm_bench_polybench_nfi_linux_amd64 + vm.vm_java_8 + {name: 'daily-bench-vm-' + vm.vm_setup.short_name + '-polybench-nfi-java8-linux-amd64'},
vm_common.bench_daily_vm_linux_amd64 + self.vm_bench_polybench_nfi_linux_amd64 + vm.vm_java_11 + {name: 'daily-bench-vm-' + vm.vm_setup.short_name + '-polybench-nfi-java11-linux-amd64'},
vm_common.bench_daily_vm_linux_amd64 + self.vm_bench_polybench_nfi_linux_amd64 + vm.vm_java_17 + {name: 'daily-bench-vm-' + vm.vm_setup.short_name + '-polybench-nfi-java17-linux-amd64'},

Expand Down
2 changes: 0 additions & 2 deletions vm/ci_common/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,6 @@ local devkits = common_json.devkits;
svm_common_linux_amd64: { environment+: common_json.svm.deps.common.environment, logs+: common_json.svm.deps.common.logs} + common_json.svm.deps.linux_amd64,
svm_common_linux_aarch64: { environment+: common_json.svm.deps.common.environment, logs+: common_json.svm.deps.common.logs} + common_json.svm.deps.linux_aarch64,
svm_common_darwin: { environment+: common_json.svm.deps.common.environment, logs+: common_json.svm.deps.common.logs} + common_json.svm.deps.darwin,
svm_common_windows_openjdk8: { environment+: common_json.svm.deps.common.environment, logs+: common_json.svm.deps.common.logs} + common_json.svm.deps.windows + common_json.devkits['windows-openjdk8'],
svm_common_windows_oraclejdk8: { environment+: common_json.svm.deps.common.environment, logs+: common_json.svm.deps.common.logs} + common_json.svm.deps.windows + common_json.devkits['windows-oraclejdk8'],
svm_common_windows_jdk11: { environment+: common_json.svm.deps.common.environment, logs+: common_json.svm.deps.common.logs} + common_json.svm.deps.windows + common_json.devkits['windows-jdk11'],
svm_common_windows_jdk17: { environment+: common_json.svm.deps.common.environment, logs+: common_json.svm.deps.common.logs} + common_json.svm.deps.windows + common_json.devkits['windows-jdk17'],

Expand Down
85 changes: 32 additions & 53 deletions vm/ci_includes/vm.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ local common_json = composable(import '../../common.json');
local jdks = common_json.jdks;

{
vm_java_8:: graal_common.openjdk8 + {
environment+: {
BASE_JDK_NAME: jdks.openjdk8.name,
BASE_JDK_VERSION: jdks.openjdk8.version,
BASE_JDK_SHORT_VERSION: '8',
},
},
vm_java_11:: graal_common.labsjdk11 + {
environment+: {
BASE_JDK_NAME: jdks['labsjdk-ce-11'].name,
Expand All @@ -30,9 +23,6 @@ local jdks = common_json.jdks;
},
},

vm_common_windows_jdk8:: vm_common.svm_common_windows_openjdk8,
vm_common_windows_jdk11:: vm_common.svm_common_windows_jdk11,

vm_linux_amd64_java_11:: self.vm_java_11 + {
downloads+: {
LLVM_JAVA_HOME: jdks['labsjdk-ce-11-llvm'],
Expand Down Expand Up @@ -63,34 +53,23 @@ local jdks = common_json.jdks;
],
},

maven_base_11:: {
maven_11_17:: {
downloads+: {
JAVA_HOME: jdks['labsjdk-ce-11'],
EXTRA_JAVA_HOMES: jdks['labsjdk-ce-17'],
},
mx_cmd_base:: ['mx', '--dynamicimports', '/tools,/compiler,/graal-js,/espresso', '--disable-installables=true'],
build:: self.mx_cmd_base + ['build'],
deploy:: self.mx_cmd_base + ['--suite', 'compiler', '--suite', 'truffle', '--suite', 'sdk', '--suite', 'tools', '--suite', 'regex', '--suite', 'graal-js', '--suite', 'espresso', 'maven-deploy', '--tags=default', '--all-distribution-types', '--validate', 'full', '--licenses', 'GPLv2-CPE,UPL,MIT'],
},

maven_base_native:: {
maven_11_17_only_native:: self.maven_11_17 + {
native_distributions:: 'TRUFFLE_NFI_NATIVE,SVM_HOSTED_NATIVE',
mx_cmd_base:: ['mx', '--dynamicimports', '/substratevm', '--disable-installables=true', '--force-bash-launcher=true', '--skip-libraries=true'],
build:: self.mx_cmd_base + ['build', '--dependencies', self.native_distributions],
deploy:: self.mx_cmd_base + ['maven-deploy', '--only', self.native_distributions, '--tags=default', '--all-suites', '--all-distribution-types', '--validate', 'full', '--licenses', 'GPLv2-CPE,UPL,MIT'],
},

maven_base_8_native:: self.maven_base_native + {
downloads+: {
JAVA_HOME: jdks.openjdk8,
},
},

maven_base_11_native:: self.maven_base_native + {
downloads+: {
JAVA_HOME: jdks['labsjdk-ce-11'],
},
},

vm_unittest:: {
environment+: {
MX_TEST_RESULTS_PATTERN: 'es-XXX.json',
Expand Down Expand Up @@ -129,14 +108,14 @@ local jdks = common_json.jdks;
},

local builds = [
self.vm_java_8 + vm_common.gate_vm_linux_amd64 + self.vm_unittest + {
self.vm_java_11 + vm_common.gate_vm_linux_amd64 + self.vm_unittest + {
run: [
['mx', 'build'],
['mx', 'unittest', '--suite', 'vm'],
],
name: 'gate-vm-unittest-linux-amd64',
},
graal_common.oraclejdk8 + common_json.devkits['windows-oraclejdk8'] + vm_common.gate_vm_windows + self.vm_unittest + {
self.vm_java_11 + common_json.devkits['windows-jdk11'] + vm_common.gate_vm_windows + self.vm_unittest + {
run: [
['mx', 'build'],
['mx', 'unittest', '--suite', 'vm'],
Expand All @@ -154,20 +133,20 @@ local jdks = common_json.jdks;
],
name: 'gate-vm-build-without-vcs-linux-amd64',
},
vm_common.linux_deploy + vm_common.gate_vm_linux_amd64 + self.maven_base_11 + vm_common.sulong_linux + {
vm_common.linux_deploy + vm_common.gate_vm_linux_amd64 + self.maven_11_17 + vm_common.sulong_linux + {
run: [
$.maven_base_11.build,
$.maven_base_11.deploy + ['--dry-run', 'lafo-maven'],
$.maven_11_17.build,
$.maven_11_17.deploy + ['--dry-run', 'lafo-maven'],
],
name: 'gate-vm-maven-dry-run-linux-amd64',
},
vm_common.linux_deploy + vm_common.gate_vm_linux_amd64 + self.maven_base_11 + vm_common.sulong_linux + {
vm_common.linux_deploy + vm_common.gate_vm_linux_amd64 + self.maven_11_17 + vm_common.sulong_linux + {
downloads+: {
OPEN_JDK_11: common_json.jdks.openjdk11,
},
run: [
$.maven_base_11.build,
$.maven_base_11.deploy + ['--version-string', 'GATE'],
$.maven_11_17.build,
$.maven_11_17.deploy + ['--version-string', 'GATE'],
['set-export', 'JAVA_HOME', '$OPEN_JDK_11'],
['git', 'clone', '--depth', '1', ['mx', 'urlrewrite', 'https://github.com/graalvm/graal-js-jdk11-maven-demo.git'], 'graal-js-jdk11-maven-demo'],
['cd', 'graal-js-jdk11-maven-demo'],
Expand All @@ -176,53 +155,53 @@ local jdks = common_json.jdks;
],
name: 'gate-vm-js-on-jdk11-maven-linux-amd64',
},
vm_common.linux_deploy + vm_common.deploy_vm_linux_amd64 + self.maven_base_11 + vm_common.sulong_linux + {
vm_common.linux_deploy + vm_common.deploy_vm_linux_amd64 + self.maven_11_17 + vm_common.sulong_linux + {
run: [
$.maven_base_11.build,
$.maven_base_11.deploy + ['lafo-maven'],
$.maven_11_17.build,
$.maven_11_17.deploy + ['lafo-maven'],
],
name: 'post-merge-deploy-vm-maven-linux-amd64',
timelimit: '45:00',
},
vm_common.linux_deploy + vm_common.gate_vm_linux_aarch64 + self.maven_base_11_native + {
vm_common.linux_deploy + vm_common.gate_vm_linux_aarch64 + self.maven_11_17_only_native + {
run: [
$.maven_base_11_native.build,
$.maven_base_11_native.deploy + ['--dry-run', 'lafo-maven'],
$.maven_11_17_only_native.build,
$.maven_11_17_only_native.deploy + ['--dry-run', 'lafo-maven'],
],
name: 'gate-vm-maven-dry-run-linux-aarch64',
},
vm_common.linux_deploy + vm_common.deploy_vm_linux_aarch64 + self.maven_base_11_native + {
vm_common.linux_deploy + vm_common.deploy_vm_linux_aarch64 + self.maven_11_17_only_native + {
run: [
$.maven_base_11_native.build,
$.maven_base_11_native.deploy + ['lafo-maven'],
$.maven_11_17_only_native.build,
$.maven_11_17_only_native.deploy + ['lafo-maven'],
],
name: 'post-merge-deploy-vm-maven-linux-aarch64',
},
vm_common.darwin_deploy + vm_common.gate_vm_darwin + self.maven_base_11_native + {
vm_common.darwin_deploy + vm_common.gate_vm_darwin + self.maven_11_17_only_native + {
run: [
$.maven_base_11_native.build,
$.maven_base_11_native.deploy + ['--dry-run', 'lafo-maven'],
$.maven_11_17_only_native.build,
$.maven_11_17_only_native.deploy + ['--dry-run', 'lafo-maven'],
],
name: 'gate-vm-maven-dry-run-darwin-amd64',
},
vm_common.darwin_deploy + vm_common.deploy_daily_vm_darwin + self.maven_base_11_native + {
vm_common.darwin_deploy + vm_common.deploy_daily_vm_darwin + self.maven_11_17_only_native + {
run: [
$.maven_base_11_native.build,
$.maven_base_11_native.deploy + ['lafo-maven'],
$.maven_11_17_only_native.build,
$.maven_11_17_only_native.deploy + ['lafo-maven'],
],
name: 'daily-deploy-vm-maven-darwin-amd64',
},
self.vm_common_windows_jdk11 + vm_common.gate_vm_windows + self.maven_base_11_native + {
vm_common.svm_common_windows_jdk11 + vm_common.gate_vm_windows + self.maven_11_17_only_native + {
run: [
$.maven_base_11_native.build,
$.maven_base_11_native.deploy + ['--dry-run', 'lafo-maven'],
$.maven_11_17_only_native.build,
$.maven_11_17_only_native.deploy + ['--dry-run', 'lafo-maven'],
],
name: 'gate-vm-maven-dry-run-windows-amd64',
},
self.vm_common_windows_jdk11 + vm_common.deploy_daily_vm_windows + self.maven_base_11_native + {
vm_common.svm_common_windows_jdk11 + vm_common.deploy_daily_vm_windows + self.maven_11_17_only_native + {
run: [
$.maven_base_11_native.build,
$.maven_base_11_native.deploy + ['lafo-maven'],
$.maven_11_17_only_native.build,
$.maven_11_17_only_native.deploy + ['lafo-maven'],
],
name: 'daily-deploy-vm-maven-windows-amd64',
},
Expand Down
11 changes: 11 additions & 0 deletions vm/mx.vm/mx_vm_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ class VmGateTasks:
svm_sl_tck = 'svm_sl_tck'
svm_truffle_tck_js = 'svm-truffle-tck-js'

def _unittest_config_participant(config):
vmArgs, mainClass, mainClassArgs = config
# This is required by org.graalvm.component.installer.CatalogIterableTest
vmArgs += [
'--add-exports=java.base/jdk.internal.loader=ALL-UNNAMED',
'--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED',
]
return vmArgs, mainClass, mainClassArgs

mx_unittest.add_config_participant(_unittest_config_participant)

def _check_compiler_log(compiler_log_file, expectations):
"""
Checks that `compiler_log_file` exists and that its contents match each regular expression in `expectations`.
Expand Down
9 changes: 8 additions & 1 deletion vm/mx.vm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@
"mx:JUNIT",
"org.graalvm.component.installer"
],
"javaCompliance" : "1.8+",
"requires" : ["java.logging"], # required by several tests
"requiresConcealed" : {
"java.base" : [
"jdk.internal.loader", # required by ComponentInstallerTest
"sun.net", # required by DirectoryStorageTest
],
},
"javaCompliance" : "11+",
"checkstyle": "org.graalvm.component.installer",
"license" : "GPLv2-CPE",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public ComponentParam createParam(String cmdString, ComponentInfo nfo) {

@Override
public Iterator<ComponentParam> iterator() {
return new Iterator<ComponentParam>() {
return new Iterator<>() {
private Iterator<ComponentParam> pit = components.iterator();
private Iterator<ComponentParam> fit;
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
import java.util.ResourceBundle;
import java.util.Set;
import java.util.stream.Collectors;

import jdk.internal.loader.URLClassPath;
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -504,13 +506,17 @@ public void testAutoFindGraalVMHome() throws Exception {
Files.copy(origInstaller, targetInstaller);
Files.copy(origTest, targetTest);

URLClassLoader myLoader = (URLClassLoader) getClass().getClassLoader();
ClassLoader cl = getClass().getClassLoader();
assertEquals(cl.getClass().getName(), "jdk.internal.loader.ClassLoaders$AppClassLoader");
Field ucp = cl.getClass().getDeclaredField("ucp");
ucp.setAccessible(true);
URLClassPath urlClassPath = (URLClassPath) ucp.get(cl);
List<URL> urls = new ArrayList<>();

urls.add(targetInstaller.toUri().toURL());
urls.add(targetTest.toUri().toURL());

Arrays.asList(myLoader.getURLs()).stream().filter(u -> !(locInstaller.equals(u) || locTest.equals(u))).collect(Collectors.toCollection(() -> urls));
Arrays.asList(urlClassPath.getURLs()).stream().filter(u -> !(locInstaller.equals(u) || locTest.equals(u))).collect(Collectors.toCollection(() -> urls));

URLClassLoader ldr = new URLClassLoader(
urls.toArray(new URL[urls.size()]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;

/**
* Provides sorted properties, for deterministic saves.
Expand All @@ -55,4 +59,11 @@ public synchronized Enumeration<Object> keys() {
Collections.sort(keyList);
return Collections.enumeration((Collection) keyList);
}

@Override
public Set<Map.Entry<Object, Object>> entrySet() {
TreeSet<Map.Entry<Object, Object>> treeSet = new TreeSet<>(Comparator.comparing(o -> ((String) o.getKey())));
treeSet.addAll(super.entrySet());
return Collections.synchronizedSet(treeSet);
}
}

0 comments on commit 413017d

Please sign in to comment.