Make internal concretization API more stable#47975
Make internal concretization API more stable#47975alalazo wants to merge 4 commits intospack:developfrom
Conversation
| if (not value) and self.concrete and self.installed: | ||
| return |
There was a problem hiding this comment.
I'm still not sure why this was added. We need to double check if it was a performance fix, and if it is still needed. Given the type of checks, it's possibly related to the DB.
There was a problem hiding this comment.
We also have an issue where we don't enforce having the package hash in the node dict correctly, not really sure what to do about this:
Lines 2235 to 2240 in 422f829
Basically, if a hash needs the package hash, but we don't have the attribute, we'll just skip it. This seems incorrect in general.
There was a problem hiding this comment.
@haampie What do you think about #47975 (comment) ? In my opinion the right thing to do would be to store the provenance of the package hash, which could be:
- Absent ("old" specs)
- Read from specfile, etc. (computed once upon a time, should be considered a constant that is difficult to be re-computed again)
- "Just" computed
The idea is that:
- Only case 1 should be allowed not to have a package hash.
- We probably never need to compute a hash for case 1 and 2, since we'll be reading the hash values from specfile
- Only case 3 should drop the cached hash values on a call to
Spec.clear_caches, since for the other cases the values are just constant that we might not be able to re-compute with the current Spack
I wonder if it is worth to refactor in this sense, instead of doing what we do now (if an attribute is not there, assume we are dealing with an old spec format).
7cce739 to
6f59ba2
Compare
fixes #47973
This fixes the inconsistency in hash computation observed on subsequent deconcretizations / reconcretizations of specs using the internal API.
Modifications:
dag_hashandprocess_hashon abstract specs_mark_concretelogic, by removing a check