diff options
| -rw-r--r-- | src/bootstrap/src/utils/step_graph.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bootstrap/src/utils/step_graph.rs b/src/bootstrap/src/utils/step_graph.rs index b1db9e61fda..c45825a4222 100644 --- a/src/bootstrap/src/utils/step_graph.rs +++ b/src/bootstrap/src/utils/step_graph.rs @@ -100,10 +100,12 @@ struct Node { #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] struct NodeHandle(usize); +/// Represents a dependency between two bootstrap steps. #[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] struct Edge { src: NodeHandle, dst: NodeHandle, + // Was the corresponding execution of a step cached, or was the step actually executed? cached: bool, } @@ -134,7 +136,11 @@ impl DotGraph { } fn add_cached_edge(&mut self, src: NodeHandle, dst: NodeHandle) { - self.edges.insert(Edge { src, dst, cached: true }); + // There's no point in rendering both cached and uncached edge + let uncached = Edge { src, dst, cached: false }; + if !self.edges.contains(&uncached) { + self.edges.insert(Edge { src, dst, cached: true }); + } } fn get_handle_by_key(&self, key: &str) -> Option<NodeHandle> { |
