From: Mark Abraham Date: Fri, 22 Oct 2021 08:24:26 +0000 (+0200) Subject: Make linker errors fail the CI builds X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=commitdiff_plain;h=0f4b6dfa441698c4bdb42a62b81179aba1502a2b Make linker errors fail the CI builds --- diff --git a/admin/ci-scripts/gromacs-base-build.sh b/admin/ci-scripts/gromacs-base-build.sh index 2ff4629366..94843970e2 100755 --- a/admin/ci-scripts/gromacs-base-build.sh +++ b/admin/ci-scripts/gromacs-base-build.sh @@ -4,10 +4,20 @@ CMAKE=${CMAKE:-$(which cmake)} cd $BUILD_DIR $CMAKE --build . -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee buildLogFile.log $CMAKE --build . --target tests -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee testBuildLogFile.log + +# Find compiler warnings awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log \ | grep -v "CMake" | tee buildErrors.log || true grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true + +# Find linking errors: +grep "^/usr/bin/ld:" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true + +# Install GROMACS $CMAKE --build . --target install 2>&1 | tee installBuildLogFile.log + +# Fail if there were warnings or errors reported if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi +# Remove object files to minimize artifact size find . -mindepth 1 -name '*.o' ! -type l -printf '%p\n' -delete 2>&1 > remove-build-objects.log cd ..