-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-36302: Sort list of sources #12341
Conversation
Could there be negative consequences to the sorting? I think the two most common idioms for defining sources in setup.py are 1) an explicit list with fixed order (e.g. Is it ok in 100% of cases to change the order for case 1) ? |
Let's say the case 2 people seem to not have noticed any negative consequences from random order, so I would assume that it is fine for case 1, too. I also mailed this to our expert to be on the safe side. |
Our compiler expert said, order does not matter for .so files. It only matters when using .a files in case of duplicate symbols - but those are for static linking and not for dynamic linking as required by python. |
ping. Anything left to do on my side? |
so that _readstat_parser.so builds in a reproducible way in spite of indeterministic filesystem readdir order and missing python/cpython#12341 See https://reproducible-builds.org/ for why this is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to modify where self.sources is used rather than sorting Extension constructor? For example, read_setup_file() function seems to modify the sources attribute afterwards.
Maybe modify CCompiler.compile()?
patching
|
moved the sorting into |
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 ofalk/libdnet#42 sass/libsass-python#212 tahoe-lafs/pycryptopp#41 yt-project/yt#2206 pyproj4/pyproj#142 pytries/datrie#49 Roche/pyreadstat#37 but that is an infinite effort. See https://reproducible-builds.org/ for why this matters.
Thanks for updated PR: sorting in build_extension() looks more reliable than sorting in Extension constructor. |
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 ofalk/libdnet#42 sass/libsass-python#212 tahoe-lafs/pycryptopp#41 yt-project/yt#2206 pyproj4/pyproj#142 pytries/datrie#49 Roche/pyreadstat#37 but that is an infinite effort. See https://reproducible-builds.org/ for why this matters.
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 ofalk/libdnet#42 sass/libsass-python#212 tahoe-lafs/pycryptopp#41 yt-project/yt#2206 pyproj4/pyproj#142 pytries/datrie#49 Roche/pyreadstat#37 but that is an infinite effort. See https://reproducible-builds.org/ for why this matters.
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 ofalk/libdnet#42 sass/libsass-python#212 tahoe-lafs/pycryptopp#41 yt-project/yt#2206 pyproj4/pyproj#142 pytries/datrie#49 Roche/pyreadstat#37 but that is an infinite effort. See https://reproducible-builds.org/ for why this matters.
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
ofalk/libdnet#42
sass/libsass-python#212
tahoe-lafs/pycryptopp#41
yt-project/yt#2206
pyproj4/pyproj#142
pytries/datrie#49
but that is an infinite effort.
See https://reproducible-builds.org/ for why this matters.
https://bugs.python.org/issue36302