Sort kernel module object files before processing them.
authorGiuliano Procida <gprocida@google.com>
Tue, 4 Feb 2020 17:16:27 +0000 (17:16 +0000)
committerDodji Seketeli <dodji@redhat.com>
Wed, 19 Feb 2020 12:50:45 +0000 (13:50 +0100)
This imposes a deterministic ordering, making diffs more predictable
and allowing reproducible testing.

        * src/abg-tools-utils.cc (get_binary_paths_from_kernel_dist):
        Sort module_paths.

Signed-off-by: Giuliano Procida <gprocida@google.com>
src/abg-tools-utils.cc

index 6608ffd5caaa3363cdd13231ff1d4b828655e1f0..92a27d08057bbe8b18533f115fe93c7a5190653a 100644 (file)
@@ -2326,7 +2326,8 @@ find_vmlinux_path(const string&   from,
 /// binary that was found.
 ///
 /// @param module_paths output parameter.  The paths of the kernel
-/// module binaries that were found.
+/// module binaries that were found, sorted to impose a deterministic
+/// ordering.
 ///
 /// @return true if at least the path to the vmlinux binary was found.
 bool
@@ -2365,6 +2366,8 @@ get_binary_paths_from_kernel_dist(const string&   dist_root,
   if (find_vmlinux_and_module_paths(from, vmlinux_path, module_paths))
     found = true;
 
+  std::sort(module_paths.begin(), module_paths.end());
+
   return found;
 }