Skip to content

Commit

Permalink
[GR-48785] Print error messages during compression.
Browse files Browse the repository at this point in the history
PullRequest: mx/1679
  • Loading branch information
ansalond committed Sep 21, 2023
2 parents ec9740f + 5833684 commit d6c89c9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 16 deletions.
28 changes: 22 additions & 6 deletions ci/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ 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(version) =
Expand All @@ -21,21 +36,21 @@ local common_json = import "../common.json";
std.parseInt(number_prefix(version[3:]))
,
local jdks_data = {
oraclejdk11: common_json.jdks["oraclejdk11"] + { jdk_version:: 11 },
oraclejdk11: jdk_base + common_json.jdks["oraclejdk11"] + { jdk_version:: 11 },
} + {
[name]: common_json.jdks[name] + { jdk_version:: 17 }
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: 17 }
for name in ["oraclejdk17"] + variants("labsjdk-ce-17") + variants("labsjdk-ee-17")
} + {
[name]: common_json.jdks[name] + { jdk_version:: 19 }
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: 19 }
for name in ["oraclejdk19"] + variants("labsjdk-ce-19") + variants("labsjdk-ee-19")
} + {
[name]: common_json.jdks[name] + { jdk_version:: 20 }
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: 20 }
for name in ["oraclejdk20"] + variants("labsjdk-ce-20") + variants("labsjdk-ee-20")
} + {
[name]: common_json.jdks[name] + { jdk_version:: 21 }
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: 21 }
for name in ["oraclejdk21"] + variants("labsjdk-ce-21") + variants("labsjdk-ee-21")
} + {
[name]: common_json.jdks[name] + { jdk_version:: parse_labsjdk_version(self.version)}
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: parse_labsjdk_version(self.version), jdk_name:: "jdk-latest"}
for name in variants("labsjdk-ce-latest") + variants("labsjdk-ee-latest")
},
assert std.assertEqual(std.objectFields(common_json.jdks), std.objectFields(jdks_data)),
Expand All @@ -50,6 +65,7 @@ local common_json = import "../common.json";
[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)
} + {
Expand Down
12 changes: 6 additions & 6 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +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 },

"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+13-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+13-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+13-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+13-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+13-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+13-jvmci-b01-sulong", "platformspecific": true }
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+15-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+15-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+15-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+15-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+15-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+15-jvmci-b01-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
12 changes: 8 additions & 4 deletions mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5747,9 +5747,13 @@ def prePush(self, f):
tgz = f + '.gz'
logv(f'Compressing {f}...')
if AbstractTARDistribution._has_gzip():
with open(tgz, 'wb') as tar:
# force, quiet, cat to stdout
run([AbstractTARDistribution._gzip_binary(), '-f', '-q', '-c', f], out=tar)
def _compress_with_gzip(quiet, nonZeroIsFatal):
with open(tgz, 'wb') as tar:
# force, optionally quiet, cat to stdout
return run([AbstractTARDistribution._gzip_binary(), '-f'] + (['-q'] if quiet else []) + ['-c', f], out=tar, nonZeroIsFatal=nonZeroIsFatal)
if _compress_with_gzip(True, False) != 0:
# if the first execution failed, try again not in quiet mode to see possible error messages on stderr
_compress_with_gzip(False, True)
else:
with gzip.open(tgz, 'wb') as gz, open(f, 'rb') as tar:
shutil.copyfileobj(tar, gz)
Expand Down Expand Up @@ -18789,7 +18793,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.50.1") # GR-47930 - Improve SDK lookup in intellijinit.
version = VersionSpec("6.50.2") # GR-48785 - Error messages during compression.

_mx_start_datetime = datetime.utcnow()
_last_timestamp = _mx_start_datetime
Expand Down

0 comments on commit d6c89c9

Please sign in to comment.