[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible debian: build.sh: use a schroot session while calling diffoscope

Mattia Rizzolo mattia at debian.org
Wed Apr 4 19:05:36 UTC 2018


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

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

commit 403662241dcc86ea42504fb211b6c70b952d220a
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Wed Apr 4 21:02:45 2018 +0200

    reproducible debian: build.sh: use a schroot session while calling diffoscope
    
    Also remove the retry call, as
    1) I expect schroot failures to drop considerably after moving to file-based schroots
    2) it makes hard to see the remaining actual failures and properly fix them
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 bin/reproducible_build.sh | 40 ++++++++++------------------------------
 1 file changed, 10 insertions(+), 30 deletions(-)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index c02ce05..07b5c9c 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -1,7 +1,8 @@
 #!/bin/bash
+# vim: set noexpandtab:
 
 # Copyright 2014-2017 Holger Levsen <holger at layer-acht.org>
-#         © 2015-2017 Mattia Rizzolo <mattia at mapreri.org>
+#         © 2015-2018 Mattia Rizzolo <mattia at debian.org>
 # released under the GPLv=2
 
 DEBUG=false
@@ -376,23 +377,19 @@ call_diffoscope_on_changes_files() {
 		# there is no extra diffoscope-schroot for experimental ( because we specical case ghc enough already )
 		DBDSUITE="unstable"
 	fi
-	set -x # to debug diffoscope/schroot problems
-	# TEMP is recognized by python's tempfile module to create temp stuff inside
+	# to debug diffoscope/schroot problems
+	set -x
+	# diffoscope temporary files are going to end up in this
 	local TEMP=$(mktemp --tmpdir=$TMPDIR -d dbd-tmp-XXXXXXX)
-	DIFFOSCOPE="$(schroot --directory $TMPDIR -c chroot:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1 || true)"
-	LOG_RESULT=$(echo $DIFFOSCOPE | grep '^E: 15binfmt: update-binfmts: unable to open' || true)
-	if [ ! -z "$LOG_RESULT" ] ; then
-		echo "$(date -u) - schroot jenkins-reproducible-${DBDSUITE}-diffoscope not available, will sleep 2min and retry."
-		sleep 2m
-		DIFFOSCOPE="$(schroot --directory $TMPDIR -c chroot:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1 || echo 'diffoscope_version_not_available')"
-	fi
+	local session="$(schroot --begin-session -c "chroot:jenkins-reproducible-$DBDSUITE-diffoscope")"
+	DIFFOSCOPE="$(schroot --directory $TMPDIR --run-session -c "$session" diffoscope -- --version 2>&1 || true)"
 	log_info "$DIFFOSCOPE will be used to compare the two builds:"
 	set +e
 	set -x
-	# remember to also modify the retry diffoscope call 15 lines below
 	( timeout $TIMEOUT nice schroot \
 		--directory $TMPDIR \
-		-c chroot:jenkins-reproducible-${DBDSUITE}-diffoscope \
+		--run-session \
+		-c "$session" \
 		-- sh -c "export TMPDIR=$TEMP ; diffoscope \
 			--html $TMPDIR/${DBDREPORT} \
 			--text $TMPDIR/$DBDTXT \
@@ -401,27 +398,10 @@ call_diffoscope_on_changes_files() {
 			$TMPDIR/b2/${CHANGES}" \
 	2>&1 ) >> $TMPLOG
 	RESULT=$?
-	LOG_RESULT=$(grep '^E: 15binfmt: update-binfmts: unable to open' $TMPLOG || true)
-	if [ ! -z "$LOG_RESULT" ] ; then
-		rm -f $TMPLOG $TMPDIR/${DBDREPORT} $TMPDIR/$DBDTXT
-		echo "$(date -u) - schroot jenkins-reproducible-${DBDSUITE}-diffoscope not available, will sleep 2min and retry."
-		sleep 2m
-		# remember to also modify the retry diffoscope call 15 lines above
-		( timeout $TIMEOUT nice schroot \
-			--directory $TMPDIR \
-			-c chroot:jenkins-reproducible-${DBDSUITE}-diffoscope \
-			-- sh -c "export TMPDIR=$TEMP ; diffoscope \
-				--html $TMPDIR/${DBDREPORT} \
-				--text $TMPDIR/$DBDTXT \
-				--profile=- \
-				$TMPDIR/b1/${CHANGES} \
-				$TMPDIR/b2/${CHANGES}" \
-		2>&1 ) >> $TMPLOG
-		RESULT=$?
-	fi
 	if ! "$DEBUG" ; then set +x ; fi
 	set -e
 	log_file $TMPLOG  # print dbd output
+	schroot --end-session -c "$session"
 	rm $TMPLOG
 	case $RESULT in
 		0)

-- 
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