bugfix: identical specs with different DAG hashes don't shadow each other

- logic used in `spack find` was hiding duplicate installations if their
  hashes were different

- short hash doesn't work in this scenario, since specs are structurally
  identical

- ConstraintAction always works on a DB query, so use the DAG hash to
  ensure uniqueness
This commit is contained in:
Todd Gamblin 2018-07-31 00:13:31 -07:00
parent 3e94c4d573
commit ea7648ff84

View file

@ -57,11 +57,13 @@ def _specs(self, **kwargs):
return spack.store.db.query(**kwargs)
# Return only matching stuff otherwise.
specs = set()
specs = {}
for spec in qspecs:
for s in spack.store.db.query(spec, **kwargs):
specs.add(s)
return sorted(specs)
# This is fast for already-concrete specs
specs[s.dag_hash()] = s
return sorted(specs.values())
_arguments['constraint'] = Args(