about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-08-01 15:14:58 +0200
committerJakub Beránek <berykubik@gmail.com>2025-08-04 08:29:18 +0200
commit2f4b40fe4ebd61943ed10f25e6406be6ad68f18e (patch)
tree1e872fe117ad878621eb5c043b9fad4d0188afdd
parent450040f2d39ae0f5ec7889d48d1a7aa4d2c08c5b (diff)
downloadrust-2f4b40fe4ebd61943ed10f25e6406be6ad68f18e.tar.gz
rust-2f4b40fe4ebd61943ed10f25e6406be6ad68f18e.zip
Do not render both cached and uncached edge between two steps
-rw-r--r--src/bootstrap/src/utils/step_graph.rs8
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> {