summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard M. Wiedemann <bwiedemann@suse.de>2019-08-01 15:18:03 +0200
committerVictor Stinner <vstinner@redhat.com>2019-08-01 15:18:03 +0200
commit3665ddcf056ef72aa6e8e92aee81684d146d5dde (patch)
tree43b852f65cf5d03a82a5692e36a25d18adab92d1
parent850d4faed59006e8dbfcee2bbec13d1985d6538a (diff)
downloadpython-setuptools-git-3665ddcf056ef72aa6e8e92aee81684d146d5dde.tar.gz
bpo-36302: Sort list of sources (GH-12341)
When building packages (e.g. for openSUSE Linux) (random) filesystem order of input files influences ordering of functions in the output .so files. Thus without the patch, builds (in disposable VMs) would usually differ. Without this patch, all callers have to be patched individually https://github.com/dugsong/libdnet/pull/42 https://github.com/sass/libsass-python/pull/212 https://github.com/tahoe-lafs/pycryptopp/pull/41 https://github.com/yt-project/yt/pull/2206 https://github.com/pyproj4/pyproj/pull/142 https://github.com/pytries/datrie/pull/49 https://github.com/Roche/pyreadstat/pull/37 but that is an infinite effort. See https://reproducible-builds.org/ for why this matters.
-rw-r--r--command/build_ext.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/command/build_ext.py b/command/build_ext.py
index 2d7cdf06..38bb8fd9 100644
--- a/command/build_ext.py
+++ b/command/build_ext.py
@@ -490,7 +490,8 @@ class build_ext(Command):
"in 'ext_modules' option (extension '%s'), "
"'sources' must be present and must be "
"a list of source filenames" % ext.name)
- sources = list(sources)
+ # sort to make the resulting .so file build reproducible
+ sources = sorted(sources)
ext_path = self.get_ext_fullpath(ext.name)
depends = sources + ext.depends