kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/2] kudu git commit: build-and-test: only run cmake once
Date Tue, 13 Sep 2016 19:13:23 GMT
build-and-test: only run cmake once

Running it twice as we were before was confusing, and the way in which we'd
override BUILD_TYPE was error-prone (e.g. the ASAN-specific check for
disabling core dumps was broken).

Change-Id: I8f9eb27d69ac4d120a0bdad1d1695b4f59b12641
Reviewed-on: http://gerrit.cloudera.org:8080/4401
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/74065d1c
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/74065d1c
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/74065d1c

Branch: refs/heads/master
Commit: 74065d1cac9635da2f0a80e99a545e12658251a9
Parents: 609546d
Author: Adar Dembo <adar@cloudera.com>
Authored: Mon Sep 12 20:45:57 2016 -0700
Committer: Adar Dembo <adar@cloudera.com>
Committed: Tue Sep 13 19:13:00 2016 +0000

----------------------------------------------------------------------
 build-support/jenkins/build-and-test.sh | 59 ++++++++++++++++++----------
 1 file changed, 38 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/74065d1c/build-support/jenkins/build-and-test.sh
----------------------------------------------------------------------
diff --git a/build-support/jenkins/build-and-test.sh b/build-support/jenkins/build-and-test.sh
index 7b9e552..70090ec 100755
--- a/build-support/jenkins/build-and-test.sh
+++ b/build-support/jenkins/build-and-test.sh
@@ -162,33 +162,60 @@ fi
 # library (which the bindings depend on) is missing ASAN/TSAN symbols.
 cd $BUILD_ROOT
 if [ "$BUILD_TYPE" = "ASAN" ]; then
-  $SOURCE_ROOT/build-support/enable_devtoolset.sh \
-    "env CC=$CLANG CXX=$CLANG++ $THIRDPARTY_BIN/cmake -DKUDU_USE_ASAN=1 -DKUDU_USE_UBSAN=1
$SOURCE_ROOT"
-  BUILD_TYPE=fastdebug
+  USE_CLANG=1
+  CMAKE_BUILD=fastdebug
+  EXTRA_BUILD_FLAGS="-DKUDU_USE_ASAN=1 -DKUDU_USE_UBSAN=1"
   BUILD_PYTHON=0
 elif [ "$BUILD_TYPE" = "TSAN" ]; then
-  $SOURCE_ROOT/build-support/enable_devtoolset.sh \
-    "env CC=$CLANG CXX=$CLANG++ $THIRDPARTY_BIN/cmake -DKUDU_USE_TSAN=1 $SOURCE_ROOT"
-  BUILD_TYPE=fastdebug
+  USE_CLANG=1
+  CMAKE_BUILD=fastdebug
+  EXTRA_BUILD_FLAGS="-DKUDU_USE_TSAN=1"
   EXTRA_TEST_FLAGS="$EXTRA_TEST_FLAGS -LE no_tsan"
   BUILD_PYTHON=0
 elif [ "$BUILD_TYPE" = "COVERAGE" ]; then
+  USE_CLANG=1
+  CMAKE_BUILD=debug
+  EXTRA_BUILD_FLAGS="-DKUDU_GENERATE_COVERAGE=1"
   DO_COVERAGE=1
-  BUILD_TYPE=debug
 
   # We currently dont capture coverage for Java or Python.
   BUILD_JAVA=0
   BUILD_PYTHON=0
-
-  $SOURCE_ROOT/build-support/enable_devtoolset.sh \
-    "env CC=$CLANG CXX=$CLANG++ $THIRDPARTY_BIN/cmake -DKUDU_GENERATE_COVERAGE=1 $SOURCE_ROOT"
 elif [ "$BUILD_TYPE" = "LINT" ]; then
+  CMAKE_BUILD=debug
+else
+  # Must be DEBUG or RELEASE
+  CMAKE_BUILD=$BUILD_TYPE
+fi
+
+# Assemble the cmake command line.
+CMAKE=
+if [ -n "$USE_CLANG" ]; then
+  CMAKE="env CC=$CLANG CXX=$CLANG++"
+fi
+CMAKE="$CMAKE $SOURCE_ROOT/build-support/enable_devtoolset.sh"
+CMAKE="$CMAKE $THIRDPARTY_BIN/cmake"
+CMAKE="$CMAKE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD"
+
+# On distributed tests, force dynamic linking even for release builds. Otherwise,
+# the test binaries are too large and we spend way too much time uploading them
+# to the test slaves.
+if [ "$ENABLE_DIST_TEST" == "1" ]; then
+  CMAKE="$CMAKE -DKUDU_LINK=dynamic"
+fi
+if [ -n "$EXTRA_BUILD_FLAGS" ]; then
+  CMAKE="$CMAKE $EXTRA_BUILD_FLAGS"
+fi
+CMAKE="$CMAKE $SOURCE_ROOT"
+$CMAKE
+
+# Short circuit for LINT builds.
+if [ "$BUILD_TYPE" = "LINT" ]; then
   # Create empty test logs or else Jenkins fails to archive artifacts, which
   # results in the build failing.
   mkdir -p Testing/Temporary
   mkdir -p $TEST_LOGDIR
 
-  $SOURCE_ROOT/build-support/enable_devtoolset.sh "$THIRDPARTY_BIN/cmake $SOURCE_ROOT"
   make lint | tee $TEST_LOGDIR/lint.log
   exit $?
 fi
@@ -216,16 +243,6 @@ if [ "$KUDU_FLAKY_TEST_ATTEMPTS" -gt 1 ]; then
   fi
 fi
 
-# On distributed tests, force dynamic linking even for release builds. Otherwise,
-# the test binaries are too large and we spend way too much time uploading them
-# to the test slaves.
-LINK_FLAGS=
-if [ "$ENABLE_DIST_TEST" == "1" ]; then
-  LINK_FLAGS="-DKUDU_LINK=dynamic"
-fi
-
-$SOURCE_ROOT/build-support/enable_devtoolset.sh "$THIRDPARTY_BIN/cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
$LINK_FLAGS $SOURCE_ROOT"
-
 # our tests leave lots of data lying around, clean up before we run
 if [ -d "$TEST_TMPDIR" ]; then
   rm -Rf $TEST_TMPDIR/*


Mime
View raw message