diff options
Diffstat (limited to 'lib/spack/spack/spec.py')
-rw-r--r-- | lib/spack/spack/spec.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 8b13374430..a153ffe50f 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -1567,6 +1567,14 @@ class Spec(object): """ return self._cached_hash(ht.build_hash, length) + def process_hash(self, length=None): + """Hash used to store specs in environments. + + This hash includes build and test dependencies and is only used to + serialize a spec and pass it around among processes. + """ + return self._cached_hash(ht.process_hash, length) + def full_hash(self, length=None): """Hash to determine when to rebuild packages in the build pipeline. @@ -1832,6 +1840,7 @@ class Spec(object): not self._hashes_final) # lazily compute if write_full_hash: node[ht.full_hash.name] = self.full_hash() + write_build_hash = 'build' in hash.deptype and ( self._hashes_final and self._build_hash or # cached and final not self._hashes_final) # lazily compute @@ -1839,8 +1848,12 @@ class Spec(object): node[ht.build_hash.name] = self.build_hash() else: node['concrete'] = False + if hash.name == 'build_hash': node[hash.name] = self.build_hash() + elif hash.name == 'process_hash': + node[hash.name] = self.process_hash() + return node def to_yaml(self, stream=None, hash=ht.dag_hash): @@ -1974,7 +1987,8 @@ class Spec(object): # new format: elements of dependency spec are keyed. for key in (ht.full_hash.name, ht.build_hash.name, - ht.dag_hash.name): + ht.dag_hash.name, + ht.process_hash.name): if key in elt: dep_hash, deptypes = elt[key], elt['type'] hash_type = key @@ -4430,7 +4444,7 @@ class Spec(object): return hash(lang.tuplify(self._cmp_iter)) def __reduce__(self): - return _spec_from_dict, (self.to_dict(hash=ht.build_hash),) + return _spec_from_dict, (self.to_dict(hash=ht.process_hash),) def merge_abstract_anonymous_specs(*abstract_specs): |