From 2f4b40fe4ebd61943ed10f25e6406be6ad68f18e Mon Sep 17 00:00:00 2001 From: Jakub Beránek Date: Fri, 1 Aug 2025 15:14:58 +0200 Subject: Do not render both cached and uncached edge between two steps --- src/bootstrap/src/utils/step_graph.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/bootstrap') 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 { -- cgit 1.4.1-3-g733a5