From ea7648ff84661089834a5d9f0005c6af820c2634 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 31 Jul 2018 00:13:31 -0700 Subject: [PATCH] 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 --- lib/spack/spack/cmd/common/arguments.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/cmd/common/arguments.py b/lib/spack/spack/cmd/common/arguments.py index 99a4abe876..7eeded8daa 100644 --- a/lib/spack/spack/cmd/common/arguments.py +++ b/lib/spack/spack/cmd/common/arguments.py @@ -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(