From 1b51873ccfccf9dde981ef4aecba7656bad4056b Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Tue, 3 Mar 2020 11:31:56 +0100 Subject: [PATCH] Sort input file lists (#40454) so that lasso.py, lasso/types.c and liblasso.so.3.13.0 build reproducibly in spite of indeterministic filesystem readdir order. For some reason, lasso/extract_sections.py lasso/extract_symbols.py do not need such patches to get a reproducible openSUSE package. See https://reproducible-builds.org/ for why this is good. This patch was done while working on reproducible builds for openSUSE. License: MIT Signed-off-by: Bernhard M. Wiedemann --- bindings/bindings.py | 2 ++ lasso/extract_types.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bindings/bindings.py b/bindings/bindings.py index 07cb0679..8a81f541 100644 --- a/bindings/bindings.py +++ b/bindings/bindings.py @@ -571,6 +571,8 @@ def parse_headers(srcdir): if not binding.options.idwsf: exclusion += ( 'idwsf_strings.h', ) for base, dirnames, filenames in os.walk(srcdir): + dirnames.sort() + filenames.sort() bname = os.path.basename(base) if bname == '.svn': # ignore svn directories diff --git a/lasso/extract_types.py b/lasso/extract_types.py index 1359cafc..64c7f3c5 100644 --- a/lasso/extract_types.py +++ b/lasso/extract_types.py @@ -32,7 +32,7 @@ six.print_(u"typedef GType (*type_function) ();", file=fd) six.print_(u"", file=fd) header_files = [] -for header_file in glob.glob('%s/*/*.h' % srcdir) + glob.glob('%s/*/*/*.h' % srcdir): +for header_file in sorted(glob.glob('%s/*/*.h' % srcdir) + glob.glob('%s/*/*/*.h' % srcdir)): if ('/id-wsf/' in header_file or '/id-wsf-2.0' in header_file) and not enable_wsf: continue header_files.append(header_file)