build: better error reporting for failures in build_binaries.sh

this will make it easier to track down build failures
This commit is contained in:
Andrew Tridgell 2014-01-22 19:00:15 +11:00
parent e037b37880
commit 5a16d8067a
1 changed files with 59 additions and 11 deletions

View File

@ -17,6 +17,8 @@ hdate=$(date +"%Y-%m/%Y-%m-%d-%H:%m")
mkdir -p binaries/$hdate
binaries=$PWD/../buildlogs/binaries
error_count=0
. config.mk
# checkout the right version of the tree
@ -33,13 +35,18 @@ checkout() {
vtag2="$vehicle-$tag"
fi
echo "Checkout for $vehicle for $board with tag $tag"
git checkout "$vtag" || git checkout "$vtag2" || return 1
git show
pushd ../../PX4NuttX
git checkout "$vtag" || git checkout "$vtag2" || git checkout master || {
popd
return 1
}
git show
popd
pushd ../../PX4Firmware
@ -47,6 +54,7 @@ checkout() {
popd
return 1
}
git show
popd
return 0
@ -109,22 +117,38 @@ build_arduplane() {
echo "Building ArduPlane $tag binaries"
pushd ArduPlane
for b in apm1 apm2 apm1-hilsensors apm2-hilsensors; do
checkout ArduPlane $tag $b || continue
checkout ArduPlane $tag $b || {
echo "Failed checkout of ArduPlane $b $tag"
error_count=$((error_count+1))
continue
}
echo "Building ArduPlane $b binaries"
ddir=$binaries/Plane/$hdate/$b
skip_build $tag $ddir && continue
make clean || continue
make $b -j4 || continue
make $b -j4 || {
echo "Failed build of ArduPlane $b $tag"
error_count=$((error_count+1))
continue
}
copyit $TMPDIR/ArduPlane.build/ArduPlane.hex $ddir $tag
touch $binaries/Plane/$tag
done
test -n "$PX4_ROOT" && {
echo "Building ArduPlane PX4 binaries"
ddir=$binaries/Plane/$hdate/PX4
checkout ArduPlane $tag PX4
checkout ArduPlane $tag PX4 || {
echo "Failed checkout of ArduPlane PX4 $tag"
error_count=$((error_count+1))
continue
}
skip_build $tag $ddir || {
make px4-clean &&
make px4 &&
make px4 || {
echo "Failed build of ArduPlane PX4 $tag"
error_count=$((error_count+1))
continue
}
copyit ArduPlane-v1.px4 $ddir $tag &&
copyit ArduPlane-v2.px4 $ddir $tag
if [ "$tag" = "latest" ]; then
@ -146,26 +170,42 @@ build_arducopter() {
pushd ArduCopter
frames="quad tri hexa y6 octa octa-quad heli"
for b in apm1 apm2; do
checkout ArduCopter $tag $b
checkout ArduCopter $tag $b || {
echo "Failed checkout of ArduCopter $b $tag"
error_count=$((error_count+1))
continue
}
for f in $frames quad-hil heli-hil; do
echo "Building ArduCopter $b-$f binaries"
ddir="$binaries/Copter/$hdate/$b-$f"
skip_build $tag $ddir && continue
make clean || continue
make "$b-$f" -j4 || exit 1
make "$b-$f" -j4 || {
echo "Failed build of ArduCopter $b $tag"
error_count=$((error_count+1))
continue
}
copyit $TMPDIR/ArduCopter.build/ArduCopter.hex "$ddir" "$tag"
touch $binaries/Copter/$tag
done
done
test -n "$PX4_ROOT" && {
checkout ArduCopter $tag PX4
checkout ArduCopter $tag PX4 || {
echo "Failed checkout of ArduCopter PX4 $tag"
error_count=$((error_count+1))
continue
}
make px4-clean || return
for f in $frames quad-hil heli-hil; do
echo "Building ArduCopter PX4-$f binaries"
ddir="$binaries/Copter/$hdate/PX4-$f"
skip_build $tag $ddir && continue
rm -rf ../Build.ArduCopter
make px4-$f || continue
make px4-$f || {
echo "Failed build of ArduCopter PX4 $tag"
error_count=$((error_count+1))
continue
}
copyit ArduCopter-v1.px4 $ddir $tag &&
copyit ArduCopter-v2.px4 $ddir $tag
done
@ -185,7 +225,11 @@ build_rover() {
ddir=$binaries/Rover/$hdate/$b
skip_build $tag $ddir && continue
make clean || continue
make $b -j4 || continue
make $b -j4 || {
echo "Failed build of APMrover2 $b $tag"
error_count=$((error_count+1))
continue
}
copyit $TMPDIR/APMrover2.build/APMrover2.hex $ddir $tag
touch $binaries/Rover/$tag
done
@ -195,7 +239,11 @@ build_rover() {
checkout APMrover2 $tag PX4 || continue
skip_build $tag $ddir || {
make px4-clean &&
make px4 &&
make px4 || {
echo "Failed build of APMrover2 PX4 $tag"
error_count=$((error_count+1))
continue
}
copyit APMrover2-v1.px4 $binaries/Rover/$hdate/PX4 $tag &&
copyit APMrover2-v2.px4 $binaries/Rover/$hdate/PX4 $tag
}
@ -212,4 +260,4 @@ done
rm -rf $TMPDIR
exit 0
exit $error_count