Make output order consistent
Closed this issue · 2 comments
I just adjusted a couple of dependencies in a project and it resulted in 2KLOC change in packages.nix (pruned). I suspect change in transitive dependencies caused some packages to be resolved sooner/later and therefore be placed in different place. If packages are sorted by name, diffs should be much smaller.
I don't have a public test-case, sorry.
We are using Data.Map
, Data.Set
, and Data.Graph
to store and manipulate loaded packages. They all require Ord
class on construction, thus should have a stable order. I also can not think of a place where reordering can happen.
The most obvious thing would be to sort resulting packages set as a final step.
The order of extra deps in stack.yaml
should matter. It may affect the reachableDependencies
DFS algorithm. It is most likely the source of a problem.