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
Sort list of files #1804
Sort list of files #1804
Conversation
so that fast_data_types.so builds in a reproducible way in spite of indeterministic filesystem readdir order and random set iteration order. See https://reproducible-builds.org/ for why this is good.
|
Unfortunately commit 97c2b7c did not fix (all) the ordering issues. |
|
set/dict is not random as of python3.7, they are in insertion order. All
The only possible source of randomness is (2) if all the files have |
|
in https://build.opensuse.org/package/view_file/openSUSE:Factory/kitty/kitty.spec Line 66 Apart from that, applying patches also screws up mtimes, so for reproducibility it would be good to replace the mtime-sort with a filename-sort in find_c_files |
Files are built in order by size anyway and mtime sort makes link order mtime dependent which breaks reproducible builds on openSUSE as they modify mtimes randomnly. See #1804
|
Sure, done |
|
Does kitty build in a reproducible way now? According to https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/kitty.html, the latest version available in Debian does not because of a bug sphinx used to have. |
|
At least the filesystem-related influences are completely gone now in our build with master. There is still some parallelism-related issue with .pyc file creation, but those have a poor track record already and it should probably be solved with an upstream python patch. https://bugzilla.opensuse.org/show_bug.cgi?id=1049186 already added one ordering patch in openSUSE, but that was not enough here. Setting |
|
Odd, pyc files are built via py_compile() in compile_python() |
|
Yes, it is a python thing. something like reference counters depend on the order of processing. While we sorted filesystem order of py_compile, the parallelism here introduces random processing order again. The other annoying aspect (does not matter here) is that .pyc files differ between architectures, so even python packages that do not include .so files are somewhat architecture-dependent. |
|
Hmm this should really be fixed in python. |
Sort list of source files
so that fast_data_types.so builds in a reproducible way
in spite of indeterministic filesystem readdir order
and random set iteration order.
See https://reproducible-builds.org/ for why this is good.
Note: I tested that it builds (on a clean VM) with 0.14.2, but it might need more testing than that.
This PR was done while working on reproducible builds for openSUSE.