fix full hash calls in spack graph

This commit is contained in:
Todd Gamblin 2022-04-12 16:51:09 -07:00
parent 283a4e6068
commit 9d9e970367

View File

@ -406,12 +406,12 @@ def write(self, spec, color=None, out=None):
# Colors associated with each node in the DAG. # Colors associated with each node in the DAG.
# Edges are colored by the node they point to. # Edges are colored by the node they point to.
self._name_to_color = { self._name_to_color = {
spec.full_hash(): self.colors[i % len(self.colors)] spec.dag_hash(): self.colors[i % len(self.colors)]
for i, spec in enumerate(nodes_in_topological_order) for i, spec in enumerate(nodes_in_topological_order)
} }
# Frontier tracks open edges of the graph as it's written out. # Frontier tracks open edges of the graph as it's written out.
self._frontier = [[spec.full_hash()]] self._frontier = [[spec.dag_hash()]]
while self._frontier: while self._frontier:
# Find an unexpanded part of frontier # Find an unexpanded part of frontier
i = find(self._frontier, lambda f: len(f) > 1) i = find(self._frontier, lambda f: len(f) > 1)
@ -488,14 +488,14 @@ def write(self, spec, color=None, out=None):
node = nodes_in_topological_order.pop() node = nodes_in_topological_order.pop()
# Find the named node in the frontier and draw it. # Find the named node in the frontier and draw it.
i = find(self._frontier, lambda f: node.full_hash() in f) i = find(self._frontier, lambda f: node.dag_hash() in f)
self._node_line(i, node) self._node_line(i, node)
# Replace node with its dependencies # Replace node with its dependencies
self._frontier.pop(i) self._frontier.pop(i)
deps = node.dependencies(deptype=self.deptype) deps = node.dependencies(deptype=self.deptype)
if deps: if deps:
deps = sorted((d.full_hash() for d in deps), reverse=True) deps = sorted((d.dag_hash() for d in deps), reverse=True)
self._connect_deps(i, deps, "new-deps") # anywhere. self._connect_deps(i, deps, "new-deps") # anywhere.
elif self._frontier: elif self._frontier: