From d39a2ce43c08b6da85cb95352015d2ae51ba5881 Mon Sep 17 00:00:00 2001 From: Danilo Ansaloni Date: Tue, 30 Jul 2024 19:10:33 +0200 Subject: [PATCH 1/3] Add version information to the manifest only when it is available from the suite. Avoids problems with distributions that: - do not have `maven: False` but are not ready for Maven deployment - are deployed passing `--version-suite` --- src/mx/_impl/mx.py | 14 +++++++++----- src/mx/_impl/mx_jardistribution.py | 9 +++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/mx/_impl/mx.py b/src/mx/_impl/mx.py index dd589e00..08efc349 100755 --- a/src/mx/_impl/mx.py +++ b/src/mx/_impl/mx.py @@ -2676,10 +2676,7 @@ def release_version(self, snapshotSuffix='dev'): Gets the release tag from VC or create a time based once if VC is unavailable """ if snapshotSuffix not in self._releaseVersion: - _version = self._get_early_suite_dict_property('version') - if _version and self.getMxCompatibility().addVersionSuffixToExplicitVersion(): - if not self.is_release(): - _version = _version + '-' + snapshotSuffix + _version = self.release_version_from_suite(snapshotSuffix=snapshotSuffix) if not _version and self.vc: _version = self.vc.release_version_from_tags(self.vc_dir, self.name, snapshotSuffix=snapshotSuffix) if not _version: @@ -2687,6 +2684,13 @@ def release_version(self, snapshotSuffix='dev'): self._releaseVersion[snapshotSuffix] = _version return self._releaseVersion[snapshotSuffix] + def release_version_from_suite(self, snapshotSuffix='dev'): + _version = self._get_early_suite_dict_property('version') + if _version and self.getMxCompatibility().addVersionSuffixToExplicitVersion(): + if not self.is_release(): + _version = _version + '-' + snapshotSuffix + return _version + def scm_metadata(self, abortOnError=False): scm = self.scm if scm: @@ -18197,7 +18201,7 @@ def alarm_handler(signum, frame): _CACHE_DIR = get_env('MX_CACHE_DIR', join(dot_mx_dir(), 'cache')) # The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue -version = VersionSpec("7.31.2") # GR-55288 support for new BaristaBenchmarkSuite +version = VersionSpec("7.32.0") # GR-56702: fix manifest version _mx_start_datetime = datetime.utcnow() diff --git a/src/mx/_impl/mx_jardistribution.py b/src/mx/_impl/mx_jardistribution.py index 6c3b5d57..3dc86bb8 100644 --- a/src/mx/_impl/mx_jardistribution.py +++ b/src/mx/_impl/mx_jardistribution.py @@ -781,12 +781,17 @@ def stage_archive(self): if self.dist.maven: developer = self.dist.suite.developer - release_version = self.dist.suite.release_version() + release_version = self.dist.suite.release_version_from_suite() + if release_version is None: + public_tag = 'public' + if isinstance(self.dist.maven, dict) and public_tag in self.dist.maven.get('tag', []): + mx.warn(f"Distribution '{self.dist.name}' has a maven dictionary with tag '{public_tag}' but its declaring suite ('{self.dist.suite.name}') does not have a version. Therefore, its manifest will not contain version information.") self.manifest.setdefault('Name', self.dist.maven_artifact_id()) for group in 'Specification', 'Implementation': - self.manifest.setdefault(f'{group}-Version', release_version) + if release_version is not None: + self.manifest.setdefault(f'{group}-Version', release_version) if 'organization' in developer: self.manifest.setdefault(f'{group}-Vendor', developer['organization']) From a45e736de06a8b613aff3a6f80814091fcd99ce8 Mon Sep 17 00:00:00 2001 From: Danilo Ansaloni Date: Wed, 25 Sep 2024 19:10:54 +0200 Subject: [PATCH 2/3] Read release information only from the suite. --- src/mx/_impl/mx.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mx/_impl/mx.py b/src/mx/_impl/mx.py index 08efc349..0f99c8c1 100755 --- a/src/mx/_impl/mx.py +++ b/src/mx/_impl/mx.py @@ -2660,7 +2660,7 @@ def is_release(self): """ Returns True if the release tag from VC is known and is not a snapshot """ - _release = self._get_early_suite_dict_property('release') + _release = self.is_release_from_suite() if _release is not None: return _release if not self.vc: @@ -2671,6 +2671,9 @@ def is_release(self): else: return self.vc.is_release_from_tags(self.vc_dir, self.name) + def is_release_from_suite(self): + return self._get_early_suite_dict_property('release') + def release_version(self, snapshotSuffix='dev'): """ Gets the release tag from VC or create a time based once if VC is unavailable @@ -2687,7 +2690,7 @@ def release_version(self, snapshotSuffix='dev'): def release_version_from_suite(self, snapshotSuffix='dev'): _version = self._get_early_suite_dict_property('version') if _version and self.getMxCompatibility().addVersionSuffixToExplicitVersion(): - if not self.is_release(): + if not self.is_release_from_suite(): _version = _version + '-' + snapshotSuffix return _version From 953566a2490613fbfd3e2054e77b2cac6279eb62 Mon Sep 17 00:00:00 2001 From: Danilo Ansaloni Date: Wed, 25 Sep 2024 19:31:23 +0200 Subject: [PATCH 3/3] Sync common.json. --- common.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common.json b/common.json index e10a1a48..be2d46c0 100644 --- a/common.json +++ b/common.json @@ -47,13 +47,13 @@ "oraclejdk23": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+37", "platformspecific": true, "extrabundles": ["static-libs"]}, - "oraclejdk-latest": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+15", "platformspecific": true, "extrabundles": ["static-libs"]}, - "labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+15-jvmci-b01", "platformspecific": true }, - "labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+15-jvmci-b01-debug", "platformspecific": true }, - "labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+15-jvmci-b01-sulong", "platformspecific": true }, - "labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+15-jvmci-b01", "platformspecific": true }, - "labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+15-jvmci-b01-debug", "platformspecific": true }, - "labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+15-jvmci-b01-sulong", "platformspecific": true } + "oraclejdk-latest": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+16", "platformspecific": true, "extrabundles": ["static-libs"]}, + "labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+16-jvmci-b01", "platformspecific": true }, + "labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+16-jvmci-b01-debug", "platformspecific": true }, + "labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+16-jvmci-b01-sulong", "platformspecific": true }, + "labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+16-jvmci-b01", "platformspecific": true }, + "labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+16-jvmci-b01-debug", "platformspecific": true }, + "labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+16-jvmci-b01-sulong", "platformspecific": true } }, "eclipse": {