Skip to content

Commit

Permalink
sort input files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bmwiedemann committed May 25, 2018
1 parent cb0e7f9 commit 4e98001
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
srcs.append('_doubleloadtester.cpp', )

ext_modules.append(
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)
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)
)

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


Expand Down
2 changes: 1 addition & 1 deletion src-cryptopp/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ endif # HAS_SOLIB_VERSION
###########################################################

# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
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))
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)))

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

0 comments on commit 4e98001

Please sign in to comment.