From 58c5132f82112d2ceef3b676e0bd04f04c940b69 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Thu, 30 Mar 2017 14:24:08 +0100 Subject: [Docker] Unbreak build. The recent landing of macOS support in TravisCI (3a8bc6a43073b98b58c8cf0c20a930cb2c953b5d) broke the Docker build due to the `TRAVIS_OS_NAME` environment variable not being set by the Docker build. Do the simplest fix for now which is to define the variable. This isn't the cleanest fix but it will do for now. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d42b09c8..11174e6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,8 @@ ENV LLVM_VERSION=3.4 \ BUILD_DIR=/home/klee/klee_build \ USE_CMAKE=1 \ ASAN_BUILD=0 \ - UBSAN_BUILD=0 + UBSAN_BUILD=0 \ + TRAVIS_OS_NAME=linux RUN apt-get update && \ apt-get -y --no-install-recommends install \ -- cgit 1.4.1 From 31d7fa412c673d2e2b0f9fe2abf32afa1b105d5e Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Thu, 30 Mar 2017 14:49:16 +0100 Subject: [TravisCI] Make handling of `TRAVIS_OS_NAME` more robust by not assuming that its value not being `linux` implies `osx`. --- .travis/install-llvm-and-runtime-compiler.sh | 5 ++++- .travis/install-tcmalloc.sh | 5 ++++- .travis/klee.sh | 10 ++++++++-- .travis/stp.sh | 5 ++++- .travis/testing-utils.sh | 5 ++++- .travis/z3.sh | 5 ++++- 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.travis/install-llvm-and-runtime-compiler.sh b/.travis/install-llvm-and-runtime-compiler.sh index de6f9bbd..8e8e9863 100755 --- a/.travis/install-llvm-and-runtime-compiler.sh +++ b/.travis/install-llvm-and-runtime-compiler.sh @@ -29,7 +29,7 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then llvm-gcc/bin/llvm-gcc test.c -o hello_world ./hello_world fi -else # OSX +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then # NOTE: We should not easily generalize, since we need the corresponding support of bottled formulas if [ "${LLVM_VERSION}" == "3.4" ]; then brew install llvm34 @@ -37,4 +37,7 @@ else # OSX echo "Error: Requested to install LLVM ${LLVM_VERSION} on macOS, which is not supported" exit 1 fi +else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi diff --git a/.travis/install-tcmalloc.sh b/.travis/install-tcmalloc.sh index a0d825e1..0bc26616 100755 --- a/.travis/install-tcmalloc.sh +++ b/.travis/install-tcmalloc.sh @@ -11,9 +11,12 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make sudo make install fi -else # OSX +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then if [ ${USE_TCMALLOC:-0} -eq 1 ] ; then echo "Error: Requested to install TCMalloc on macOS, which is not supported" exit 1 fi +else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi diff --git a/.travis/klee.sh b/.travis/klee.sh index a2efc70d..5ee631fa 100755 --- a/.travis/klee.sh +++ b/.travis/klee.sh @@ -13,9 +13,12 @@ if [ "${LLVM_VERSION}" != "2.9" ]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then KLEE_CC=/usr/bin/clang-${LLVM_VERSION} KLEE_CXX=/usr/bin/clang++-${LLVM_VERSION} - else # OSX + elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then KLEE_CC=/usr/local/bin/clang-${LLVM_VERSION} KLEE_CXX=/usr/local/bin/clang++-${LLVM_VERSION} + else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi else # Just use pre-built llvm-gcc downloaded earlier @@ -127,9 +130,12 @@ source ${KLEE_SRC}/.travis/sanitizer_flags.sh if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then LLVM_CONFIG="/usr/lib/llvm-${LLVM_VERSION}/bin/llvm-config" LLVM_BUILD_DIR="/usr/lib/llvm-${LLVM_VERSION}/build" -else # OSX +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then LLVM_CONFIG="/usr/local/bin/llvm-config-${LLVM_VERSION}" LLVM_BUILD_DIR="$(${LLVM_CONFIG} --src-root)" +else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi ############################################################################### diff --git a/.travis/stp.sh b/.travis/stp.sh index 412f7613..0112ae31 100755 --- a/.travis/stp.sh +++ b/.travis/stp.sh @@ -21,10 +21,13 @@ if [ "x${STP_VERSION}" != "x" ]; then CFLAGS="${SANITIZER_C_FLAGS}" \ CXXFLAGS="${SANITIZER_CXX_FLAGS}" \ cmake -DCMAKE_INSTALL_PREFIX=/usr .. - else # OSX + elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then CFLAGS="${SANITIZER_C_FLAGS}" \ CXXFLAGS="${SANITIZER_CXX_FLAGS}" \ cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. + else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi make sudo make install diff --git a/.travis/testing-utils.sh b/.travis/testing-utils.sh index 29295be2..153a5546 100755 --- a/.travis/testing-utils.sh +++ b/.travis/testing-utils.sh @@ -21,9 +21,12 @@ if [ "${LLVM_VERSION}" != "2.9" ]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo cp lib* /usr/lib/ sudo cp -r include/gtest /usr/include - else # OSX + elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then sudo cp lib* /usr/local/lib/ sudo cp -r include/gtest /usr/local/include + else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi else # LLVM2.9 on the other hand is a pain diff --git a/.travis/z3.sh b/.travis/z3.sh index f8ae6e0b..a4c00f82 100755 --- a/.travis/z3.sh +++ b/.travis/z3.sh @@ -12,6 +12,9 @@ fi if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then # Should we install libz3-dbg too? sudo apt-get -y install libz3 libz3-dev -else # OSX +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then brew install z3 +else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi -- cgit 1.4.1