[med-svn] [bowtie2] 01/03: make build reproducible

Sascha Steinbiss sascha at steinbiss.name
Sat May 21 18:15:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

sascha-guest pushed a commit to branch master
in repository bowtie2.

commit 5d3e3676916632828d01f331ccbc5af2890a8691
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Sat May 21 17:21:12 2016 +0000

    make build reproducible
---
 debian/changelog                  |  11 +++
 debian/help2man-wrapper           |   5 +-
 debian/patches/reproducible.patch | 151 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series             |   1 +
 debian/rules                      |   2 +
 5 files changed, 168 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 704ad3c..213c4bb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+bowtie2 (2.2.9-2) unstable; urgency=medium
+
+  * Team upload.
+  * Make bulid reproducible.
+    - Remove embedding of build hostname, time and compiler.
+    - Fix help2man wrapper heredoc.
+    - Sort wildcard expansions in Makefile.
+    - Pin down language settings.
+
+ -- Sascha Steinbiss <sascha at steinbiss.name>  Sat, 21 May 2016 17:18:25 +0000
+
 bowtie2 (2.2.9-1) unstable; urgency=medium
 
   * Imported Upstream version 2.2.9
diff --git a/debian/help2man-wrapper b/debian/help2man-wrapper
index 859fb12..4f271af 100755
--- a/debian/help2man-wrapper
+++ b/debian/help2man-wrapper
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Very dirty trick to drain information via help2man even if binary outputs to stderr
 
 if [ $# -ne 2 ] ; then
@@ -15,8 +15,9 @@ mkdir -p $tmpdir
 binname=$1
 tmpbin=${tmpdir}/$binname
 echo "#!/bin/sh" > $tmpbin
-echo "cat <<EOT" >> $tmpbin
+echo "cat <<END" >> $tmpbin
 ${PWD}/debian/${pkg}/usr/bin/$binname 2>> $tmpbin
+echo "END" >> $tmpbin
 chmod 755 $tmpbin
 help2man --no-info --help-option="h" --no-discard-stderr --name="$2" --version-string="${version}" $tmpbin | debian/filter.pl > $mandir/${binname}.1
 rm -rf $tmpdir
diff --git a/debian/patches/reproducible.patch b/debian/patches/reproducible.patch
new file mode 100644
index 0000000..48ad4ab
--- /dev/null
+++ b/debian/patches/reproducible.patch
@@ -0,0 +1,151 @@
+--- a/Makefile
++++ b/Makefile
+@@ -30,7 +30,7 @@
+ CC ?= $(GCC_PREFIX)/gcc$(GCC_SUFFIX)
+ CPP ?= $(GCC_PREFIX)/g++$(GCC_SUFFIX)
+ CXX ?= $(CPP)
+-HEADERS = $(wildcard *.h)
++HEADERS = $(sort $(wildcard *.h))
+ BOWTIE_MM = 1
+ BOWTIE_SHARED_MEM = 0
+ 
+@@ -145,7 +145,7 @@
+ BUILD_CPPS = diff_sample.cpp
+ BUILD_CPPS_MAIN = $(BUILD_CPPS) bowtie_build_main.cpp
+ 
+-SEARCH_FRAGMENTS = $(wildcard search_*_phase*.c)
++SEARCH_FRAGMENTS = $(sort $(wildcard search_*_phase*.c))
+ VERSION = $(shell cat VERSION)
+ 
+ BITS=32
+@@ -187,14 +187,14 @@
+                        bowtie2-inspect-s-debug \
+                        bowtie2-inspect-l-debug
+ 
+-GENERAL_LIST = $(wildcard scripts/*.sh) \
+-               $(wildcard scripts/*.pl) \
++GENERAL_LIST = $(sort $(wildcard scripts/*.sh)) \
++               $(sort $(wildcard scripts/*.pl)) \
+                doc/manual.html \
+                doc/README \
+                doc/style.css \
+-			   $(wildcard example/index/*.bt2) \
+-			   $(wildcard example/reads/*.fq) \
+-			   $(wildcard example/reads/*.pl) \
++			   $(sort $(wildcard example/index/*.bt2)) \
++			   $(sort $(wildcard example/reads/*.fq)) \
++			   $(sort $(wildcard example/reads/*.pl)) \
+ 			   example/reference/lambda_virus.fa \
+                $(PTHREAD_PKG) \
+ 			   bowtie2 \
+@@ -221,11 +221,11 @@
+ # the Windows FIND tool instead.
+ FIND=$(shell which find)
+ 
+-SRC_PKG_LIST = $(wildcard *.h) \
+-               $(wildcard *.hh) \
+-               $(wildcard *.c) \
+-               $(wildcard *.cpp) \
+-               $(wildcard third_party/*) \
++SRC_PKG_LIST = $(sort $(wildcard *.h)) \
++               $(sort $(wildcard *.hh)) \
++               $(sort $(wildcard *.c)) \
++               $(sort $(wildcard *.cpp)) \
++               $(sort $(wildcard third_party/*)) \
+                doc/strip_markdown.pl \
+                Makefile \
+                $(GENERAL_LIST)
+@@ -248,9 +248,9 @@
+ 
+ DEFS=-fno-strict-aliasing \
+      -DBOWTIE2_VERSION="\"`cat VERSION`\"" \
+-     -DBUILD_HOST="\"`hostname`\"" \
+-     -DBUILD_TIME="\"`date`\"" \
+-     -DCOMPILER_VERSION="\"`$(CXX) -v 2>&1 | tail -1`\"" \
++     -DBUILD_HOST="\"\"" \
++     -DBUILD_TIME="\"\"" \
++     -DCOMPILER_VERSION="\"\"" \
+      $(FILE_FLAGS) \
+      $(PREF_DEF) \
+      $(MM_DEF) \
+--- a/bt2_build.cpp
++++ b/bt2_build.cpp
+@@ -533,15 +533,15 @@
+ 			} else {
+ 				cout << "Neither 32- nor 64-bit: sizeof(void*) = " << sizeof(void*) << endl;
+ 			}
+-			cout << "Built on " << BUILD_HOST << endl;
+-			cout << BUILD_TIME << endl;
+-			cout << "Compiler: " << COMPILER_VERSION << endl;
+-			cout << "Options: " << COMPILER_OPTIONS << endl;
+-			cout << "Sizeof {int, long, long long, void*, size_t, off_t}: {"
+-				 << sizeof(int)
+-				 << ", " << sizeof(long) << ", " << sizeof(long long)
+-				 << ", " << sizeof(void *) << ", " << sizeof(size_t)
+-				 << ", " << sizeof(off_t) << "}" << endl;
++			//cout << "Built on " << BUILD_HOST << endl;
++			//cout << BUILD_TIME << endl;
++			//cout << "Compiler: " << COMPILER_VERSION << endl;
++			//cout << "Options: " << COMPILER_OPTIONS << endl;
++			//cout << "Sizeof {int, long, long long, void*, size_t, off_t}: {"
++			//	 << sizeof(int)
++			//	 << ", " << sizeof(long) << ", " << sizeof(long long)
++			//	 << ", " << sizeof(void *) << ", " << sizeof(size_t)
++			//	 << ", " << sizeof(off_t) << "}" << endl;
+ 			return 0;
+ 		}
+ 
+--- a/bt2_inspect.cpp
++++ b/bt2_inspect.cpp
+@@ -445,15 +445,15 @@
+ 			} else {
+ 				cout << "Neither 32- nor 64-bit: sizeof(void*) = " << sizeof(void*) << endl;
+ 			}
+-			cout << "Built on " << BUILD_HOST << endl;
+-			cout << BUILD_TIME << endl;
+-			cout << "Compiler: " << COMPILER_VERSION << endl;
+-			cout << "Options: " << COMPILER_OPTIONS << endl;
+-			cout << "Sizeof {int, long, long long, void*, size_t, off_t}: {"
+-				 << sizeof(int)
+-				 << ", " << sizeof(long) << ", " << sizeof(long long)
+-				 << ", " << sizeof(void *) << ", " << sizeof(size_t)
+-				 << ", " << sizeof(off_t) << "}" << endl;
++			//cout << "Built on " << BUILD_HOST << endl;
++			//cout << BUILD_TIME << endl;
++			//cout << "Compiler: " << COMPILER_VERSION << endl;
++			//cout << "Options: " << COMPILER_OPTIONS << endl;
++			//cout << "Sizeof {int, long, long long, void*, size_t, off_t}: {"
++			//	 << sizeof(int)
++			//	 << ", " << sizeof(long) << ", " << sizeof(long long)
++			//	 << ", " << sizeof(void *) << ", " << sizeof(size_t)
++			//	 << ", " << sizeof(off_t) << "}" << endl;
+ 			return 0;
+ 		}
+ 
+--- a/bt2_search.cpp
++++ b/bt2_search.cpp
+@@ -4648,15 +4648,15 @@
+ 			} else {
+ 				cout << "Neither 32- nor 64-bit: sizeof(void*) = " << sizeof(void*) << endl;
+ 			}
+-			cout << "Built on " << BUILD_HOST << endl;
+-			cout << BUILD_TIME << endl;
+-			cout << "Compiler: " << COMPILER_VERSION << endl;
+-			cout << "Options: " << COMPILER_OPTIONS << endl;
+-			cout << "Sizeof {int, long, long long, void*, size_t, off_t}: {"
+-				 << sizeof(int)
+-				 << ", " << sizeof(long) << ", " << sizeof(long long)
+-				 << ", " << sizeof(void *) << ", " << sizeof(size_t)
+-				 << ", " << sizeof(off_t) << "}" << endl;
++			//cout << "Built on " << BUILD_HOST << endl;
++			//cout << BUILD_TIME << endl;
++			//cout << "Compiler: " << COMPILER_VERSION << endl;
++			//cout << "Options: " << COMPILER_OPTIONS << endl;
++			//cout << "Sizeof {int, long, long long, void*, size_t, off_t}: {"
++			//	 << sizeof(int)
++			//	 << ", " << sizeof(long) << ", " << sizeof(long long)
++			//	 << ", " << sizeof(void *) << ", " << sizeof(size_t)
++			//	 << ", " << sizeof(off_t) << "}" << endl;
+ 			return 0;
+ 		}
+ 		{
diff --git a/debian/patches/series b/debian/patches/series
index 814900f..518af05 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 hardening.patch
+reproducible.patch
diff --git a/debian/rules b/debian/rules
index 9925106..ce057a6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,8 @@ pkg := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+export LANG=C
+export LC_ALL=C.UTF-8
 
 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 EXTRA_OPTIONS =

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/bowtie2.git



More information about the debian-med-commit mailing list