[zorg] r351897 - Add jenkins pipeline configuration for green dragon lldb-cmake-matrix job.
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 22 15:50:33 PST 2019
Author: adrian
Date: Tue Jan 22 15:50:33 2019
New Revision: 351897
URL: http://llvm.org/viewvc/llvm-project?rev=351897&view=rev
Log:
Add jenkins pipeline configuration for green dragon lldb-cmake-matrix job.
Added:
zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix
zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage1.sh
zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage2.sh
Added: zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix?rev=351897&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix Tue Jan 22 15:50:33 2019
@@ -0,0 +1,91 @@
+#!/usr/bin/env groovy
+pipeline {
+ agent {label 'green-dragon-23'}
+ stages {
+ stage('Subversion Checkout') {
+ steps {
+ timeout(activity: true, time: 30) {
+ checkout([$class: 'SubversionSCM',
+ locations: [
+ [local: 'llvm.src',
+ remote: 'http://llvm.org/svn/llvm-project/llvm/trunk'],
+ [local: 'lldb.src',
+ remote: 'http://llvm.org/svn/llvm-project/lldb/trunk'],
+ [local: 'clang.src',
+ remote: 'http://llvm.org/svn/llvm-project/cfe/trunk'],
+ [cancelProcessOnExternalsFail: true,
+ credentialsId: '', depthOption: 'infinity',
+ ignoreExternalsOption: true, local: 'libcxx.src',
+ remote: 'http://llvm.org/svn/llvm-project/libcxx/trunk']],
+ quietOperation: false,
+ workspaceUpdater: [$class: 'UpdateUpdater']])
+ }
+ }
+ }
+ stage('Build') {
+ steps {
+ timeout(activity: true, time: 30) {
+ sh '''
+set -u
+
+if [ "$CLEAN" = true ] ; then
+ rm -rf llvm
+fi
+
+export
+python $SCRIPT_PATH/build.py fetch
+'''
+ sh '''
+bash ${SCRIPT_PATH}/jobs/jobs/lldb-cmake-matrix-stage1
+'''
+ }
+ }
+ }
+ stage('LLDB CMake Matrix Stage 2, Clang 5.0.2') {
+ steps {
+ timeout(activity: true, time: 30) {
+ checkout([$class: 'SubversionSCM',
+ locations: [
+ [local: 'src/history/clang-5.0.2',
+ remote: 'http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_502/final'],
+ [local: 'src/history/clang-5.0.2/tools/clang',
+ remote: 'http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_502/final'],
+ [local: 'src/history/clang-5.0.2/projects/libcxx',
+ remote: 'http://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_502/final']],
+ quietOperation: false,
+ workspaceUpdater: [$class: 'UpdateUpdater']])
+ }
+ timeout(activity: true, time: 30) {
+ sh '''
+export HISTORIC_COMPILER=clang-5.0.2
+bash ${SCRIPT_PATH}/jobs/jobs/lldb-cmake-matrix-stage2
+'''
+ junit 'test-clang-5.0.2/results.xml'
+ }
+ }
+ }
+ stage('LLDB CMake Matrix Stage 2, Clang 6.0.1') {
+ steps {
+ timeout(activity: true, time: 30) {
+ checkout([$class: 'SubversionSCM',
+ locations: [
+ [local: 'src/history/clang-6.0.1',
+ remote: 'http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_601/final'],
+ [local: 'src/history/clang-6.0.1/tools/clang',
+ remote: 'http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_601/final'],
+ [local: 'src/history/clang-6.0.1/projects/libcxx',
+ remote: 'http://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_601/final']],
+ quietOperation: false,
+ workspaceUpdater: [$class: 'UpdateUpdater']])
+ }
+ timeout(activity: true, time: 30) {
+ sh '''
+export HISTORIC_COMPILER=clang-6.0.1
+bash ${SCRIPT_PATH}/jobs/jobs/lldb-cmake-matrix-stage2
+'''
+ junit 'test-clang-6.0.1/results.xml'
+ }
+ }
+ }
+ }
+}
Added: zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage1.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage1.sh?rev=351897&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage1.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage1.sh Tue Jan 22 15:50:33 2019
@@ -0,0 +1,97 @@
+set -eux
+
+# Avoid the python in /usr/local/bin.
+PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/jbin
+
+if [ -z "WORKSPACE" ]; then
+ echo "WORKSPACE is not set."
+ exit 1
+fi
+
+SRC="$WORKSPACE"
+BUILD="$WORKSPACE/lldb-build"
+TEST="$WORKSPACE/test"
+RESULTS="$WORKSPACE/results"
+DEST="$RESULTS/lldb"
+
+LLVM_SRC="$SRC/llvm"
+LLDB_SRC="$SRC/llvm/tools/lldb"
+TESTCASES_DIR="$LLDB_SRC/test/testcases"
+LOGS_DIR="$TEST/logs"
+RESULTS_FILE="$TEST/results.xml"
+
+CC="$WORKSPACE/host-compiler/bin/clang"
+CXX="$WORKSPACE/host-compiler/bin/clang++"
+
+TOOLS="clang lldb"
+PROJECTS=""
+
+
+echo "@@@ Clean @@@"
+
+CLEAN_DIRS="$TEST $DEST $LOGS_DIR $RESULTS $BUILD/lldb-test-build.noindex"
+
+if [ "$CLEAN" = "true" ]; then
+ CLEAN_DIRS="$BUILD $CLEAN_DIRS"
+fi
+
+for dir in $CLEAN_DIRS; do
+ if [ -d $dir ]; then
+ rm -rf $dir
+ fi
+ mkdir -p $dir
+done
+
+MODULE_CACHE=$(xcrun clang -fmodules -x c - -o /dev/null '-###' 2>&1 | grep -Eo '\\-fmodules-cache-path=[^"]+' | cut -d'=' -f2)
+if [ -d $MODULE_CACHE ]; then
+ rm -rf $MODULE_CACHE
+fi
+rm -rf $BUILD/module.cache
+
+rm -f $WORKSPACE/*.tgz
+
+echo "@@@@@@"
+
+mkdir -p $BUILD
+cd $BUILD
+
+echo "@@@ Setup @@@"
+
+{ /usr/local/bin/lldbsign unlock; } 2>/dev/null
+
+echo "@@@@@@"
+
+set +x
+echo "@@@ Environment @@@"
+env | sort
+echo "@@@@@@"
+set -eux
+
+python $SCRIPT_PATH/build.py derive-lldb-cmake
+
+echo "@@@ CMake @@@"
+cmake $LLVM_SRC \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_ASSERTIONS=On \
+ -DLLVM_ENABLE_MODULES=On \
+ -DLLVM_VERSION_PATCH=99 \
+ -DLLVM_TARGETS_TO_BUILD='X86' \
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
+ -DCMAKE_INSTALL_PREFIX="$DEST" \
+ -DLLDB_BUILD_FRAMEWORK=On \
+ -G Ninja
+echo "@@@@@@"
+
+echo "@@@ Compile @@@"
+ninja
+
+#python $SCRIPT_PATH/build.py --assertions \
+# --cmake-type=Release \
+# --cmake-flag="-DLLVM_TARGETS_TO_BUILD=X86" \
+# lldb-cmake
+
+echo "@@@@@@"
+
+
+# Delete directories that would get deleted first thing by the next build anyway.
+rm -rf $BUILD/lldb-test-build.noindex $BUILD/module.cache
Added: zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage2.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage2.sh?rev=351897&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage2.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lldb-cmake-matrix-stage2.sh Tue Jan 22 15:50:33 2019
@@ -0,0 +1,142 @@
+set -eux
+
+# Avoid the python in /usr/local/bin.
+PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/jbin
+
+if [ -z "HISTORIC_COMPILER" ]; then
+ echo "HISTORIC_COMPILER is not set."
+ exit 1
+fi
+
+if [ -z "WORKSPACE" ]; then
+ echo "WORKSPACE is not set."
+ exit 1
+fi
+
+SRC="$WORKSPACE/src"
+BASE_BUILD="$WORKSPACE/lldb-build"
+BUILD="$WORKSPACE/lldb-build-${HISTORIC_COMPILER}"
+TEST="$WORKSPACE/test-${HISTORIC_COMPILER}"
+RESULTS="$WORKSPACE/results-${HISTORIC_COMPILER}"
+DEST="$RESULTS/lldb"
+
+LLVM_SRC="$SRC/llvm"
+LLDB_SRC="$SRC/llvm/tools/lldb"
+TESTCASES_DIR="$LLDB_SRC/test/testcases"
+LOGS_DIR="$TEST/logs"
+RESULTS_FILE="$TEST/results.xml"
+
+CC="$WORKSPACE/host-compiler/bin/clang"
+CXX="$WORKSPACE/host-compiler/bin/clang++"
+
+TOOLS="clang lldb"
+PROJECTS=""
+
+
+echo "@@@ Clean @@@"
+
+CLEAN_DIRS="$TEST $LOGS_DIR $RESULTS $BUILD/lldb-test-build.noindex"
+
+if [ "$CLEAN" = "true" ]; then
+ CLEAN_DIRS="$BUILD $CLEAN_DIRS"
+fi
+
+for dir in $CLEAN_DIRS; do
+ if [ -d $dir ]; then
+ rm -rf $dir
+ fi
+ mkdir -p $dir
+done
+
+MODULE_CACHE=$(xcrun clang -fmodules -x c - -o /dev/null '-###' 2>&1 | grep -Eo '\\-fmodules-cache-path=[^"]+' | cut -d'=' -f2)
+if [ -d $MODULE_CACHE ]; then
+ rm -rf $MODULE_CACHE
+fi
+rm -rf $BUILD/module.cache
+
+rm -f $WORKSPACE/*.tgz
+
+echo "@@@@@@"
+
+mkdir -p $BUILD
+cd $BUILD
+
+echo "@@@ Setup @@@"
+
+{ /usr/local/bin/lldbsign unlock; } 2>/dev/null
+
+echo "@@@@@@"
+
+echo "@@@ Building historical clangs @@@"
+function build_clang() {
+ CLANG_NAME=$1
+ mkdir -p history/$CLANG_NAME
+ cd history/$CLANG_NAME
+ SVN=/Applications/Xcode.bak/Contents/Developer/usr/bin/svn
+ $SVN upgrade $SRC/history/$CLANG_NAME
+ $SVN upgrade $SRC/history/$CLANG_NAME/tools/clang
+ $SVN upgrade $SRC/history/$CLANG_NAME/projects/libcxx
+ cmake $SRC/history/$CLANG_NAME \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_ASSERTIONS=Off \
+ -DLLVM_ENABLE_MODULES=On \
+ -DLLVM_TARGETS_TO_BUILD='X86' \
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
+ -DCMAKE_INSTALL_PREFIX="$RESULTS/history/$CLANG_NAME" \
+ -G Ninja
+ ninja
+ cd ../..
+}
+
+build_clang $HISTORIC_COMPILER
+HISTORIC_CLANG=${BUILD}/history/${HISTORIC_COMPILER}/bin/clang
+
+echo "@@@@@@"
+
+set +x
+echo "@@@ Environment @@@"
+env | sort
+echo "@@@@@@"
+set -eux
+
+python $SCRIPT_PATH/build.py derive-lldb-cmake
+
+echo "@@@ CMake @@@"
+rsync -av --delete $BASE_BUILD/bin $BUILD/
+cmake $WORKSPACE/llvm \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_ASSERTIONS=On \
+ -DLLVM_ENABLE_MODULES=On \
+ -DLLVM_VERSION_PATCH=99 \
+ -DLLVM_TARGETS_TO_BUILD='X86' \
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
+ -DCMAKE_INSTALL_PREFIX="$DEST" \
+ -G Ninja \
+ -DLLDB_TEST_C_COMPILER="${HISTORIC_CLANG}" \
+ -DLLDB_TEST_CXX_COMPILER="${HISTORIC_CLANG}++" \
+ -DLLDB_TEST_USER_ARGS="--framework;$BASE_BUILD/bin/LLDB.framework;--executable;$BASE_BUILD/bin/lldb;--skip-category;gmodules;--arch=x86_64;--build-dir;$BUILD;--session-file-format;fm;-s=$LOGS_DIR;--env;TERM=vt100;" \
+ -DLLVM_LIT_ARGS="--xunit-xml-output=$RESULTS_FILE -v"
+
+echo "@@@@@@"
+
+
+echo "@@@ Running tests @@@"
+set +e
+# FIXME: The LIT tests don't pick the right compiler yet.
+python $BUILD/bin/llvm-lit --xunit-xml-output=$RESULTS_FILE \
+ -v $WORKSPACE/llvm/tools/lldb/lit --filter=lldb-Suite
+EXIT_STATUS=$?
+set -e
+echo "@@@@@@"
+
+
+echo "@@@ Archiving Test Logs @@@"
+tar zcf "$RESULTS/test_logs.tgz" -C "${LOGS_DIR}" .
+
+if [ $EXIT_STATUS -ne 0 ]; then
+ echo "CHECK-LLDB Failed!\n"
+ exit 1
+fi
+
+# Delete directories that would get deleted first thing by the next build anyway.
+rm -rf $BUILD/lldb-test-build.noindex $BUILD/module.cache
More information about the llvm-commits
mailing list