about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDan Liew <delcypher@gmail.com>2014-09-15 00:42:56 +0100
committerDan Liew <delcypher@gmail.com>2014-09-15 00:42:56 +0100
commit524ea8027e4b5c8c72fa812d06ad8c12e77c33c2 (patch)
treece06e655b1cb12371899fdc9dbddf27b25f015b7
parentb18284f3354ff94051162478d20204ac40ed215d (diff)
parent2cefd431ec3371e3232a370632a4bef0569c7cd9 (diff)
downloadklee-524ea8027e4b5c8c72fa812d06ad8c12e77c33c2.tar.gz
Merge pull request #154 from delcypher/travis_script_fixes
Travis clean ups
-rw-r--r--.travis.yml42
-rwxr-xr-x.travis/install-llvm-and-runtime-compiler.sh13
-rwxr-xr-x.travis/klee.sh13
-rwxr-xr-x.travis/stp.sh17
4 files changed, 59 insertions, 26 deletions
diff --git a/.travis.yml b/.travis.yml
index 2675e3a8..0a1b4269 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,8 +6,9 @@ env:
     ###########################################################################
     # Configurations
     #
-    # Each line in the "env" section represents a set of environmental variables
-    # pass to a build. Thus each line represents a different build
+    # Each line in the "env" section represents a set of environment variables
+    # passed to a build. Thus each line represents a different build
+    # configuration.
     ###########################################################################
 
     # Check the matrix of:
@@ -17,8 +18,8 @@ env:
     # with Asserts enabled.
 
     # FIXME: Enable when we want to test LLVM3.5
-    #- LLVM_VERSION=3.5 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=1 ENABLE_OPTIMIZED=1
-    #- LLVM_VERSION=3.5 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=1 ENABLE_OPTIMIZED=1
+    #- LLVM_VERSION=3.5 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
+    #- LLVM_VERSION=3.5 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
     - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
     - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
     - LLVM_VERSION=2.9 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
@@ -34,40 +35,51 @@ env:
     # FIXME: Do Debug+Asserts builds
 cache: apt
 before_install:
-    # Assume Travis image uses Ubuntu 12.04 LTS
+    ###########################################################################
+    # Set up the locations to get various packages from
+    # We assume the Travis image uses Ubuntu 12.04 LTS
+    ###########################################################################
     - sudo sh -c 'echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.4 main" >> /etc/apt/sources.list.d/llvm.list'
     - sudo sh -c 'echo "deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise-3.4 main" >> /etc/apt/sources.list.d/llvm.list'
     - sudo sh -c 'echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main" >> /etc/apt/sources.list.d/llvm.list'
     - sudo sh -c 'echo "deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main" >> /etc/apt/sources.list.d/llvm.list'
+    # Needed for CMake
     - sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa
+    # Needed for new libstdc++ and gcc4.8
     - sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test/
     - wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
-    # Needed for new libstdc++ and gcc4.8
     - sudo apt-get update
+    ###########################################################################
+    # Set up out of source build directory
+    ###########################################################################
+    - export KLEE_SRC=`pwd`
+    - cd ../
+    - mkdir build
+    - cd build/
+    - export BUILD_DIR=`pwd`
+    ###########################################################################
+    # Install stuff
+    ###########################################################################
     # FIXME: STP doesn't need everything from Boost!
     - sudo apt-get install gcc-4.8 g++-4.8 libcap-dev cmake libboost-all-dev
     # Make gcc4.8 the default gcc version
     - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
     - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
-    - sudo apt-get install llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev clang-3.4
-    # Make Clang3.4 the default clang version (for building KLEE)
+    # Make Clang3.4 the default clang version
+    - sudo apt-get install clang-3.4
     - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.4 20
     - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.4 20
+    # Install LLVM and the LLVM bitcode compiler we require to build KLEE
+    - ${KLEE_SRC}/.travis/install-llvm-and-runtime-compiler.sh
     # Install lit (llvm-lit is not available)
     - sudo pip install lit
-    # Setup out of source build
-    - export KLEE_SRC=`pwd`
-    - cd ../
-    - mkdir build
-    - cd build/
-    - export BUILD_DIR=`pwd`
     # Build STP
     - mkdir stp
     - cd stp
     - ${KLEE_SRC}/.travis/stp.sh
     - cd ../
 script:
-    # Get need utlities/libraries for testing KLEE
+    # Get needed utlities/libraries for testing KLEE
     - mkdir test-utils/
     - cd test-utils/
     - ${KLEE_SRC}/.travis/testing-utils.sh
diff --git a/.travis/install-llvm-and-runtime-compiler.sh b/.travis/install-llvm-and-runtime-compiler.sh
new file mode 100755
index 00000000..e1a17f6b
--- /dev/null
+++ b/.travis/install-llvm-and-runtime-compiler.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -ev
+
+sudo apt-get install llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev
+
+if [ "${LLVM_VERSION}" != "2.9" ]; then
+    sudo apt-get install llvm-${LLVM_VERSION}-tools clang-${LLVM_VERSION}
+else
+    # Get llvm-gcc. We don't bother installing it
+    wget http://llvm.org/releases/2.9/llvm-gcc4.2-2.9-x86_64-linux.tar.bz2
+    tar -xjf llvm-gcc4.2-2.9-x86_64-linux.tar.bz2
+    mv llvm-gcc4.2-2.9-x86_64-linux llvm-gcc
+fi
diff --git a/.travis/klee.sh b/.travis/klee.sh
index 266f8fce..faf3f5f5 100755
--- a/.travis/klee.sh
+++ b/.travis/klee.sh
@@ -2,9 +2,6 @@
 # Make sure we exit if there is a failure
 set -e
 
-# Travis doesn't seem to like this in the yaml file so put it here instead
-[ "${LLVM_VERSION}" != "2.9" ] && sudo apt-get install llvm-${LLVM_VERSION}-tools clang-${LLVM_VERSION}
-
 # Calculate LLVM branch name to retrieve missing files from
 SVN_BRANCH="release_$( echo ${LLVM_VERSION} | sed 's/\.//g')"
 
@@ -15,11 +12,9 @@ if [ "${LLVM_VERSION}" != "2.9" ]; then
     KLEE_CC=/usr/bin/clang-${LLVM_VERSION}
     KLEE_CXX=/usr/bin/clang++-${LLVM_VERSION}
 else
-    # Just use pre-built llvm-gcc.
-    wget http://llvm.org/releases/2.9/llvm-gcc4.2-2.9-x86_64-linux.tar.bz2 || exit
-    tar -xjf llvm-gcc4.2-2.9-x86_64-linux.tar.bz2
-    KLEE_CC=$(pwd)/llvm-gcc4.2-2.9-x86_64-linux/bin/llvm-gcc
-    KLEE_CXX=$(pwd)/llvm-gcc4.2-2.9-x86_64-linux/bin/llvm-g++
+    # Just use pre-built llvm-gcc downloaded earlier
+    KLEE_CC=${BUILD_DIR}/llvm-gcc/bin/llvm-gcc
+    KLEE_CXX=${BUILD_DIR}/llvm-gcc/bin/llvm-g++
     export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
     export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
 
@@ -67,6 +62,7 @@ ${KLEE_SRC}/configure --with-llvmsrc=/usr/lib/llvm-${LLVM_VERSION}/build \
 ###############################################################################
 # Testing
 ###############################################################################
+set +e # We want to let all the tests run before we exit
 
 ###############################################################################
 # Unit tests
@@ -77,7 +73,6 @@ svn export  http://llvm.org/svn/llvm-project/llvm/branches/${SVN_BRANCH}/unittes
     ../Makefile.unittest
 sudo mv ../Makefile.unittest /usr/lib/llvm-${LLVM_VERSION}/build/unittests/
 
-
 make unittests \
     DISABLE_ASSERTIONS=${DISABLE_ASSERTIONS} \
     ENABLE_OPTIMIZED=${ENABLE_OPTIMIZED} \
diff --git a/.travis/stp.sh b/.travis/stp.sh
index 94bbab4d..abc4e566 100755
--- a/.travis/stp.sh
+++ b/.travis/stp.sh
@@ -3,6 +3,8 @@
 # Make sure we exit if there is a failure
 set -e
 
+STP_LOG="$(pwd)/stp-build.log"
+
 if [ "${STP_VERSION}" == "UPSTREAM" ]; then
     git clone --depth 1 git://github.com/stp/stp.git src
     mkdir build
@@ -10,7 +12,10 @@ if [ "${STP_VERSION}" == "UPSTREAM" ]; then
     # Disabling building of shared libs is a workaround
     cmake -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_PYTHON_INTERFACE:BOOL=OFF ../src
     # Don't try to build stp executable, there's an issue with using gcc4.8 with boost libraries built with gcc4.6
-    make libstp CopyPublicHeaders
+
+    set +e # Do not exit if build fails because we need to display the log
+    make libstp CopyPublicHeaders >> "${STP_LOG}" 2>&1
+
 elif [ "${STP_VERSION}" == "r940" ]; then
     # Building the old "r940" version that for some reason we love so much!
     git clone git://github.com/stp/stp.git src_build
@@ -33,8 +38,16 @@ elif [ "${STP_VERSION}" == "r940" ]; then
     export CXX=g++
     ./scripts/configure --with-prefix=${BUILD_DIR}/stp/build --with-cryptominisat2
     echo "WARNING FORCING GCC TO BE USED TO COMPILE STP"
-    make OPTIMIZE=-O2 CFLAGS_M32=    install
+
+    set +e # Do not exit if build fails because we need to display the log
+    make OPTIMIZE=-O2 CFLAGS_M32=    install >> "${STP_LOG}" 2>&1
 else
     echo "Unsupported STP_VERSION"
     exit 1
 fi
+
+# Only show build output if something went wrong to keep log output short
+if [ $? -ne 0 ]; then
+    echo "Build error"
+    cat "${STP_LOG}"
+fi