zephyr/scripts
Marc Herbert 725abdf430 gen_app_partitions.py: make generated/app_smem_*.ld files deterministic
Dictionaries are not ordered in Python 3.5 and before, so building twice
in a row could lead to a different partition order, different
build/zephyr/include/generated/app_smem_*.ld files and different
binaries.

Fix with a minor change to the "for" loop in the output function:
make it iterate on sorted(partitions.items()) instead of the raw and
randomly ordered partitions dictionary.

It is easy to reproduce the issue even without downgrading to an
obsolete Python version; pick a test like samples/userspace/shared_mem/
and simply change the code to this:

--- a/scripts/gen_app_partitions.py
+++ b/scripts/gen_app_partitions.py
@@ -159,10 +159,12 @@ def parse_elf_file(partitions):
                     partitions[partition_name][SZ] += size

+import random
 def generate_final_linker(linker_file, partitions):
     string = linker_start_seq
     size_string = ''
-    for partition, item in sorted(partitions.items()):
+    for partition, item in sorted(partitions.items(),
+                                  key=lambda x: random.random()):
         string += data_template.format(partition)
         if LIB in item:
             for lib in item[LIB]:

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-06-27 07:18:09 -04:00
..
checkpatch
ci ci: increase sleep time between sanitycheck runs 2019-06-20 22:15:27 +02:00
coccinelle
dts Bluetooth: hci_uart: Use DT for the hci_uart UART 2019-06-26 12:37:04 +02:00
footprint
gitlint
kconfig genrest: De-spam docs by skipping direct deps. in more places 2019-06-24 12:14:06 -07:00
sanity_chk sanitycheck harness: Correct ordered regex handling 2019-06-19 14:37:20 -04:00
support
west_commands west: runners: Guess build folder 2019-06-26 11:50:26 -04:00
.gitignore
check_link_map.py
checkpatch.pl dts: import vendor-prefixes.txt from linux kernel 2019-05-22 12:40:20 -04:00
checkstack.pl
coccicheck docs: fix misspelling across the tree 2019-06-19 15:34:13 -05:00
dir_is_writeable.py
elf_helper.py kernel: add futex support 2019-06-24 15:38:21 -07:00
file2hex.py
filter-known-issues.py docs: fix misspelling across the tree 2019-06-19 15:34:13 -05:00
gen_app_partitions.py gen_app_partitions.py: make generated/app_smem_*.ld files deterministic 2019-06-27 07:18:09 -04:00
gen_cfb_font_header.py generated/cfb_font_dice.h: don't leak absolute paths in comment 2019-06-19 08:40:59 -04:00
gen_gcov_files.py
gen_kobject_list.py net: ptp: clock: Add usermode support to ptp_clock_get() 2019-06-25 15:22:51 +03:00
gen_offset_header.py
gen_priv_stacks.py scripts: gen_priv_stacks.py: use the right alignment for priv stacks 2019-06-24 10:16:57 -07:00
gen_relocate_app.py gen_relocate_app.py: make generated/linker_relocate.ld deterministic 2019-06-27 07:18:09 -04:00
gen_syscall_header.py
gen_syscalls.py
mergehex.py scripts: mergehex: Add --overlap argument 2019-05-16 07:16:55 -05:00
parse_syscalls.py
process_gperf.py
qemu-machine-hack.py
requirements.txt scripts: Upgrade pyocd for pack support 2019-06-18 23:03:35 -04:00
sanitycheck sanitycheck: show handler_time in -v output (qemu 2.032s) 2019-06-21 13:47:32 -04:00
series-push-hook.sh
spelling.txt
subfolder_list.py
tags.sh
valgrind.supp
waitpid
west-commands.yml west: Add completion command 2019-05-10 13:08:27 +02:00
zephyr_module.py