Skip to content

Commit

Permalink
NO-JIRA: Sort input file list
Browse files Browse the repository at this point in the history
so that `_cproton.cpython-310-x86_64-linux-gnu.so` builds in a reproducible way
in spite of non-deterministic filesystem readdir order

See https://reproducible-builds.org/ for why this is good.

This patch was done while working on reproducible builds for openSUSE.
  • Loading branch information
Bernhard M. Wiedemann authored and astitcher committed Oct 19, 2023
1 parent 18976fb commit 47c0a03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/ext_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
sources = []
extra = []
libraries = []
for root, _, files in os.walk(proton_core_src):
for root, dirs, files in os.walk(proton_core_src):
dirs.sort() # needed for os.walk to process directories in deterministic order
files.sort()
for file_ in files:
if file_.endswith(('.c', '.cpp')):
sources.append(os.path.join(root, file_))
Expand Down

0 comments on commit 47c0a03

Please sign in to comment.