diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-07-08 08:00:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-08 08:00:43 -0700 |
commit | 51b58f1478cea02907124c8f087d6798bfa03cd6 (patch) | |
tree | 9b2c978a13806b02a6c8c83b8dadeb221d7009bd /lib | |
parent | e8506994b1f3dad37dbc37e0a5c0c674e3fdfd0a (diff) | |
download | spack-51b58f1478cea02907124c8f087d6798bfa03cd6.tar.gz spack-51b58f1478cea02907124c8f087d6798bfa03cd6.tar.bz2 spack-51b58f1478cea02907124c8f087d6798bfa03cd6.tar.xz spack-51b58f1478cea02907124c8f087d6798bfa03cd6.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/spec.py | 7 |
1 files changed, 6 insertions, 1 deletions
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) |