diff options
author | Todd Gamblin <gamblin2@llnl.gov> | 2022-09-15 17:57:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-16 00:57:10 +0000 |
commit | a0c7209dc1480b16531fcb992642986f4796bc28 (patch) | |
tree | 6a5c5366fa88367c16643de8d29b1051a075a4ec /.github/ISSUE_TEMPLATE/build_error.yml | |
parent | 46d7ba9f789b1129e6879e1e58d1a09fe8f4ad10 (diff) | |
download | spack-a0c7209dc1480b16531fcb992642986f4796bc28.tar.gz spack-a0c7209dc1480b16531fcb992642986f4796bc28.tar.bz2 spack-a0c7209dc1480b16531fcb992642986f4796bc28.tar.xz spack-a0c7209dc1480b16531fcb992642986f4796bc28.zip |
bugfix: package hash should affect process, dag, and dunder hashes (#32516)
This fixes a bug where two installations that differ only by package hash will not show
up in `spack find`.
The bug arose because `_cmp_node` on `Spec` didn't include the package hash in its
yielded fields. So, any two `Spec` objects that were only different by package hash
would appear to be equal and would overwrite each other when inserted into the same
`dict`. Note that we could still *install* specs with different package hashes, and they
would appear in the database, but we code that needed to put them into data structures
that use `__hash__` would have issues.
This PR makes `Spec.__hash__` and `Spec.__eq__` include the `process_hash()`, and it
makes `Spec._cmp_node` include the package hash. All of these *should* include all
information in a spec so that we don't end up in a situation where we are blind to
particular field differences.
Eventually, we should unify the `_cmp_*` methods with `to_node_dict` so there aren't two
sources of truth, but this needs some thought, since the `_cmp_*` methods exist for
speed. We should benchmark whether it's really worth having two types of hashing now
that we use `json` instead of `yaml` for spec hashing.
- [x] Add `package_hash` to `Spec._cmp_node`
- [x] Add `package_hash` to `spack.solve.asp.spec_clauses` so that the `package_hash`
will show up in `spack diff`.
- [x] Add `package_hash` to the `process_hash` (which doesn't affect abstract specs
but will make concrete specs correct)
- [x] Make `_cmp_iter` report the dag_hash so that no two specs with different
process hashes will be considered equal.
Diffstat (limited to '.github/ISSUE_TEMPLATE/build_error.yml')
0 files changed, 0 insertions, 0 deletions