Skip to content

Commit 4e98001

Browse files
committed
sort input files
when building packages (e.g. for openSUSE Linux) (random) filesystem order of input files influences ordering of functions in the output, thus without the patch, builds (in disposable VMs) would usually differ. See https://reproducible-builds.org/ for why this matters.
1 parent cb0e7f9 commit 4e98001

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
srcs.append('_doubleloadtester.cpp', )
154154

155155
ext_modules.append(
156-
Extension('pycryptopp._pycryptopp', extra_srcs + srcs, include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
156+
Extension('pycryptopp._pycryptopp', sorted(extra_srcs) + srcs, include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
157157
)
158158

159159
# python-ed25519
@@ -163,7 +163,7 @@
163163
if s.endswith(".c") and s!="test.c"])
164164
m = Extension("pycryptopp.publickey.ed25519._ed25519",
165165
include_dirs=[os.path.join("src-ed25519","supercop-ref")],
166-
sources=sources)
166+
sources=sorted(sources))
167167
ext_modules.append(m)
168168

169169

src-cryptopp/GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ endif # HAS_SOLIB_VERSION
413413
###########################################################
414414

415415
# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
416-
SRCS := cryptlib.cpp cpu.cpp integer.cpp $(filter-out cryptlib.cpp cpu.cpp integer.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp))
416+
SRCS := cryptlib.cpp cpu.cpp integer.cpp $(filter-out cryptlib.cpp cpu.cpp integer.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(sort $(wildcard *.cpp)))
417417

418418
# Need CPU for X86/X64/X32 and ARM
419419
ifeq ($(IS_X86)$(IS_X64)$(IS_ARM32)$(IS_ARM64),0000)

0 commit comments

Comments
 (0)