Skip to content

Commit

Permalink
[GR-48663] Make fetch-jdk work with new JVMCI version
Browse files Browse the repository at this point in the history
PullRequest: mx/1678
  • Loading branch information
zapster committed Sep 15, 2023
2 parents 4d2aa1e + 959cff7 commit aa775d2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ci/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local common_json = import "../common.json";
for name in ["oraclejdk21"] + variants("labsjdk-ce-21") + variants("labsjdk-ee-21")
} + {
[name]: common_json.jdks[name] + { jdk_version:: 22 }
for name in ["oraclejdk22"]
for name in variants("labsjdk-ce-22") + variants("labsjdk-ee-22")
},
assert std.assertEqual(std.objectFields(common_json.jdks), std.objectFields(jdks_data)),

Expand Down Expand Up @@ -59,7 +59,7 @@ local common_json = import "../common.json";
"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-jdk22": { packages+: { "devkit:VS2022-17.1.0+1": "==1" }},
"windows-jdkLatest": { packages+: { "devkit:VS2022-17.1.0+1": "==1" }},
"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" }},
Expand Down
7 changes: 6 additions & 1 deletion common.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-debug", "platformspecific": true },
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-sulong", "platformspecific": true },

"oraclejdk22": {"name": "jpg-jdk", "version": "22", "build_id": "11", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]}
"labsjdk-ce-22": {"name": "labsjdk", "version": "ce-22+13-jvmci-b01", "platformspecific": true },
"labsjdk-ce-22Debug": {"name": "labsjdk", "version": "ce-22+13-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-22-llvm": {"name": "labsjdk", "version": "ce-22+13-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-22": {"name": "labsjdk", "version": "ee-22+13-jvmci-b01", "platformspecific": true },
"labsjdk-ee-22Debug": {"name": "labsjdk", "version": "ee-22+13-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-22-llvm": {"name": "labsjdk", "version": "ee-22+13-jvmci-b01-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
13 changes: 13 additions & 0 deletions jdk-binaries.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@
"url": "https://github.com/graalvm/graal-jvmci-8/releases/download/{version|jvmci-tag}/{filename}.tar.gz"
},

"labsjdk-ce-latest": {
"filename": "labsjdk-{version}-{platform}",
"url": "https://github.com/graalvm/labs-openjdk/releases/download/{version|jvmci-tag}/{filename}.tar.gz"
},
"labsjdk-ce-latest:-debug": {
"filename": "labsjdk-{version}-debug-{platform}",
"url": "https://github.com/graalvm/labs-openjdk/releases/download/{version|jvmci-tag}/{filename}.tar.gz"
},
"labsjdk-ce-latest:-llvm": {
"filename": "labsjdk-{version}-sulong-{platform}",
"url": "https://github.com/graalvm/labs-openjdk/releases/download/{version|jvmci-tag}/{filename}.tar.gz"
},

"labsjdk-ce-(?P<major>\\d+)": {
"filename": "labsjdk-{version}-{platform}",
"url": "https://github.com/graalvm/labs-openjdk-{major}/releases/download/{version|jvmci-tag}/{filename}.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18789,7 +18789,7 @@ def alarm_handler(signum, frame):
abort(1, killsig=signal.SIGINT)

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("6.49.0") # code owners
version = VersionSpec("6.49.1") # fetch-jdk labsjdk-ee-latest

_mx_start_datetime = datetime.utcnow()
_last_timestamp = _mx_start_datetime
Expand Down
16 changes: 12 additions & 4 deletions mx_fetchjdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,16 @@ def _parse_args(args):
Each keyword value can be processed by a filter by appending "|<filter>" to the keyword selector.
The supported filters are:
jvmci Extracts the first string that looks like a jvmci version (e.g. "8u302+05-jvmci-21.2-b01" -> "21.2-b01").
jvmci-tag Extracts the first string that looks like a jvmci tag (e.g. "8u302+05-jvmci-21.2-b01" -> "jvmci-21.2-b01").
jvmci Extracts the first string that looks like a jvmci version.
Note that with JDK 21, the JVMCI version scheme changed. There are no more JVMCI major and minor versions.
Instead, the full JDK version is considered part of the JVMCI version, e.g. "22.0.1+3-jvmci-b01".
In that case, the {jvmci} keyword will return the same as the {jvmci-tag} keyword. Examples:
"8u302+05-jvmci-21.2-b01" -> "21.2-b01"
"prefix-22.0.1+3-jvmci-b01Suffix" -> "22.0.1+3-jvmci-b01"
jvmci-tag Extracts the first string that looks like a jvmci tag. Examples:
"8u302+05-jvmci-21.2-b01" -> "jvmci-21.2-b01"
"prefix-22.0.1+3-jvmci-b01Suffix" -> "22.0.1+3-jvmci-b01"
If jdk-binaries.<id> contains "(P?<" it will be interpreted as a regular expression and the named pattern(s)
will be additional keywords for the template string (e.g. "major" in the example above).
Expand Down Expand Up @@ -576,8 +584,8 @@ def get_final_path(self, jdk_path):


_instantiate_filters = {
'jvmci': lambda value: re.sub(r".*jvmci-(\d+\.\d+-b\d+).*", r"\1", value),
'jvmci-tag': lambda value: re.sub(r".*(jvmci-\d+\.\d+-b\d+).*", r"\1", value)
'jvmci': lambda value: re.sub(r"(?:.*)-(.*-jvmci-b\d+).*|.*jvmci-(\d+\.\d+-b\d+).*", r"\1\2", value),
'jvmci-tag': lambda value: re.sub(r"(?:.*)-(.*-jvmci-b\d+).*|.*(jvmci-\d+\.\d+-b\d+).*", r"\1\2", value)
}

def _quote(value):
Expand Down

0 comments on commit aa775d2

Please sign in to comment.