From 51b58f1478cea02907124c8f087d6798bfa03cd6 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 8 Jul 2019 08:00:43 -0700 Subject: bugfix: conflicts should print out the spec that has the conflict (#11947) - Fix a bug introdcued by removing parse_anonymous_spec() - Conflicts' when specs are now *actually* anonymous, and the name of the package is implicit, so we need to remember to add it back to error messages. --- lib/spack/spack/spec.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 66cdafa59c..28b758ed2f 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -2017,13 +2017,18 @@ class Spec(object): # Now that the spec is concrete we should check if # there are declared conflicts + # + # TODO: this needs rethinking, as currently we can only express + # TODO: internal configuration conflicts within one package. matches = [] for x in self.traverse(): for conflict_spec, when_list in x.package_class.conflicts.items(): if x.satisfies(conflict_spec, strict=True): for when_spec, msg in when_list: if x.satisfies(when_spec, strict=True): - matches.append((x, conflict_spec, when_spec, msg)) + when = when_spec.copy() + when.name = x.name + matches.append((x, conflict_spec, when, msg)) if matches: raise ConflictsInSpecError(self, matches) -- cgit v1.2.3-70-g09d2