From d379dc24c5f6dc428da74ab6ce02cb2e5648caca Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Thu, 29 Feb 2024 02:05:07 +0100 Subject: [PATCH] [Build Reproducibility] Sort input file list (#35687) Sort input file list so that the `.so` file builds in a reproducible way in spite of non-deterministic filesystem readdir order and http://bugs.python.org/issue30461 See https://reproducible-builds.org/ for why this is good. This patch was done while working on reproducible builds for openSUSE. --------- Co-authored-by: Richard Belleville --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2ce5fef4223..7c034fe3eba 100644 --- a/setup.py +++ b/setup.py @@ -361,7 +361,8 @@ if BUILD_WITH_SYSTEM_RE2: EXTENSION_LIBRARIES += ("re2",) if BUILD_WITH_SYSTEM_ABSL: EXTENSION_LIBRARIES += tuple( - lib.stem[3:] for lib in pathlib.Path("/usr").glob("lib*/libabsl_*.so") + lib.stem[3:] + for lib in sorted(pathlib.Path("/usr").glob("lib*/libabsl_*.so")) ) DEFINE_MACROS = (("_WIN32_WINNT", 0x600),)