From b3523937655590906d566636e259e01ed7adc652 Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> Date: Mon, 2 Dec 2019 13:53:27 +0100 Subject: [PATCH] Made the externals build scripts more resilient. From now on, when in "nightly" mode, the scripts will still attempt to build Gaudi, even if some error happened in the build of the ATLAS externals project. Since many errors can happen there that would still allow most of the rest of the nightly to build successfully. --- Projects/AthSimulation/build_externals.sh | 19 ++++++++++++++----- Projects/Athena/build_externals.sh | 19 ++++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Projects/AthSimulation/build_externals.sh b/Projects/AthSimulation/build_externals.sh index 1548b155d9b..63b9fee3d29 100755 --- a/Projects/AthSimulation/build_externals.sh +++ b/Projects/AthSimulation/build_externals.sh @@ -57,9 +57,12 @@ while getopts ":t:b:x:fch" opt; do esac done -# Stop on errors from here on out: -set -e -set -o pipefail +# Only stop on errors if we are in the CI. Otherwise just count them. +if [ "$CI" = "1" ]; then + set -e + set -o pipefail +fi +ERROR_COUNT=0 # We are in BASH, get the path of this script in a simple way: thisdir=$(dirname ${BASH_SOURCE[0]}) @@ -118,7 +121,7 @@ ${scriptsdir}/build_atlasexternals.sh \ -b ${BUILDDIR}/build/AthSimulationExternals \ -i ${BUILDDIR}/install/AthSimulationExternals/${NICOS_PROJECT_VERSION} \ -p AthSimulationExternals ${RPMOPTIONS} -t ${BUILDTYPE} \ - ${EXTRACMAKE[@]/#/-x } -v ${NICOS_PROJECT_VERSION} + ${EXTRACMAKE[@]/#/-x } -v ${NICOS_PROJECT_VERSION} || ((ERROR_COUNT++)) # Get the "platform name" from the directory created by the AthSimulationExternals # build: @@ -140,4 +143,10 @@ ${scriptsdir}/build_Gaudi.sh \ -i ${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION} \ -e ${BUILDDIR}/install/AthSimulationExternals/${NICOS_PROJECT_VERSION}/InstallArea/${platform} \ -p AthSimulationExternals -f ${platform} ${EXTRACMAKE[@]/#/-x } \ - ${RPMOPTIONS} -t ${BUILDTYPE} + ${RPMOPTIONS} -t ${BUILDTYPE} || ((ERROR_COUNT++)) + +# Exit with the error count taken into account. +if [ ${ERROR_COUNT} -ne 0 ]; then + echo "AthSimulation externals build encountered ${ERROR_COUNT} error(s)" +fi +exit ${ERROR_COUNT} diff --git a/Projects/Athena/build_externals.sh b/Projects/Athena/build_externals.sh index 01404b17391..38ff7afb434 100755 --- a/Projects/Athena/build_externals.sh +++ b/Projects/Athena/build_externals.sh @@ -57,9 +57,12 @@ while getopts ":t:b:x:fch" opt; do esac done -# Stop on errors from here on out -set -e -set -o pipefail +# Only stop on errors if we are in the CI. Otherwise just count them. +if [ "$CI" = "1" ]; then + set -e + set -o pipefail +fi +ERROR_COUNT=0 # We are in BASH, get the path of this script in a simple way: thisdir=$(dirname ${BASH_SOURCE[0]}) @@ -143,7 +146,7 @@ ${scriptsdir}/build_atlasexternals.sh \ -i ${BUILDDIR}/install/AthenaExternals/${NICOS_PROJECT_VERSION} \ -p AthenaExternals ${RPMOPTIONS} -t ${BUILDTYPE} \ -v ${NICOS_PROJECT_VERSION} \ - ${EXTRACMAKE[@]/#/-x } + ${EXTRACMAKE[@]/#/-x } || ((ERROR_COUNT++)) { test "X${NIGHTLY_STATUS}" != "X" && { @@ -182,7 +185,7 @@ ${scriptsdir}/build_Gaudi.sh \ -i ${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION} \ -e ${BUILDDIR}/install/AthenaExternals/${NICOS_PROJECT_VERSION}/InstallArea/${platform} \ -p AthenaExternals -f ${platform} ${RPMOPTIONS} -t ${BUILDTYPE} \ - ${EXTRACMAKE[@]/#/-x } + ${EXTRACMAKE[@]/#/-x } || ((ERROR_COUNT++)) { test "X${NIGHTLY_STATUS}" != "X" && { @@ -192,3 +195,9 @@ ${scriptsdir}/build_Gaudi.sh \ ) } || true } + +# Exit with the error count taken into account. +if [ ${ERROR_COUNT} -ne 0 ]; then + echo "Athena externals build encountered ${ERROR_COUNT} error(s)" +fi +exit ${ERROR_COUNT} -- GitLab