Index: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh =================================================================== --- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh +++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh @@ -20,7 +20,7 @@ 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 @@ 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 Index: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh =================================================================== --- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh +++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh @@ -116,6 +116,31 @@ 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="\