Skip to content

bugfix: uninstall should find concrete specs by DAG hash#13598

Merged
tgamblin merged 1 commit intodevelopfrom
bugfix/env-uninstall
Nov 5, 2019
Merged

bugfix: uninstall should find concrete specs by DAG hash#13598
tgamblin merged 1 commit intodevelopfrom
bugfix/env-uninstall

Conversation

@tgamblin
Copy link
Copy Markdown
Member

@tgamblin tgamblin commented Nov 5, 2019

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.

  • Search by DAG hash for specs to remove instead of by build hash

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
Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm relatively new to this part of the code, but considering what I see here:

# If we are reading an older lockfile format (which uses dag hashes
# that exclude build deps), we use this to convert the old
# concretized_order to the full hashes (preserving the order)
old_hash_to_new = {}
self.specs_by_hash = {}
for _, spec in specs_by_hash.items():
dag_hash = spec.dag_hash()
build_hash = spec.build_hash()
if dag_hash in root_hashes:
old_hash_to_new[dag_hash] = build_hash
if (dag_hash in root_hashes or build_hash in root_hashes):
self.specs_by_hash[build_hash] = spec
if old_hash_to_new:
# Replace any older hashes in concretized_order with hashes
# that include build deps
self.concretized_order = [
old_hash_to_new.get(h, h) for h in self.concretized_order]

the version in this PR seems more correct. However I have to say that I couldn't come up with a simple case in which spack uninstall <anything> has a behavior that is different on develop compared to this PR.

@tgamblin tgamblin merged commit a6ccb5b into develop Nov 5, 2019
@tgamblin tgamblin deleted the bugfix/env-uninstall branch December 24, 2019 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants