Skip to content

Commit

Permalink
scripts/build/elf_parser.py: make dependency graph output deterministic
Browse files Browse the repository at this point in the history
Python's sets are not deterministic.

`devices` were already sorted but `dev_supports` is still a
non-deterministic set. Sort dev_supports to make the graph output
deterministic.

Fixes commit 2994247 ("scripts: gen_handles: output dependency graph")

It is quite ironic that this initial and non-deterministic graph commit
was concurrent with and slightly delayed other commit
f896fc2 ("scripts: gen_handles: Sort the device handles") which
fixed another, similar non-determinism issue in the same area. A true
"whack-a-mole"!

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb authored and henrikbrixandersen committed Dec 4, 2023
1 parent eea56d2 commit fb8d41b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/build/elf_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,6 @@ def device_dependency_graph(self, title, comment):
)
dot.node(str(dev.ordinal), text)
for dev in self.devices:
for sup in dev.devs_supports:
for sup in sorted(dev.devs_supports):
dot.edge(str(dev.ordinal), str(sup.ordinal))
return dot

0 comments on commit fb8d41b

Please sign in to comment.