summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-07-31 00:13:31 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-11-09 00:31:24 -0800
commitea7648ff84661089834a5d9f0005c6af820c2634 (patch)
tree5ac253ddcf8e632cd67049b66a2c53ee6e0c8d7d /lib
parent3e94c4d573e8316e40d551d62266198236b66eed (diff)
downloadspack-ea7648ff84661089834a5d9f0005c6af820c2634.tar.gz
spack-ea7648ff84661089834a5d9f0005c6af820c2634.tar.bz2
spack-ea7648ff84661089834a5d9f0005c6af820c2634.tar.xz
spack-ea7648ff84661089834a5d9f0005c6af820c2634.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/common/arguments.py8
1 files 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 @@ class ConstraintAction(argparse.Action):
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(