[Git][qa/jenkins.debian.net][master] 2 commits: refactoring
Holger Levsen (@holger)
gitlab at salsa.debian.org
Sat Mar 16 12:55:43 GMT 2024
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
7b9c7a1d by Holger Levsen at 2024-03-16T13:50:09+01:00
refactoring
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
6d494081 by Holger Levsen at 2024-03-16T13:51:24+01:00
fixup: reproducible debian: setup_pbuilder: skip chroot recreate only on armhf
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2 changed files:
- bin/reproducible_build.sh
- bin/reproducible_setup_pbuilder.sh
Changes:
=====================================
bin/reproducible_build.sh
=====================================
@@ -385,9 +385,9 @@ call_diffoscope_on_changes_files() {
;;
esac
set -x
- set +e
DIFFOSCOPE_STAMP="/var/log/reproducible-builds/diffoscope_stamp_${SRCPACKAGE}_${SUITE}_${ARCH}_$(date -u +%s)"
touch ${DIFFOSCOPE_STAMP}
+ RESULT=0
( timeout 155m nice schroot \
--directory $TMPDIR \
--run-session \
@@ -398,9 +398,7 @@ call_diffoscope_on_changes_files() {
--profile=- \
$TMPDIR/b1/${CHANGES} \
$TMPDIR/b2/${CHANGES}" \
- 2>&1 ) >> $TMPLOG
- RESULT=$?
- set -e
+ 2>&1 ) >> $TMPLOG || RESULT=$?
if ! "$DEBUG" ; then set +x ; fi
log_file $TMPLOG # print diffoscope output
schroot --end-session -c "$session"
@@ -656,7 +654,7 @@ EOF
gcc-[0-9][0-9]|gcc-[0-9]|binutils) PBUILDERTIMEOUT=19 ;;
*) PBUILDERTIMEOUT=18 ;;
esac
- set +e
+ local PRESULT=0
# remember to change the sudoers setting if you change the following command
sudo timeout -k ${PBUILDERTIMEOUT}.1h ${PBUILDERTIMEOUT}h /usr/bin/ionice -c 3 /usr/bin/nice \
/usr/sbin/pbuilder --build \
@@ -668,9 +666,7 @@ EOF
--basetgz /var/cache/pbuilder/$SUITE-reproducible-base.tgz \
--buildresult $TMPDIR/b1 \
--logfile b1/build.log \
- ${SRCPACKAGE}_${EVERSION}.dsc
- local PRESULT=$?
- set -e
+ ${SRCPACKAGE}_${EVERSION}.dsc || PRESULT=$?
if ! "$DEBUG" ; then set +x ; fi
rm $TMPCFG
case $PRESULT in
@@ -778,7 +774,7 @@ EOF
gcc-[0-9][0-9]|gcc-[0-9]|binutils) PBUILDERTIMEOUT=26 ;;
*) PBUILDERTIMEOUT=24 ;;
esac
- set +e
+ local PRESULT=0
# remember to change the sudoers setting if you change the following command
# (the 2nd build gets a longer timeout trying to make sure the first build
# ain't wasted when then 2nd happens on a more loaded node than the 1st)
@@ -794,9 +790,7 @@ EOF
--buildresult $TMPDIR/b2 \
--logfile b2/build.log \
"${pbuilder_options[@]}" \
- ${SRCPACKAGE}_${EVERSION}.dsc
- local PRESULT=$?
- set -e
+ ${SRCPACKAGE}_${EVERSION}.dsc || PRESULT=$?
if ! "$DEBUG" ; then set +x ; fi
rm $TMPCFG
case $PRESULT in
@@ -827,8 +821,8 @@ check_node_is_up() {
exit 0
fi
echo "$(date -u) - checking via ssh if $NODE is up."
- ssh -o "BatchMode = yes" $NODE 'rm -v $(mktemp --tmpdir=/tmp read-only-fs-test-XXXXXX)'
- RESULT=$?
+ RESULT=0
+ ssh -o "BatchMode = yes" $NODE 'rm -v $(mktemp --tmpdir=/tmp read-only-fs-test-XXXXXX)' || RESULT=$?
# abort job if host is down
if [ $RESULT -ne 0 ] ; then
echo "$(date -u) - $NODE seems to be down, sleeping ${SLEEPTIME}min before aborting this job."
@@ -856,16 +850,15 @@ remote_build() {
# but 1h if the 2nd node is down
local SLEEPTIME=$(echo "$BUILDNR*$BUILDNR*15"|bc)
check_node_is_up $NODE $SLEEPTIME
- set +e
- ssh -o "BatchMode = yes" $NODE /srv/jenkins/bin/reproducible_build.sh $BUILDNR ${SRCPACKAGE} ${SUITE} ${TMPDIR} "$VERSION"
- local BUILD_RESULT=$?
- rsync -e "ssh -o 'BatchMode = yes'" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/
- local RSYNC_RESULT=$?
+ local BUILD_RESULT=0
+ ssh -o "BatchMode = yes" $NODE /srv/jenkins/bin/reproducible_build.sh $BUILDNR ${SRCPACKAGE} ${SUITE} ${TMPDIR} "$VERSION" || BUILD_RESULT=$?
+ local RSYNC_RESULT=0
+ rsync -e "ssh -o 'BatchMode = yes'" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/ || RSYNC_RESULT=$?
if [ $RSYNC_RESULT -ne 0 ] ; then
log_warning "rsync from $NODE failed, sleeping 2m before re-trying..."
sleep 2m
- rsync -e "ssh -o 'BatchMode = yes'" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/
- local RSYNC_RESULT=$?
+ RSYNC_RESULT=0
+ rsync -e "ssh -o 'BatchMode = yes'" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/ || RSYNC_RESULT=$?
if [ $RSYNC_RESULT -ne 0 ] ; then
unregister_build
handle_remote_error "when rsyncing remote build #$BUILDNR results from $NODE"
@@ -873,8 +866,7 @@ remote_build() {
fi
ls -lR $TMPDIR
log_info "Deleting \$TMPDIR on $NODE."
- ssh -o "BatchMode = yes" $NODE "rm -r $TMPDIR"
- set -e
+ ssh -o "BatchMode = yes" $NODE "rm -r $TMPDIR" || true
if [ $BUILDNR -eq 1 ] ; then
log_file $TMPDIR/b1/build.log
fi
@@ -902,10 +894,8 @@ check_installed_build_depends() {
local TMPFILE2=$(mktemp --tmpdir=$TMPDIR)
grep-dctrl -s Installed-Build-Depends -n ${SRCPACKAGE} ./b1/$BUILDINFO > $TMPFILE1
grep-dctrl -s Installed-Build-Depends -n ${SRCPACKAGE} ./b2/$BUILDINFO > $TMPFILE2
- set +e
- diff $TMPFILE1 $TMPFILE2
- RESULT=$?
- set -e
+ local RESULT=0
+ diff $TMPFILE1 $TMPFILE2 || RESULT=$?
if [ $RESULT -eq 1 ] ; then
printf "$(date -u) - $BUILDINFO in ${SUITE} on ${ARCH} varies, probably due to mirror updates. Doing the first build again, please check ${BUILD_URL}console.log for now...\n" >> /var/log/jenkins/reproducible-env-changes.log
echo
@@ -915,11 +905,9 @@ check_installed_build_depends() {
echo
remote_build 1 $NODE1
grep-dctrl -s Installed-Build-Depends -n ${SRCPACKAGE} ./b1/$BUILDINFO > $TMPFILE1
- set +e
- diff $TMPFILE1 $TMPFILE2
- RESULT=$?
- rm $TMPFILE1 $TMPFILE2
- set -e
+ RESULT=0
+ diff $TMPFILE1 $TMPFILE2 || RESULT=$?
+ rm -f $TMPFILE1 $TMPFILE2
if [ $RESULT -eq 1 ] ; then
handle_env_changes "different packages were installed in the 1st+2nd builds and also in the 2nd+3rd build.\n$(ls -l ./b1/$BUILDINFO) on $NODE1\n$(ls -l ./b2/$BUILDINFO) on $NODE2\n"
fi
=====================================
bin/reproducible_setup_pbuilder.sh
=====================================
@@ -23,7 +23,7 @@ ARCH=$(dpkg --print-architecture)
if [ "$SUITE" = "unstable" ] || [ "$SUITE" = "experimental" ] ; then
if [ "$ARCH" = "armhf" ]; then
- echo temporarly skipping "$s/$ARCH"
+ echo temporarly skipping "$SUITE/$ARCH"
exit 0
fi
fi
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/c70e24ccdf7fb4b6a7f88a4026288d4e0efc0a0c...6d4940818e572bef25c98c1d5df4537a42ffad93
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/c70e24ccdf7fb4b6a7f88a4026288d4e0efc0a0c...6d4940818e572bef25c98c1d5df4537a42ffad93
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/20240316/8b0cc726/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list