summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2019-11-05 06:12:12 -0700
committerGitHub <noreply@github.com>2019-11-05 06:12:12 -0700
commita6ccb5b2fa8861c911f9580f213be4a62087b383 (patch)
tree0d3bdd47c0077a2ec8b1da0f5f90cdebbf246c6f /lib
parentb77974e9862324cd0df4c99a9e7c4ab99b81c5f2 (diff)
downloadspack-a6ccb5b2fa8861c911f9580f213be4a62087b383.tar.gz
spack-a6ccb5b2fa8861c911f9580f213be4a62087b383.tar.bz2
spack-a6ccb5b2fa8861c911f9580f213be4a62087b383.tar.xz
spack-a6ccb5b2fa8861c911f9580f213be4a62087b383.zip
bugfix: uninstall should find concrete specs by DAG hash (#13598)
This fixes a regression introduced in #10792. `spack uninstall` in an environment would not match concrete query specs properly after the index hash of enviroments changed. - [x] Search by DAG hash for specs to remove instead of by build hash
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/environment.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py
index 4ab01cb250..f16599c215 100644
--- a/lib/spack/spack/environment.py
+++ b/lib/spack/spack/environment.py
@@ -833,8 +833,16 @@ class Environment(object):
if not matches:
# concrete specs match against concrete specs in the env
+ # by *dag hash*, not build hash.
+ dag_hashes_in_order = [
+ self.specs_by_hash[build_hash].dag_hash()
+ for build_hash in self.concretized_order
+ ]
+
specs_hashes = zip(
- self.concretized_user_specs, self.concretized_order)
+ self.concretized_user_specs, dag_hashes_in_order
+ )
+
matches = [
s for s, h in specs_hashes
if query_spec.dag_hash() == h