[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible_debian_live_build: Retry instead of give up when the

Holger Levsen (@holger) gitlab at salsa.debian.org
Mon Aug 29 12:18:19 BST 2022



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
7b28da62 by Roland Clobus at 2022-08-29T13:17:59+02:00
reproducible_debian_live_build: Retry instead of give up when the
archive was synced while building an ISO image

Also update the logparse rules with the new messages

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


2 changed files:

- bin/reproducible_debian_live_build.sh
- logparse/reproducible.rules


Changes:

=====================================
bin/reproducible_debian_live_build.sh
=====================================
@@ -151,7 +151,11 @@ grep --quiet --no-messages "Build result: 0" summary.txt
 BUILD_OK_FOUND=$?
 set -e
 
-if [ ${RETURNVALUE} -ne 0 -o ${BUILD_OK_FOUND} -ne 0 ]; then
+if [ ${RETURNVALUE} -eq 99 -a "${SNAPSHOT_TIMESTAMP}" == "archive" ]; then
+	# The archive was updated while building. Retry
+	output_echo "Info: meanwhile the archive was updated, now trying again."
+	rebuild_script/test/rebuild.sh "$1" "$2" "${SNAPSHOT_TIMESTAMP}"
+elif [ ${RETURNVALUE} -ne 0 -o ${BUILD_OK_FOUND} -ne 0 ]; then
 	# Something went wrong. Perhaps an alternative timestamp is proposed
 	SNAPSHOT_TIMESTAMP=$(grep --no-messages "Alternative timestamp:" summary.txt | cut -f 3 -d " ")
 	if [ -z ${SNAPSHOT_TIMESTAMP} ]; then
@@ -175,7 +179,18 @@ mv summary.txt ${RESULTSDIR}/summary_build1.txt
 
 # Second build
 output_echo "Running the rebuild script for the 2nd build."
+set +e # We are interested in the return value
 rebuild_script/test/rebuild.sh "$1" "$2" "${SNAPSHOT_TIMESTAMP}"
+RETURNVALUE=$?
+set -e
+
+if [ ${RETURNVALUE} -eq 99 -a "${SNAPSHOT_TIMESTAMP}" == "archive" ]; then
+	# The archive was updated while building. Discard the first build and retry
+	output_echo "Info: meanwhile the archive was updated, now trying again."
+	mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b1/${PROJECTNAME}/${CONFIGURATION}
+	mv summary.txt ${RESULTSDIR}/summary_build1.txt
+	rebuild_script/test/rebuild.sh "$1" "$2" "${SNAPSHOT_TIMESTAMP}"
+fi
 
 # Move the image away
 mkdir -p ${RESULTSDIR}/b2/${PROJECTNAME}/${CONFIGURATION}


=====================================
logparse/reproducible.rules
=====================================
@@ -45,8 +45,14 @@ warning /Warning: lb .+ failed with/
 warning /Warning: diffoscope detected differences in the images/
 warning /Warning: diffoscope returned error code/
 error /Error: Bad argument/
+error /Error: the image could not be built, no alternative was proposed/
+info /Info: The snapshot server is not available, using deb.debian.org instead/
+info /Info: meanwhile the archive was updated, now trying again/
+# Do not log the warning from the rebuild script: /Warning: meanwhile the archive was updated/
+info /Warning: the build failed with .+ Now trying again using the previous snapshot instead/
 info /Info: using live-build from git/
 info /Info: using the snapshot from/
 info /Info: no differences found/
-info /Reproducible hook has been applied/
+# If a reproducible hook has been applied, show it as a warning
+warning /Reproducible hook has been applied/
 



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/7b28da62d3b9753510029afc7755be67c785897a

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/7b28da62d3b9753510029afc7755be67c785897a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20220829/ccf342a1/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list