Patch to make the built .so files reproducible
Dmitry Shachnev <[email protected]> Tue, 7 Apr 2020 20:58:44 +0300
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <[email protected]> |
Hi Phil!
Please consider applying the attached patch for sip to make the built
extension modules reproducible.
Without this patch, the files are linked in random order. Below is an example
(formatted for readability):
Build 1:
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-z,relro \
build/temp.linux-amd64-3.8/code_generator/lexer.o \
build/temp.linux-amd64-3.8/code_generator/export.o \
build/temp.linux-amd64-3.8/code_generator/heap.o \
build/temp.linux-amd64-3.8/code_generator/transform.o \
build/temp.linux-amd64-3.8/code_generator/pybinding.o \
build/temp.linux-amd64-3.8/code_generator/extracts.o \
build/temp.linux-amd64-3.8/code_generator/gencode.o \
build/temp.linux-amd64-3.8/code_generator/parser.o \
build/temp.linux-amd64-3.8/code_generator/type_hints.o \
-o .pybuild/cpython3_3.8_sipbuild/build/sipbuild/code_generator.cpython-38-x86_64-linux-gnu.so
Build 2:
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-z,relro \
build/temp.linux-amd64-3.8/code_generator/parser.o \
build/temp.linux-amd64-3.8/code_generator/export.o \
build/temp.linux-amd64-3.8/code_generator/pybinding.o \
build/temp.linux-amd64-3.8/code_generator/extracts.o \
build/temp.linux-amd64-3.8/code_generator/gencode.o \
build/temp.linux-amd64-3.8/code_generator/transform.o \
build/temp.linux-amd64-3.8/code_generator/type_hints.o \
build/temp.linux-amd64-3.8/code_generator/heap.o \
build/temp.linux-amd64-3.8/code_generator/lexer.o \
-o .pybuild/cpython3_3.8_sipbuild/build/sipbuild/code_generator.cpython-38-x86_64-linux-gnu.so
After applying this patch, the build becomes reproducible in our CI system.
It applies to both sipbuild and the runtime module.
--
Dmitry Shachnev
_______________________________________________
PyQt mailing list [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
0001-Sort-the-input-files-to-make-the-generated-.so-files.patch
(text/x-diff, 1.3 KB)
From b9dc047c3db3768dba86e1c515b713e3a06c0c15 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev <[email protected]> Date: Tue, 7 Apr 2020 20:48:50 +0300 Subject: [PATCH] Sort the input files to make the generated .so files reproducible --- setup.py | 2 +- sipbuild/module/source/12.7/setup.py.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5d46f639..daab5bff 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ except FileNotFoundError: version_file.close() # Build the code generator extension module. -code_gen_src = glob.glob(os.path.join('code_generator', '*.c')) +code_gen_src = sorted(glob.glob(os.path.join('code_generator', '*.c'))) code_gen_module = Extension('sipbuild.code_generator', code_gen_src, include_dirs=['code_generator']) diff --git a/sipbuild/module/source/12.7/setup.py.in b/sipbuild/module/source/12.7/setup.py.in index 3b177c79..08513cea 100644 --- a/sipbuild/module/source/12.7/setup.py.in +++ b/sipbuild/module/source/12.7/setup.py.in @@ -28,7 +28,7 @@ from setuptools import Extension, setup # Build the extension module. -module_src = glob.glob('*.c') +module_src = sorted(glob.glob('*.c')) if sys.platform == 'win32': module_src.append('bool.cpp') -- 2.25.1