[Qa-jenkins-scm] [jenkins.debian.net] 02/05: reproducible: make diffoscope calls more robust, retry after 2m if the schroot was unavailable

Holger Levsen holger at moszumanska.debian.org
Sun Sep 20 15:38:01 UTC 2015


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

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit f6a925687705ff3f8dab9726100c4af65cfadeb5
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun Sep 20 14:35:32 2015 +0200

    reproducible: make diffoscope calls more robust, retry after 2m if the schroot was unavailable
---
 bin/reproducible_build.sh  | 26 +++++++++++++++++++++++++-
 bin/reproducible_common.sh | 17 +++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 1766e30..abd3818 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -308,10 +308,17 @@ call_diffoscope_on_changes_files() {
 	fi
 	# TEMP is recognized by python's tempfile module to create temp stuff inside
 	local TEMP=$(mktemp --tmpdir=$TMPDIR -d dbd-tmp-XXXXXXX)
-	DIFFOSCOPE="$(schroot --directory $TMPDIR -c source:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1)"
+	DIFFOSCOPE="$(schroot --directory $TMPDIR -c source:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1 || true)"
+	LOG_RESULT=$(echo $DIFFOSCOPE | grep '^E: 15binfmt: update-binfmts: unable to open')
+	if [ ! -z "LOG_RESULT" ] ; then
+		echo "$(date -u) - schroot jenkins-reproducible-${DBDSUITE}-diffoscope not availble, will sleep 2min and retry."
+		sleep 2m
+		DIFFOSCOPE="$(schroot --directory $TMPDIR -c source:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1 || echo 'diffoscope_version_not_available')"
+	fi
 	echo "$(date -u) - $DIFFOSCOPE will be used to compare the two builds:" | tee -a ${RBUILDLOG}
 	set +e
 	set -x
+	# remember to also modify the retry diffoscope call 15 lines below
 	( timeout $TIMEOUT schroot \
 		--directory $TMPDIR \
 		-c source:jenkins-reproducible-${DBDSUITE}-diffoscope \
@@ -322,6 +329,23 @@ call_diffoscope_on_changes_files() {
 			$TMPDIR/b2/${SRCPACKAGE}_${EVERSION}_${ARCH}.changes" \
 	2>&1 ) >> $TMPLOG
 	RESULT=$?
+	LOG_RESULT=$(grep '^E: 15binfmt: update-binfmts: unable to open' $TMPLOG)
+	if [ ! -z "LOG_RESULT" ] ; then
+		rm -f $TMPLOG $TMPDIR/${DBDREPORT} $TMPDIR/$DBDTXT
+		echo "$(date -u) - schroot jenkins-reproducible-${DBDSUITE}-diffoscope not availble, will sleep 2min and retry."
+		sleep 2m
+		# remember to also modify the retry diffoscope call 15 lines above
+		( timeout $TIMEOUT schroot \
+			--directory $TMPDIR \
+			-c source:jenkins-reproducible-${DBDSUITE}-diffoscope \
+			-- sh -c "export TMPDIR=$TEMP ; diffoscope \
+				--html $TMPDIR/${DBDREPORT} \
+				--text $TMPDIR/$DBDTXT \
+				$TMPDIR/b1/${SRCPACKAGE}_${EVERSION}_${ARCH}.changes \
+				$TMPDIR/b2/${SRCPACKAGE}_${EVERSION}_${ARCH}.changes" \
+		2>&1 ) >> $TMPLOG
+		RESULT=$?
+	fi
 	if ! "$DEBUG" ; then set +x ; fi
 	set -e
 	cat $TMPLOG | tee -a $RBUILDLOG  # print dbd output
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index d3fd2a2..c6e8a9f 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -431,6 +431,7 @@ call_diffoscope() {
 	local TMPLOG=(mktemp --tmpdir=$TMPDIR)
 	local msg=""
 	set +e
+	# remember to also modify the retry diffoscope call 15 lines below
 	( timeout $TIMEOUT schroot \
 		--directory $TMPDIR \
 		-c source:jenkins-reproducible-${DBDSUITE}-diffoscope \
@@ -440,6 +441,22 @@ call_diffoscope() {
 			$TMPDIR/b2/$1/$2 2>&1 \
 	) 2>&1 >> $TMPLOG
 	RESULT=$?
+	LOG_RESULT=$(grep '^E: 15binfmt: update-binfmts: unable to open' $TMPLOG)
+	if [ ! -z "LOG_RESULT" ] ; then
+		rm -f $TMPLOG $TMPDIR/$1/$2.html
+		echo "$(date -u) - schroot jenkins-reproducible-${DBDSUITE}-diffoscope not availble, will sleep 2min and retry."
+		sleep 2m
+		# remember to also modify the retry diffoscope call 15 lines above
+		( timeout $TIMEOUT schroot \
+			--directory $TMPDIR \
+			-c source:jenkins-reproducible-${DBDSUITE}-diffoscope \
+			diffoscope -- \
+				--html $TMPDIR/$1/$2.html \
+				$TMPDIR/b1/$1/$2 \
+				$TMPDIR/b2/$1/$2 2>&1 \
+			) 2>&1 >> $TMPLOG
+		RESULT=$?
+	fi
 	if ! "$DEBUG" ; then set +x ; fi
 	set -e
 	cat $TMPLOG # print dbd output

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list