Skip to content

Commit

Permalink
Sort input file list
Browse files Browse the repository at this point in the history
so that /usr/lib/systemd/tests/unit-tests/test-libsystemd-sym
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.

(cherry picked from commit ac0054e)
  • Loading branch information
bmwiedemann authored and bluca committed Feb 12, 2024
1 parent 909c0c4 commit e147ced
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/generate-sym-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def process_source_file(file):
}, symbols_from_source[] = {''')

for dirpath, _, filenames in sorted(os.walk(sys.argv[2])):
for filename in filenames:
for filename in sorted(filenames):
if not filename.endswith(".c") and not filename.endswith(".h"):
continue
with open(os.path.join(dirpath, filename), "r") as f:
Expand Down

0 comments on commit e147ced

Please sign in to comment.