Name clash error message include hash of clashing packages (#39234)

Co-authored-by: Simon <simonleary@umass.edu>
This commit is contained in:
simonLeary42 2023-08-08 08:36:49 -04:00 committed by GitHub
parent feb26efecd
commit 6576655137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -321,12 +321,13 @@ def refresh(module_type, specs, args):
file2writer[item.layout.filename].append(item)
if len(file2writer) != len(writers):
spec_fmt_str = "{name}@={version}%{compiler}/{hash:7} {variants} arch={arch}"
message = "Name clashes detected in module files:\n"
for filename, writer_list in file2writer.items():
if len(writer_list) > 1:
message += "\nfile: {0}\n".format(filename)
for x in writer_list:
message += "spec: {0}\n".format(x.spec.format())
message += "spec: {0}\n".format(x.spec.format(spec_fmt_str))
tty.error(message)
tty.error("Operation aborted")
raise SystemExit(1)