Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elf_parser.py: make dependency graph output deterministic #66014

Merged

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Dec 1, 2023

2 commits. Main one:

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"!

This allows sorting objects consistently without having to specific a
key.

No functional change yet.

Signed-off-by: Marc Herbert <[email protected]>
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]>
@marc-hb marc-hb changed the title make dependency graph output deterministic elf_parser.py: make dependency graph output deterministic Dec 1, 2023
@marc-hb marc-hb marked this pull request as ready for review December 1, 2023 08:33
@marc-hb marc-hb added the bug The issue is a bug, or the PR is fixing a bug label Dec 1, 2023
@henrikbrixandersen henrikbrixandersen merged commit fb8d41b into zephyrproject-rtos:main Dec 4, 2023
27 checks passed
@henrikbrixandersen
Copy link
Member

@tejlmand Sorry, I accidentally merged this without your approval. Please let me know if any action is needed. My apologies.

@marc-hb marc-hb deleted the deterministic-dev-graph branch December 5, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants