From 754e6877cccddd0a279659c32fa594b23369dc61 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 23 Oct 2017 14:57:56 +0200 Subject: fixups for recent "Cleanup jenkins build scripts" Change I24e500e132f5c8e8133d35548cb7b4e4552331d0 was merged, but IMHO needs improvement. Fix these: - clean the git source tree before each build step, in common prep_build(). - fix indenting inside the build() macros. - change build() arg to be build_dir, to absorb cleanup steps into build(). - in jenkins.sh, use $ENABLE_SANITIZE as global env, not passed as arg. - in jenkins.sh, don't do 'make distcheck' twice. It is not necessary to do it from source tree as well as separately from source tree, since distcheck already moves to a different build dir. Change-Id: I09d306350602f21943d5bd45f7388c83ede9b524 --- contrib/jenkins.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'contrib/jenkins.sh') diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index c397d528..d7315040 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -9,19 +9,23 @@ if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" fi +src_dir="$PWD" build() { - $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE $PARALLEL_MAKE check \ + || cat-testlogs.sh } # verify build in dir other than source tree -mkdir -p builddir -cd builddir -build ../configure $ENABLE_SANITIZE - -cd .. -build ./configure $ENABLE_SANITIZE +build builddir +# verify build in source tree +build . +# do distcheck only once, which is fine from built source tree, since distcheck +# is well separated from the source tree state. +$MAKE distcheck \ + || cat-testlogs.sh -- cgit v1.2.3