build_environment: only traverse unique edges (#48301)
Wrap EnvironmentVisitor in CoverEdgesVisitor so only unique edges are enqueued. Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
This commit is contained in:
parent
0394def68b
commit
e374f8fb66
@ -923,7 +923,9 @@ def effective_deptypes(
|
|||||||
in reverse so that dependents override dependencies, not the other way around."""
|
in reverse so that dependents override dependencies, not the other way around."""
|
||||||
topo_sorted_edges = traverse.traverse_topo_edges_generator(
|
topo_sorted_edges = traverse.traverse_topo_edges_generator(
|
||||||
traverse.with_artificial_edges(specs),
|
traverse.with_artificial_edges(specs),
|
||||||
visitor=EnvironmentVisitor(*specs, context=context),
|
visitor=traverse.CoverEdgesVisitor(
|
||||||
|
EnvironmentVisitor(*specs, context=context), key=traverse.by_dag_hash
|
||||||
|
),
|
||||||
key=traverse.by_dag_hash,
|
key=traverse.by_dag_hash,
|
||||||
root=True,
|
root=True,
|
||||||
all_edges=True,
|
all_edges=True,
|
||||||
|
@ -381,7 +381,7 @@ def traverse_topo_edges_generator(edges, visitor, key=id, root=True, all_edges=F
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
edges (list): List of EdgeAndDepth instances
|
edges (list): List of EdgeAndDepth instances
|
||||||
visitor: visitor instance that defines the sub-DAG to traverse
|
visitor: visitor that produces unique edges defining the (sub)DAG of interest.
|
||||||
key: function that takes a spec and outputs a key for uniqueness test.
|
key: function that takes a spec and outputs a key for uniqueness test.
|
||||||
root (bool): Yield the root nodes themselves
|
root (bool): Yield the root nodes themselves
|
||||||
all_edges (bool): When ``False`` only one in-edge per node is returned, when
|
all_edges (bool): When ``False`` only one in-edge per node is returned, when
|
||||||
|
Loading…
Reference in New Issue
Block a user