]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/package: Sort ELF file list
authorJoshua Watt <jpewhacker@gmail.com>
Mon, 3 Jun 2019 15:29:47 +0000 (10:29 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 4 Jun 2019 08:09:34 +0000 (09:09 +0100)
Sorts the list of detected ELF files by path before processing. This
ensures that when multiple files are hardlinked together the first one
found is always the same. This is required to have reproducible builds.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package.bbclass

index 4c0a85953636c08f5dbd38fdd62181e8e184a979..069485550428d246b8a3ac992637786165bdfb4b 100644 (file)
@@ -1005,6 +1005,12 @@ python split_and_strip_files () {
                 symlinks[file] = target
 
         results = oe.utils.multiprocess_launch(oe.package.is_elf, checkelf.keys(), d)
+
+        # Sort results by file path. This ensures that the files are always
+        # processed in the same order, which is important to make sure builds
+        # are reproducible when dealing with hardlinks
+        results.sort(key=lambda x: x[0])
+
         for (file, elf_file) in results:
             # It's a file (or hardlink), not a link
             # ...but is it ELF, and is it already stripped?