Skip to content

Commit 647984e

Browse files
committed
ignore digests with different names when comparing Library and ResourceLibrary objects
1 parent bdd3403 commit 647984e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

mx.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -2076,9 +2076,13 @@ def _register_metadata(self):
20762076
"""
20772077
for l in self.libs:
20782078
existing = _libs.get(l.name)
2079-
# Check that suites that define same library are consistent
2080-
if existing is not None and existing != l and _check_global_structures:
2081-
abort('inconsistent library redefinition of ' + l.name + ' in ' + existing.suite.dir + ' and ' + l.suite.dir, context=l)
2079+
# Check that suites that define the same library are consistent wrt digests
2080+
if existing is not None and _check_global_structures:
2081+
digest1 = existing.digest
2082+
digest2 = l.digest
2083+
# Can only compare digests with the same name
2084+
if digest1.name == digest2.name and digest1.value != digest2.value:
2085+
abort(f'definition of {l} in {existing.suite.dir} and {l.suite.dir} have conflicting {digest1.name} values: {digest1} != {digest2}', context=l)
20822086
_libs[l.name] = l
20832087
for l in self.jreLibs:
20842088
existing = _jreLibs.get(l.name)
@@ -8737,7 +8741,7 @@ def _check_download_needed(self):
87378741
return not _check_file_with_digest(self.path, self.digest)
87388742

87398743
def _comparison_key(self):
8740-
return (self.digest, self.name)
8744+
return self.name
87418745

87428746

87438747
class PackedResourceLibrary(ResourceLibrary):
@@ -9042,7 +9046,7 @@ def _walk_deps_visit_edges(self, visited, in_edge, preVisit=None, visit=None, ig
90429046
self._walk_deps_visit_edges_helper(deps, visited, in_edge, preVisit, visit, ignoredEdges, visitEdge)
90439047

90449048
def _comparison_key(self):
9045-
return (self.digest, self.name)
9049+
return self.name
90469050

90479051
def get_urls(self):
90489052
return self.urls
@@ -18328,7 +18332,7 @@ def alarm_handler(signum, frame):
1832818332
abort(1, killsig=signal.SIGINT)
1832918333

1833018334
# The version must be updated for every PR (checked in CI)
18331-
version = VersionSpec("6.12.3") # GR-41905 - fix building with pypy
18335+
version = VersionSpec("6.12.4") # GR-42429 comparing Libraries should only consider name
1833218336

1833318337
currentUmask = None
1833418338
_mx_start_datetime = datetime.utcnow()

0 commit comments

Comments
 (0)