From 9042ed0db03515716642973d1ec3947663148ced Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Fri, 10 May 2024 14:33:06 -0700 Subject: [PATCH 1/4] feat(graph): also generate the transitive reduction --- scripts/graph.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/graph.sh b/scripts/graph.sh index a3f94344c66..b6143cbba5b 100755 --- a/scripts/graph.sh +++ b/scripts/graph.sh @@ -1,5 +1,9 @@ #!/bin/bash # Generates visualizations of the internal package dependency graph. +# Also generates visualizations of the transitive reduction (tred) of +# that graph, which is the minimal graph with the same *transitive* +# dependcies. Much more legible by itelf. Seeing the two side by side +# often helps to understand the full picture. set -ueo pipefail DIR=$(dirname -- "${BASH_SOURCE[0]}") { @@ -20,11 +24,15 @@ DIR=$(dirname -- "${BASH_SOURCE[0]}") ' echo '}' # normalize -} | dot -Tcanon > packages-graph.dot +} | dot -Tcanon | tred > packages-graph.dot dot -Tpng < packages-graph.dot > "$DIR"/../packages-graph.png dot -Tsvg < packages-graph.dot > "$DIR"/../packages-graph.svg +tred packages-graph-tred.dot +dot -Tpng "$DIR"/../packages-graph-tred.png +dot -Tsvg "$DIR"/../packages-graph-tred.svg + if acyclic packages-graph.dot | dot -Tcanon > packages-graph-sans-cycles.dot; then echo 1>&2 "No cycles in 'dependencies' of packages." else From 5b690bea822b2c254b3ed083d176343a67d8f4e1 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Fri, 10 May 2024 14:43:01 -0700 Subject: [PATCH 2/4] fixup! fix mistake --- scripts/graph.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/graph.sh b/scripts/graph.sh index b6143cbba5b..cbe8b412673 100755 --- a/scripts/graph.sh +++ b/scripts/graph.sh @@ -24,7 +24,7 @@ DIR=$(dirname -- "${BASH_SOURCE[0]}") ' echo '}' # normalize -} | dot -Tcanon | tred > packages-graph.dot +} | dot -Tcanon >packages-graph.dot dot -Tpng < packages-graph.dot > "$DIR"/../packages-graph.png dot -Tsvg < packages-graph.dot > "$DIR"/../packages-graph.svg From a637b1af4040f7d9c40550a4bbb8c4e19b07142b Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Fri, 10 May 2024 14:44:04 -0700 Subject: [PATCH 3/4] fixup! bash format --- scripts/graph.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/graph.sh b/scripts/graph.sh index cbe8b412673..d5daaf0f1c5 100755 --- a/scripts/graph.sh +++ b/scripts/graph.sh @@ -24,14 +24,14 @@ DIR=$(dirname -- "${BASH_SOURCE[0]}") ' echo '}' # normalize -} | dot -Tcanon >packages-graph.dot +} | dot -Tcanon > packages-graph.dot dot -Tpng < packages-graph.dot > "$DIR"/../packages-graph.png dot -Tsvg < packages-graph.dot > "$DIR"/../packages-graph.svg -tred packages-graph-tred.dot -dot -Tpng "$DIR"/../packages-graph-tred.png -dot -Tsvg "$DIR"/../packages-graph-tred.svg +tred < packages-graph.dot > packages-graph-tred.dot +dot -Tpng < packages-graph-tred.dot > "$DIR"/../packages-graph-tred.png +dot -Tsvg < packages-graph-tred.dot > "$DIR"/../packages-graph-tred.svg if acyclic packages-graph.dot | dot -Tcanon > packages-graph-sans-cycles.dot; then echo 1>&2 "No cycles in 'dependencies' of packages." From be3b9b8b0aba42a0819845040da999d4ccbee7cd Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Fri, 10 May 2024 14:48:17 -0700 Subject: [PATCH 4/4] fixup! typo --- scripts/graph.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/graph.sh b/scripts/graph.sh index d5daaf0f1c5..25a296b40c0 100755 --- a/scripts/graph.sh +++ b/scripts/graph.sh @@ -2,7 +2,7 @@ # Generates visualizations of the internal package dependency graph. # Also generates visualizations of the transitive reduction (tred) of # that graph, which is the minimal graph with the same *transitive* -# dependcies. Much more legible by itelf. Seeing the two side by side +# dependencies. Much more legible by itelf. Seeing the two side by side # often helps to understand the full picture. set -ueo pipefail DIR=$(dirname -- "${BASH_SOURCE[0]}")