# This file is shared between many repositories. # All objects defined here are mixins, so you can use them like: # { name: "myjob" } + common.linux_amd64 + common.jdks.labsjdk17ce + common.deps.sulong + ... # Note that using a os-arch mixin like linux_amd64 mixin is required for using common.deps. local common_json = import "../common.json"; { # JDK definitions # *************** local jdk_base = { name: error "name not set", # string; The JDK provider, e.g. "jpg-jdk", "labsjdk" version: error "version not set", # string; Full version string, e.g., "ce-21+35-jvmci-23.1-b15" jdk_version:: error "jdk_version not set", # int; The major JDK version, e.g., 21 jdk_name:: "jdk%d" % self.jdk_version, # string; The major JDK version with the JDK prefix. # For the latest (unreleased) this should be overridden with "jdk-latest" # otherwise the jdk_version with the "jdk" prefix, e.g., "jdk21". # This should be use for constructing CI job names. # Optional: # "build_id": "33", # "release": true, # "platformspecific": true, # "extrabundles": ["static-libs"], }, # *************** local variants(name) = [name, name + "Debug", name + "-llvm"], # gets the JDK major version from a labsjdk version string (e.g., "ce-21+35-jvmci-23.1-b15" -> 21) local parse_labsjdk_version(jdk) = if jdk.name == "jpg-jdk" then std.parseInt(jdk.version) else local version = jdk.version; assert std.startsWith(version, "ce-") || std.startsWith(version, "ee-") : "Unsupported labsjdk version: " + version; local number_prefix(str) = if std.length(str) == 0 || std.length(std.findSubstr(str[0], "0123456789")) == 0 then "" else str[0] + number_prefix(str[1:]) ; std.parseInt(number_prefix(version[3:])) , # gets the build_id from a labsjdk version string (e.g., "ce-21+35-jvmci-23.1-b15" -> 21) local get_labsjdk_build_id(jdk) = local _parts = std.split(jdk.version, "-"); local _version_build_id = std.split(_parts[1], "+"); _version_build_id[1] , local get_labsjdk_jvmci_build_id(jdk) = local _parts = std.split(jdk.version, "-"); _parts[std.length(_parts) - 1] , local jdks_data = { [name]: jdk_base + common_json.jdks[name] + { jdk_version:: 17 } for name in ["oraclejdk17"] + variants("labsjdk-ce-17") + variants("labsjdk-ee-17") } + { [name]: jdk_base + common_json.jdks[name] + { jdk_version:: 19 } for name in ["oraclejdk19"] + variants("labsjdk-ce-19") + variants("labsjdk-ee-19") } + { [name]: jdk_base + common_json.jdks[name] + { jdk_version:: 20 } for name in ["oraclejdk20"] + variants("labsjdk-ce-20") + variants("labsjdk-ee-20") } + { [name]: jdk_base + common_json.jdks[name] + { jdk_version:: 21 } for name in ["oraclejdk21"] + variants("labsjdk-ce-21") + variants("labsjdk-ee-21") } + { 'oraclejdk24': jdk_base + common_json.jdks["oraclejdk24"] + { jdk_version:: 24 }, } + { [name]: jdk_base + common_json.jdks[name] + { jdk_version:: 25 } for name in ["oraclejdk25"] } + { # Synthesize labsjdk-*-25 from labsjdk-*-latest # This is intended for jobs that specifically need the 25 LTS JDK (e.g., espresso for its guest). # When running the compiler or the native image generator "latest" should be used instead. # When latest moves past 25, jobs using 25 should be reviwed and if they are still needed labsjdk-(ce|ee)-25 should # be added to common.json. # Note that the assert below unfortunately doesn't work in the sjsonnet version used currently in the CI (GR-40975). [std.strReplace(name, 'latest', '25')]: jdk_base + common_json.jdks[name] + { assert parse_labsjdk_version(self) == 25, jdk_version:: 25 } for name in variants("labsjdk-ce-latest") + variants("labsjdk-ee-latest") } + { [name]: jdk_base + common_json.jdks[name] + { jdk_version:: parse_labsjdk_version(self), jdk_name:: "jdk-latest"} for name in ["oraclejdk-latest"] + variants("labsjdk-ce-latest") + variants("labsjdk-ee-latest") } + { 'graalvm-ee-21': jdk_base + common_json.jdks["graalvm-ee-21"] + { jdk_version:: 21 }, 'graalvm-ee-25-ea': jdk_base + common_json.jdks["graalvm-ee-25-ea"] + { jdk_version:: 25 }, }, # We do not want to expose galahad-jdk, labsjdk-(ce|ee)-25 are synthetized from latest local is_labsjdk_25(x) = std.startsWith(x, "labsjdk-ee-25") || std.startsWith(x, "labsjdk-ce-25"), 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)]), # Verify oraclejdk-latest and labsjdk-ee-latest versions match assert local _labsjdk = common_json.jdks["labsjdk-ee-latest"]; local _oraclejdk = common_json.jdks["oraclejdk-latest"]; local _ov = _oraclejdk.build_id; local _lv = std.strReplace(_labsjdk.version, "ee-", "jdk-"); # Skip the check if we are not using a labsjdk. This can happen on JDK integration branches. local no_labsjdk = _labsjdk.name != "labsjdk"; # Skip the check if we are using labsjdk with build number equal zero local labsjdk_with_build_zero = std.findSubstr('+0-jvmci-', _lv) != []; local oraclejdk_base_version = std.split(_ov, "+")[0]; local labsjdk_base_version = std.split(_lv, "+")[0]; # Labs JDK can include 5 digits in its base version. # Skip the check when Labsjdk latest is dervied from Oracle JDK latest base-version. local labsjdk_with_extra_base_version_component = std.length(std.split(labsjdk_base_version, ".")) == std.length(std.split(oraclejdk_base_version, ".")) + 1 && std.startsWith(labsjdk_base_version, oraclejdk_base_version + "."); assert no_labsjdk || std.startsWith(_lv, _ov) || labsjdk_with_build_zero || labsjdk_with_extra_base_version_component: "update oraclejdk-latest to match labsjdk-ee-latest: %s+%s vs %s" % [_oraclejdk.version, _oraclejdk.build_id, _labsjdk.version]; true, # Verify labsjdk-ce-latest and labsjdk-ee-latest JVMCI build numbers match assert local _labsjdk_ce = common_json.jdks["labsjdk-ce-latest"]; local _labsjdk_ee = common_json.jdks["labsjdk-ee-latest"]; local _ce_jvmci_build_id = get_labsjdk_jvmci_build_id(_labsjdk_ce); local _ee_jvmci_build_id = get_labsjdk_jvmci_build_id(_labsjdk_ee); assert _ce_jvmci_build_id == _ee_jvmci_build_id : "labsjdk-ce-latest and labsjdk-ee-latest JVMCI build numbers differ: %s vs %s" % [_labsjdk_ce.version, _labsjdk_ee.version]; true, # The raw jdk data, the same as common_json.jdks + { jdk_version:: } jdks_data: jdks_data, # Mixins to include and download the given JDK jdks: { [name]: { downloads+: { [if std.endsWith(name, "llvm") then "LLVM_JAVA_HOME" else "JAVA_HOME"]: jdks_data[name] }, jdk_version:: jdks_data[name].jdk_version, jdk_name:: jdks_data[name].jdk_name, }, for name in std.objectFields(jdks_data) } + { # Some convenient JDK aliases which don't require ["name"] for frequently-used JDKs labsjdk17ce: self["labsjdk-ce-17"], labsjdk17ee: self["labsjdk-ee-17"], labsjdk20ce: self["labsjdk-ce-20"], labsjdk20ee: self["labsjdk-ee-20"], labsjdk21ce: self["labsjdk-ce-21"], labsjdk21ee: self["labsjdk-ee-21"], labsjdkLatestCE: self["labsjdk-ce-latest"], labsjdkLatestEE: self["labsjdk-ee-latest"], oraclejdkLatest: self["oraclejdk-latest"], }, # The devkits versions reflect those used to build the JVMCI JDKs (e.g., see devkit_platform_revisions in /make/conf/jib-profiles.js). # See deps.windows_devkit to add a devkit on windows conveniently. devkits: { "windows-jdk17": { packages+: { "devkit:VS2022-17.1.0+1": "==0" }}, "windows-jdk19": { packages+: { "devkit:VS2022-17.1.0+1": "==0" }}, "windows-jdk20": { packages+: { "devkit:VS2022-17.1.0+1": "==0" }}, "windows-jdk21": { packages+: { "devkit:VS2022-17.1.0+1": "==1" }}, "windows-jdk-latest": { packages+: { "devkit:VS2022-17.13.2+1": "==0" }}, "windows-jdkLatest": self["windows-jdk-latest"], "linux-jdk17": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }}, "linux-jdk19": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }}, "linux-jdk20": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }}, "linux-jdk21": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }}, "linux-jdk-latest": { packages+: { "devkit:gcc13.2.0-OL6.4+1": "==0" }}, "linux-jdkLatest": self["linux-jdk-latest"], }, # Dependencies # ************ deps: { # These dependencies are included in Build GraalVM platforms, but not in bare platforms mx: { environment+: { MX_PYTHON: "python3.8", PYTHONIOENCODING: "utf-8", }, packages+: { python3: "==3.8.10", "pip:ninja_syntax": common_json.pip.ninja_syntax, mx: common_json.mx_version, }, python_version: "3", # To use the correct virtualenv }, common_catch_files: { catch_files+: [ # There are additional catch_files-like patterns in buildbot/graal/catcher.py for: # * hs_err_pid*.log files # * Dumping IGV graphs to (?P.+(\.gv\.xml|\.bgv)) # * CFGPrinter: Output to file (?P.*compilations-.+\.cfg) # There are defined there for efficiency reasons. # Keep in sync with jdk.graal.compiler.debug.StandardPathUtilitiesProvider#DIAGNOSTIC_OUTPUT_DIRECTORY_MESSAGE_REGEXP "Graal diagnostic output saved in '(?P[^']+)'", # Keep in sync with jdk.graal.compiler.debug.DebugContext#DUMP_FILE_MESSAGE_REGEXP "Dumping debug output to '(?P[^']+)'", # Keep in sync with com.oracle.svm.hosted.ProgressReporter#printErrorMessage "Please inspect the generated error report at: '(?P[^']+)'", # Keep in sync with jdk.graal.compiler.test.SubprocessUtil#makeArgfile "@(?P.*SubprocessUtil-argfiles.*\\.argfile)", # Keep in sync with com.oracle.truffle.api.test.SubprocessTestUtils#makeArgfile "@(?P.*SubprocessTestUtils-argfiles.*\\.argfile)", # Keep in sync with mx_gate.py:get_jacoco_agent_args "JaCoCo agent config: '(?P[^']+)'", ], }, common_env: { environment+: { # Enforce experimental option checking in CI (GR-47922) NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL: "true", }, }, # These dependencies are not included by default in any platform object # Not included by default in $.windows_amd64 and $.windows_server_2016_amd64 because it needs jdk_name. # As a note, Native Image needs this to build. windows_devkit:: { packages+: if self.os == "windows" then $.devkits["windows-" + self.jdk_name].packages else {}, }, jdt: { environment+: { JDT: "builtin", }, }, pylint:: { packages+: { "pip:pylint": common_json.pip.pylint, "pip:lazy-object-proxy": common_json.pip["lazy-object-proxy"], }, # Required to keep pylint happy on Darwin # https://coderwall.com/p/-k_93g/mac-os-x-valueerror-unknown-locale-utf-8-in-python" environment+: if self.os == "darwin" then { LC_ALL: "en_US.UTF-8", } else {}, }, black:: { packages+: { # black is used to format python source code "pip:black": common_json.pip.black, }, }, cmake:: { packages+: { cmake: "==3.22.2", }, }, gradle:: { downloads+: { GRADLE_JAVA_HOME: jdks_data["oraclejdk21"], } }, # ProGuard does not yet run on JDK 25 proguard: { downloads+: if 'jdk_version' in self && self.jdk_version > 21 then { TOOLS_JAVA_HOME: jdks_data['oraclejdk24'], IGV_JAVA_HOME: jdks_data['oraclejdk21'], } else {}, }, # GR-49566: SpotBugs does not yet run on JDK 22 spotbugs: { downloads+: if 'jdk_version' in self && self.jdk_version > 21 then { TOOLS_JAVA_HOME: jdks_data['oraclejdk21'], } else {}, }, maven:: { local this = self, packages+: (if self.os == "linux" && self.arch == "amd64" then { maven: '==3.9.10', } else {}), # no maven package available on other platforms downloads+: (if self.os != "linux" || self.arch != "amd64" then { # GR-68921: 3.9.10 does not work on Windows MAVEN_HOME: {name: 'maven', version: (if this.os == "windows" then '3.3.9' else '3.9.10'), platformspecific: false}, } else {}), setup+: (if self.os != "linux" || self.arch != "amd64" then [ ['set-export', 'PATH', (if self.os == "windows" then '$MAVEN_HOME\\bin;$PATH' else '$MAVEN_HOME/bin:$PATH')], ] else []), }, espresso:: { downloads+: { EXTRA_JAVA_HOMES+: { pathlist+: [jdks_data["oraclejdk21"], jdks_data["oraclejdk25"]], } } }, sulong:: self.cmake + { packages+: if self.os == "windows" then { msvc_source: "==14.0", } else {}, }, graalnodejs:: { local this = self, packages+: if self.os == "linux" then { cmake: "==3.22.2", } else {}, environment+: if self.os == "windows" then { local devkits_version = std.filterMap( function(p) std.startsWith(p, 'devkit:VS'), # filter function function(p) std.substr(p, std.length('devkit:VS'), 4), # map function std.objectFields(this.packages) # array )[0], DEVKIT_VERSION: devkits_version, # TODO: dep of Graal.nodejs } else {}, downloads+: if self.os == "windows" then { NASM: {name: 'nasm', version: '2.14.02', platformspecific: true}, } else {}, }, graalpy:: self.gradle + self.cmake + self.maven + { packages+: if (self.os == "linux") then { libffi: '==3.2.1', bzip2: '==1.0.6', zlib: '==1.2.11', } else {}, }, wasm:: { downloads+: { WABT_DIR: {name: 'wabt', version: '1.0.41', platformspecific: true}, }, environment+: { WABT_DIR: '$WABT_DIR/bin', }, }, wasm_ol8:: { downloads+: { WABT_DIR: {name: 'wabt', version: '1.0.41-ol8', platformspecific: true}, }, environment+: { WABT_DIR: '$WABT_DIR/bin', }, }, emsdk_ol8:: { downloads+: { EMSDK_DIR: {name: 'emsdk', version: '4.0.10', platformspecific: true}, }, environment+: { EMCC_DIR: '$EMSDK_DIR/upstream/emscripten/' } }, svm:: { packages+: { cmake: "==3.22.2", }, environment+: { DEFAULT_VM: "server", LANG: "en_US.UTF-8", }, logs+: [ "../.native-image/*/*/*/*.log", "*/*.log", "*/svmbuild/*.log", "*/svmbuild/images/*.log", "*/callgrind.*", "*.log", ], }, }, # Job frequencies # *************** frequencies: { tier1: { targets+: ["tier1"], }, tier2: { targets+: ["tier2"], }, tier3: { targets+: ["tier3"], }, gate: { targets+: ["gate"], }, bench: { targets+: ["bench"], }, on_demand: { targets+: ["ondemand"], }, post_merge: { targets+: ["post-merge"], }, opt_post_merge: { targets+: ["opt-post-merge"], tags+: {opt_post_merge +: []}, }, daily: { targets+: ["daily"], }, weekly: { targets+: ["weekly"], }, monthly: { targets+: ["monthly"], } }, # OS specific file handling os_utils:: { local lib_format = { "windows": "%s.dll", "linux": "lib%s.so", "darwin": "lib%s.dylib" }, # Converts unixpath to an OS specific path os_path(unixpath):: if self.os == "windows" then std.strReplace(unixpath, "/", "\\") else unixpath, # Converts unixpath to an OS specific path for an executable os_exe(unixpath):: if self.os == "windows" then self.os_path(unixpath) + ".exe" else unixpath, # Converts a base library name to an OS specific file name os_lib(name):: lib_format[self.os] % name, }, # Utils disable_proxies: { setup+: [ ["unset", "HTTP_PROXY", "HTTPS_PROXY", "FTP_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "ftp_proxy", "no_proxy"], ], }, # Hardware definitions and common fields # ************************************** # Note that only platforms (os-arch) are exposed (not os and arch separately), # because this is the simplest way to ensure correct usage and dependencies (e.g. ol7 in linux_amd64). # # To add extra "common" fields for your CI: # * If you already have platforms objects, you could extend them like: # linux_amd64: common.linux_amd64 + self.my_common, # * Otherwise, just include your common object as well as one of the os-arch objects below in each job: # { name: "myjob" } + common.linux_amd64 + self.my_common + ... # # This also means self.my_common should no longer include mx, etc as it is already included by the os-arch objects. # Bare platforms, just the bare minimum and nothing else. Also see Build GraalVM platforms below. bare:: { local ol7 = { docker+: { image: "buildslave_ol7", mount_modules: true, }, }, local ol8 = { docker+: { image: "buildslave_ol8", mount_modules: true, }, }, local ol9 = { docker+: { image: "buildslave_ol9", mount_modules: true, }, }, local ubuntu22 = { docker+: { image: "buildslave_ubuntu22", mount_modules: true, }, }, local linux = { os:: "linux", capabilities+: [self.os] }, # Run darwin jobs on Sonoma or later by excluding all older versions local darwin = { os:: "darwin", capabilities+: [self.os, "!darwin_bigsur", "!darwin_ventura", "!darwin_monterey"] }, local windows = { os:: "windows", capabilities+: [self.os] }, local amd64 = { arch:: "amd64", capabilities+: [self.arch] }, local aarch64 = { arch:: "aarch64", capabilities+: [self.arch] }, local ol_distro = { os_distro:: "ol" }, local ol7_distro = ol_distro + { os_distro_version:: "7" }, local ol8_distro = ol_distro + { os_distro_version:: "8" }, local ol9_distro = ol_distro + { os_distro_version:: "9" }, linux_amd64: self.linux_amd64_ol7, linux_amd64_ol7: linux + amd64 + ol7 + ol7_distro, linux_amd64_ol8: linux + amd64 + ol8 + ol8_distro, linux_amd64_ol9: linux + amd64 + ol9 + ol9_distro, linux_aarch64: self.linux_aarch64_ol7, linux_aarch64_ol7: linux + aarch64 + ol7 + ol7_distro, linux_aarch64_ol8: linux + aarch64 + ol8 + ol8_distro, linux_aarch64_ol9: linux + aarch64 + ol9 + ol9_distro, linux_amd64_ubuntu: linux + amd64 + ubuntu22 + { os_distro:: "ubuntu", os_distro_version:: "22" }, darwin_aarch64: darwin + aarch64, windows_amd64: windows + amd64, windows_server_2016_amd64: windows + amd64 + { capabilities+: ["windows_server_2016"] }, }, # Build GraalVM platforms, they include the dependencies listed in `local common =` just below. # They also include a devtoolset on Oracle Linux, to use the same system toolchain for all builds. local common = self.deps.mx + self.deps.common_catch_files + self.deps.common_env, local ol_devtoolset = { packages+: { "00:devtoolset": "==12", # GCC 12.2.1, make 4.3, binutils 2.36, valgrind 3.19 }, }, linux_amd64: self.linux_amd64_ol7, linux_amd64_ol7: self.bare.linux_amd64_ol7 + common + ol_devtoolset, linux_amd64_ol8: self.bare.linux_amd64_ol8 + common + ol_devtoolset, linux_amd64_ol9: self.bare.linux_amd64_ol9 + common + ol_devtoolset, linux_aarch64: self.linux_aarch64_ol7, linux_aarch64_ol7: self.bare.linux_aarch64_ol7 + common + ol_devtoolset, linux_aarch64_ol8: self.bare.linux_aarch64_ol8 + common + ol_devtoolset, linux_aarch64_ol9: self.bare.linux_aarch64_ol9 + common + ol_devtoolset, linux_amd64_ubuntu: self.bare.linux_amd64_ubuntu + common, darwin_aarch64: self.bare.darwin_aarch64 + common, windows_amd64: self.bare.windows_amd64 + common, windows_server_2016_amd64: self.bare.windows_server_2016_amd64 + common, }