Skip to content
Snippets Groups Projects
Commit 858ee243 authored by Christian Gumpert's avatar Christian Gumpert
Browse files

propagate number of shell execution errors

Even if we do not to fail immediately on errors when building Gaudi
or ATLAS externals, it is still important for the CI system to know
whether some errors occured. By not failing on error but reporting
the total number of errors, the calling scripts can decide how to
deal with this in specific situations (e.g. CI build vs nightly).


Former-commit-id: 136d2f16
parent 229a99fe
No related branches found
No related tags found
8 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!28528Revert 63f845ae,!27054Atr20369 210,!26342Monopole: Handle fractionally charged particles
......@@ -3,8 +3,12 @@
# Script used for building Gaudi.
#
# Don't stop on errors:
# Don't stop on errors but count them
set +e
ERROR_COUNT=0
# consider a pipe failed if ANY of the commands fails
set -o pipefail
# Function printing the usage information for the script
usage() {
......@@ -75,30 +79,32 @@ if [ "$SOURCEDIR" = "" ] || [ "$BUILDDIR" = "" ] || [ "$INSTALLDIR" = "" ] \
fi
# Create the build directory if it doesn't exist, and move to it:
mkdir -p ${BUILDDIR}
cd ${BUILDDIR}
mkdir -p ${BUILDDIR} || ((ERROR_COUNT++))
cd ${BUILDDIR} || ((ERROR_COUNT++))
# Set up the externals project:
source ${EXTDIR}/setup.sh
source ${EXTDIR}/setup.sh || ((ERROR_COUNT++))
# Configure the build:
cmake -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} -DCTEST_USE_LAUNCHERS:BOOL=TRUE \
-DGAUDI_ATLAS:BOOL=TRUE -DGAUDI_ATLAS_BASE_PROJECT:STRING=${EXTPROJECT} \
-DCMAKE_INSTALL_PREFIX:PATH=/InstallArea/${PLATFORM} \
${SOURCEDIR} 2>&1 | tee cmake_config.log
${SOURCEDIR} 2>&1 | tee cmake_config.log || ((ERROR_COUNT++))
# Build it:
make -k
make -k || ((ERROR_COUNT++))
# Install it:
make -k install/fast DESTDIR=${INSTALLDIR}
make -k install/fast DESTDIR=${INSTALLDIR} || ((ERROR_COUNT++))
# If no RPM directory was specified, stop here:
if [ "$RPMDIR" = "" ]; then
exit 0
exit ${ERROR_COUNT}
fi
# Build the RPM for the project:
cpack
mkdir -p ${RPMDIR}
cp GAUDI*.rpm ${RPMDIR}
cpack || ((ERROR_COUNT++))
mkdir -p ${RPMDIR} || ((ERROR_COUNT++))
cp GAUDI*.rpm ${RPMDIR} || ((ERROR_COUNT++))
exit ${ERROR_COUNT}
......@@ -4,8 +4,12 @@
# repository.
#
# Don't stop on errors:
# Don't stop on errors but count them
set +e
ERROR_COUNT=0
# consider a pipe failed if ANY of the commands fails
set -o pipefail
# Function printing the usage information for the script
usage() {
......@@ -65,8 +69,8 @@ if [ "$SOURCEDIR" = "" ] || [ "$BUILDDIR" = "" ] || [ "$INSTALLDIR" = "" ]; then
fi
# Create the build directory if it doesn't exist, and move to it:
mkdir -p ${BUILDDIR}
cd ${BUILDDIR}
mkdir -p ${BUILDDIR} || ((ERROR_COUNT++))
cd ${BUILDDIR} || ((ERROR_COUNT++))
# Extra settings for providing a project version for the build if necessary:
EXTRACONF=
......@@ -78,21 +82,23 @@ fi
# Configure the build:
cmake -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} -DCTEST_USE_LAUNCHERS:BOOL=TRUE \
${EXTRACONF} \
${SOURCEDIR}/Projects/${PROJECT}/ 2>&1 | tee cmake_config.log
${SOURCEDIR}/Projects/${PROJECT}/ 2>&1 | tee cmake_config.log || ((ERROR_COUNT++))
# Build it:
make -k
make -k || ((ERROR_COUNT++))
# Install it:
make -k install/fast DESTDIR=${INSTALLDIR}
make -k install/fast DESTDIR=${INSTALLDIR} || ((ERROR_COUNT++))
# If no RPM directory was specified, stop here:
if [ "$RPMDIR" = "" ]; then
exit 0
exit ${ERROR_COUNT}
fi
# Build the RPM or other package for the project:
cpack
mkdir -p ${RPMDIR}
cpack || ((ERROR_COUNT++))
mkdir -p ${RPMDIR} || ((ERROR_COUNT++))
FILES=$(ls ${PROJECT}*.rpm ${PROJECT}*.tar.gz ${PROJECT}*.dmg)
cp ${FILES} ${RPMDIR}
cp ${FILES} ${RPMDIR} || ((ERROR_COUNT++))
exit ${ERROR_COUNT}
......@@ -75,6 +75,8 @@ fi
# Stop on errors from here on out:
set -e
# consider a pipe failed if ANY of the commands fails
set -o pipefail
# Source in our environment
AthenaSrcDir=$(dirname ${BASH_SOURCE[0]})
......@@ -89,9 +91,6 @@ source $AthenaSrcDir/build_env.sh -b $BUILDDIR
mkdir -p ${BUILDDIR}/build/Athena
cd ${BUILDDIR}/build/Athena
# consider a pipe failed if ANY of the commands fails
set -o pipefail
# CMake:
if [ -n "$EXE_CMAKE" ]; then
# Remove the CMakeCache.txt file, to force CMake to find externals
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment