From 0f4b6dfa441698c4bdb42a62b81179aba1502a2b Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Fri, 22 Oct 2021 10:24:26 +0200 Subject: [PATCH] Make linker errors fail the CI builds --- admin/ci-scripts/gromacs-base-build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 .. -- 2.22.0