[zorg] r305980 - [sanitizers] Move building stage1 clang from buildbot_fast to buildbot_functions

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 18:57:19 PDT 2017


Author: vitalybuka
Date: Wed Jun 21 20:57:18 2017
New Revision: 305980

URL: http://llvm.org/viewvc/llvm-project?rev=305980&view=rev
Log:
[sanitizers] Move building stage1 clang from buildbot_fast to buildbot_functions

Reviewers: eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34490

Modified:
    zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh
    zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh

Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh?rev=305980&r1=305979&r2=305980&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh Wed Jun 21 20:57:18 2017
@@ -20,7 +20,7 @@ STAGE2_UBSAN_DIR=llvm_build_ubsan
 STAGE2_LIBCXX_MSAN_DIR=libcxx_build_msan
 STAGE2_LIBCXX_ASAN_DIR=libcxx_build_asan
 STAGE2_LIBCXX_UBSAN_DIR=libcxx_build_ubsan
-HOST_CLANG_REVISION=303753
+STAGE1_CLOBBER="${STAGE2_LIBCXX_MSAN_DIR} ${STAGE2_LIBCXX_ASAN_DIR} ${STAGE2_LIBCXX_UBSAN_DIR} ${STAGE2_MSAN_DIR} ${STAGE2_ASAN_DIR} ${STAGE2_UBSAN_DIR}"
 LLVM=$ROOT/llvm
 CMAKE_COMMON_OPTIONS="-GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_PARALLEL_LINK_JOBS=20"
 
@@ -28,46 +28,11 @@ if [ "$BUILDBOT_CLOBBER" != "" ]; then
   echo @@@BUILD_STEP clobber@@@
   rm -rf llvm
   rm -rf ${STAGE1_DIR}
-  rm -f host_clang_revision
 fi
 
 # Stage 1
 
-if  [ -r host_clang_revision ] && \
-    [ "$(cat host_clang_revision)" == $HOST_CLANG_REVISION ]
-then
-  # Do nothing.
-  echo @@@BUILD_STEP using pre-built stage1 clang at r$HOST_CLANG_REVISION@@@
-else
-  echo @@@BUILD_STEP sync to r$HOST_CLANG_REVISION@@@
-  real_buildbot_revision=$BUILDBOT_REVISION
-  BUILDBOT_REVISION=$HOST_CLANG_REVISION
-  buildbot_update
-
-  echo @@@BUILD_STEP build stage1 clang at r$HOST_CLANG_REVISION@@@
-
-  rm -rf host_clang_revision
-
-  # CMake does not notice that the compiler itself has changed. Anyway,
-  # incremental builds of stage2 don't make sense if stage1 compiler has
-  # changed. Clobber the build trees.
-  rm -rf ${STAGE2_LIBCXX_MSAN_DIR}
-  rm -rf ${STAGE2_LIBCXX_ASAN_DIR}
-  rm -rf ${STAGE2_LIBCXX_UBSAN_DIR}
-  rm -rf ${STAGE2_MSAN_DIR}
-  rm -rf ${STAGE2_ASAN_DIR}
-  rm -rf ${STAGE2_UBSAN_DIR}
-
-  # Usually it happens rarely and revisions are very different, so incremental
-  # build does not make sense here as well.
-  rm -rf ${STAGE1_DIR}
-
-  build_stage1_clang
-
-  echo $HOST_CLANG_REVISION > host_clang_revision
-
-  BUILDBOT_REVISION=$real_buildbot_revision
-fi
+build_stage1_clang_at_revison 303753
 
 echo @@@BUILD_STEP update@@@
 buildbot_update

Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh?rev=305980&r1=305979&r2=305980&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh Wed Jun 21 20:57:18 2017
@@ -116,6 +116,31 @@ function build_stage1_clang {
     ninja clang compiler-rt llvm-symbolizer)
 }
 
+function build_stage1_clang_at_revison {
+  local HOST_CLANG_REVISION=$1
+  if  [ -r ${STAGE1_DIR}/host_clang_revision ] && \
+      [ "$(cat ${STAGE1_DIR}/host_clang_revision)" == $HOST_CLANG_REVISION ]
+  then
+    echo @@@BUILD_STEP using pre-built stage1 clang at r$HOST_CLANG_REVISION@@@
+  else
+    echo @@@BUILD_STEP sync to r$HOST_CLANG_REVISION@@@
+    real_buildbot_revision=$BUILDBOT_REVISION
+    BUILDBOT_REVISION=$HOST_CLANG_REVISION
+    buildbot_update
+
+    echo @@@BUILD_STEP Clear ${STAGE1_DIR} ${STAGE1_CLOBBER}
+    rm -rf ${STAGE1_DIR} ${STAGE1_CLOBBER}
+
+    echo @@@BUILD_STEP build stage1 clang at r$HOST_CLANG_REVISION@@@
+
+    build_stage1_clang
+
+    echo $HOST_CLANG_REVISION > ${STAGE1_DIR}/host_clang_revision
+
+    BUILDBOT_REVISION=$real_buildbot_revision
+  fi
+}
+
 function common_stage2_variables {
   local stage1_clang_path=$ROOT/${STAGE1_DIR}/bin
   cmake_stage2_common_options="\




More information about the llvm-commits mailing list