Verified Commit 3b672014 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

Sort the reverse dependencies so output is predictable

We build a reverse dependency map which contains a HashSet of reverse
dependencies which are not sorted. This leads to the graph being
generated different on multiple runs which in return makes the output
not predictable. While not being a "rebuild order" issue, it might lead
to confusion.

Merging the pkgnames into one DFS graph also resolves the issue of
multiple inputs not being merged in output.

Fixes: #11, #12
parent e4136ca4
Pipeline #6725 passed with stages
in 3 minutes and 31 seconds
......@@ -131,7 +131,10 @@ pub fn run(
to_visit.extend(rev_deps_for_pkg.iter().map(|x| x.as_str()));
}
for rev_dep in rev_deps_for_pkg {
let mut rev_deps_for_pkg_vec = rev_deps_for_pkg.iter().collect::<Vec<_>>();
rev_deps_for_pkg_vec.sort();
for rev_dep in rev_deps_for_pkg_vec {
let depnode = *cache_node
.entry(&rev_dep.as_str())
.or_insert_with(|| graph.add_node(rev_dep));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment