From patchwork Wed Jan 1 00:00:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksei Vetrov via Libabigail X-Patchwork-Id: 38995 X-Patchwork-Original-From: libabigail@sourceware.org (Giuliano Procida via libabigail) From: Aleksei Vetrov via Libabigail Date: Wed, 01 Jan 2020 00:00:00 -0000 Subject: [PATCH] Sort kernel module object files before processing them. Message-ID: <20200204171627.148021-1-gprocida@google.com> 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 --- src/abg-tools-utils.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 6608ffd5..92a27d08 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -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; }