Skip to content

Commit

Permalink
extract_dts_includes.py: deterministic flash table with Python < 3.6
Browse files Browse the repository at this point in the history
To reproduce the issue this addresses, run "cmake -B96b_nitrogen"
twice with Python 3.5. Observe the order of the flash partition table
changing in:
"build{1,2}/zephyr/include/generated/generated_dts_board.conf" and
"generated_dts_board_unfixed.h"

Dictionaries are iterated in a random order by Python 3.5 and before.
This could have caused "Unstable" CI in PR #13921 and maybe others.
Anyway we want builds to be determimistic by default. Explicit
randomness can be added for better coverage but not by default.

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb authored and nashif committed Mar 7, 2019
1 parent 97f4265 commit 73cb0bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/dts/extract_dts_includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ def yaml_inc_error(msg):
def generate_defines():
# Generates #defines (and .conf file values) from DTS

for node_path in reduced.keys():
# sorted() otherwise Python < 3.6 randomizes the order of the flash
# partition table
for node_path in sorted(reduced.keys()):
generate_node_defines(node_path)

if not defs:
Expand Down

0 comments on commit 73cb0bf

Please sign in to comment.