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

Sort a few python dicts for deterministic builds, even with python 3.5 and earlier. #14119

Merged
merged 2 commits into from
Mar 7, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I missed this earlier, but could get rid of the .keys(). x in dict, for x in dict, sorted(dict), etc., always uses the keys.

Copy link
Collaborator Author

@marc-hb marc-hb Mar 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed but I'd like to keep this particular commit as minimal as possible :-) Not just for aesthetic reasons but also cherry-picking for testing / backporting etc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, fine with me.

generate_node_defines(node_path)

if not defs:
Expand Down