[zorg] r219402 - Update sanitizer bot configuration.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Thu Oct 9 03:14:52 PDT 2014
Author: eugenis
Date: Thu Oct 9 05:14:52 2014
New Revision: 219402
URL: http://llvm.org/viewvc/llvm-project?rev=219402&view=rev
Log:
Update sanitizer bot configuration.
This commit brings sanitizer bot scripts in sync with the version that
currently runs on the bots.
Added:
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh (with props)
Modified:
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_cmake.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_selector.py
Added: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh?rev=219402&view=auto
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh (added)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh Thu Oct 9 05:14:52 2014
@@ -0,0 +1,140 @@
+#!/usr/bin/env bash
+
+function build_llvm_symbolizer { # ARCH triple
+ local _arch=$1
+ local _triple=$2
+
+ rm -rf llvm_build_android_$_arch
+ mkdir llvm_build_android_$_arch
+ cd llvm_build_android_$_arch
+
+ local ANDROID_TOOLCHAIN=$ROOT/../../../android-ndk/standalone-$_arch
+ local ANDROID_FLAGS="--target=$_triple --sysroot=$ANDROID_TOOLCHAIN/sysroot -B$ANDROID_TOOLCHAIN"
+ cmake -GNinja \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_WERROR=OFF \
+ -DCMAKE_C_COMPILER=$ROOT/llvm_build64/bin/clang \
+ -DCMAKE_CXX_COMPILER=$ROOT/llvm_build64/bin/clang++ \
+ -DCMAKE_C_FLAGS="$ANDROID_FLAGS" \
+ -DCMAKE_CXX_FLAGS="$ANDROID_FLAGS" \
+ -DANDROID=1 \
+ -DLLVM_BUILD_RUNTIME=OFF \
+ -DLLVM_TABLEGEN=$ROOT/llvm_build64/bin/llvm-tblgen \
+ ${CMAKE_COMMON_OPTIONS} \
+ $LLVM_CHECKOUT || echo @@@STEP_WARNINGS@@@
+ ninja llvm-symbolizer || echo @@@STEP_WARNINGS@@@
+
+ cd ..
+}
+
+function build_compiler_rt { # ARCH triple
+ local _arch=$1
+ local _triple=$2
+
+ local ANDROID_TOOLCHAIN=$ROOT/../../../android-ndk/standalone-$_arch
+ local ANDROID_LIBRARY_OUTPUT_DIR=$(ls -d $ROOT/llvm_build64/lib/clang/* | tail -1)
+ local ANDROID_EXEC_OUTPUT_DIR=$ROOT/llvm_build64/bin
+ local ANDROID_FLAGS="--target=$_triple --sysroot=$ANDROID_TOOLCHAIN/sysroot -B$ANDROID_TOOLCHAIN"
+
+ # Always clobber android build tree.
+ # It has a hidden dependency on clang (through CXX) which is not known to
+ # the build system.
+ rm -rf compiler_rt_build_android_$_arch
+ mkdir compiler_rt_build_android_$_arch
+ cd compiler_rt_build_android_$_arch
+
+ cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
+ -DCMAKE_C_COMPILER=$ROOT/llvm_build64/bin/clang \
+ -DCMAKE_CXX_COMPILER=$ROOT/llvm_build64/bin/clang++ \
+ -DLLVM_CONFIG_PATH=$ROOT/llvm_build64/bin/llvm-config \
+ -DCOMPILER_RT_INCLUDE_TESTS=ON \
+ -DCOMPILER_RT_ENABLE_WERROR=ON \
+ -DCMAKE_C_FLAGS="$ANDROID_FLAGS" \
+ -DCMAKE_CXX_FLAGS="$ANDROID_FLAGS" \
+ -DANDROID=1 \
+ -DCOMPILER_RT_TEST_COMPILER_CFLAGS="$ANDROID_FLAGS" \
+ -DCOMPILER_RT_TEST_TARGET_TRIPLE=arm-linux-androideabi \
+ -DCOMPILER_RT_OUTPUT_DIR="$ANDROID_LIBRARY_OUTPUT_DIR" \
+ -DCOMPILER_RT_EXEC_OUTPUT_DIR="$ANDROID_EXEC_OUTPUT_DIR" \
+ ${CMAKE_COMMON_OPTIONS} \
+ $LLVM_CHECKOUT/projects/compiler-rt || echo @@@STEP_WARNINGS@@@
+ ninja asan || echo @@@STEP_WARNINGS@@@
+ ls "$ANDROID_LIBRARY_OUTPUT_DIR"
+ ninja AsanUnitTests SanitizerUnitTests || echo @@@STEP_WARNINGS@@@
+
+ cd ..
+}
+
+function test_android { # ARCH AVD STEP_FAILURE
+ local _arch=$1
+ local _avd=$2
+ local _step_failure=$3 # @@@STEP_FAILURE@@@ or @@@STEP_WARNINGS@@@
+
+ ANDROID_SDK=$ROOT/../../../android-sdk-linux/
+ SYMBOLIZER_BIN=$ROOT/llvm_build_android_$_arch/bin/llvm-symbolizer
+ COMPILER_RT_BUILD_DIR=$ROOT/compiler_rt_build_android_$_arch
+ ADB=$ANDROID_SDK/platform-tools/adb
+ DEVICE_ROOT=/data/local/asan_test
+
+ echo @@@BUILD_STEP device setup [$_avd]@@@
+
+ $ADB devices # should be empty
+ $ANDROID_SDK/tools/emulator -avd $_avd -no-window -noaudio -no-boot-anim &
+ sleep 10
+ $ADB wait-for-device
+
+ echo "Device is up"
+ $ADB devices
+
+ sleep 2
+
+ ADB=$ADB $ROOT/llvm_build64/bin/asan_device_setup
+ sleep 2
+
+ $ADB push $SYMBOLIZER_BIN /system/bin/
+ $ADB shell rm -rf $DEVICE_ROOT
+ $ADB shell mkdir $DEVICE_ROOT
+
+ echo @@@BUILD_STEP run asan lit tests [Android/$_avd]@@@
+
+ (cd $COMPILER_RT_BUILD_DIR && ninja check-asan) || echo $_step_failure
+
+ # echo @@@BUILD_STEP run sanitizer_common tests [Android/$_avd]@@@
+
+ # $ADB push $COMPILER_RT_BUILD_DIR/lib/sanitizer_common/tests/SanitizerTest $DEVICE_ROOT/
+
+ # $ADB shell "$DEVICE_ROOT/SanitizerTest; \
+ # echo \$? >$DEVICE_ROOT/error_code"
+ # $ADB pull $DEVICE_ROOT/error_code error_code && (exit `cat error_code`) || echo @@@STEP_WARNINGS@@@
+
+ echo @@@BUILD_STEP run asan tests [Android/$_avd]@@@
+
+ $ADB push $COMPILER_RT_BUILD_DIR/lib/asan/tests/AsanTest $DEVICE_ROOT/
+ $ADB push $COMPILER_RT_BUILD_DIR/lib/asan/tests/AsanNoinstTest $DEVICE_ROOT/
+
+ NUM_SHARDS=7
+ for ((SHARD=0; SHARD < $NUM_SHARDS; SHARD++)); do
+ $ADB shell "ASAN_OPTIONS=start_deactivated=1 \
+ GTEST_TOTAL_SHARDS=$NUM_SHARDS \
+ GTEST_SHARD_INDEX=$SHARD \
+ asanwrapper $DEVICE_ROOT/AsanTest; \
+ echo \$? >$DEVICE_ROOT/error_code"
+ $ADB pull $DEVICE_ROOT/error_code error_code && echo && (exit `cat error_code`) || echo @@@STEP_WARNINGS@@@
+ $ADB shell " \
+ GTEST_TOTAL_SHARDS=$NUM_SHARDS \
+ GTEST_SHARD_INDEX=$SHARD \
+ $DEVICE_ROOT/AsanNoinstTest; \
+ echo \$? >$DEVICE_ROOT/error_code"
+ $ADB pull $DEVICE_ROOT/error_code error_code && echo && (exit `cat error_code`) || echo @@@STEP_WARNINGS@@@
+ done
+
+ echo "Killing emulator"
+ $ADB emu kill
+ sleep 2
+
+ $ADB devices
+}
+
+function android_emulator_cleanup {
+ $ADB emu kill || true
+}
Propchange: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh
------------------------------------------------------------------------------
svn:eol-style = LF
Propchange: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh
------------------------------------------------------------------------------
svn:executable = *
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_cmake.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_cmake.sh?rev=219402&r1=219401&r2=219402&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_cmake.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_cmake.sh Thu Oct 9 05:14:52 2014
@@ -177,5 +177,6 @@ fi
if [ $RUN_ANDROID == 1 ] ; then
trap "android_emulator_cleanup" EXIT
- test_android arm arm-K
+ test_android arm arm-K @@@STEP_FAILURE@@@
+ test_android x86 x86-K @@@STEP_WARNINGS@@@
fi
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_selector.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_selector.py?rev=219402&r1=219401&r2=219402&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_selector.py (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_selector.py Thu Oct 9 05:14:52 2014
@@ -37,7 +37,7 @@ BOT_ADDITIONAL_ENV = {
'mac10.9-cmake': { 'MAX_MAKE_JOBS': '8' },
'mac10.9': { 'MAX_MAKE_JOBS': '8' },
'sanitizer-ppc64-linux1': { 'HAVE_NINJA': '0' },
- 'sanitizer-x86_64-linux': { 'BUILD_ANDROID' : '1', 'RUN_ANDROID' : '0', 'HAVE_NINJA' : '1' },
+ 'sanitizer-x86_64-linux': { 'BUILD_ANDROID' : '1', 'RUN_ANDROID' : '1', 'HAVE_NINJA' : '1' },
'sanitizer-x86_64-linux-bootstrap': {},
}
More information about the llvm-commits
mailing list