From d18385d5a42c11168de26c1f86b92ab3cd6e1555 Mon Sep 17 00:00:00 2001 From: Bryan Date: Tue, 10 Nov 2015 14:58:59 -0800 Subject: [PATCH 1/3] Change CI Build to only build packages inside of docker --- scripts/ci_build.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index f24b49833..c3dd44455 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -33,8 +33,14 @@ if [[ "$(uname)" == "Linux" ]]; then [ ! -z "$BUILD_BUILDID" ] && container_name="$BUILD_BUILDID" export DOTNET_BUILD_CONTAINER_NAME="$container_name" - - $SCRIPT_DIR/dockerbuild.sh debian $@ + + # Build Binaries outside of Docker + $SCRIPT_DIR/bootstrap.sh $@ + + # Change Docker Build command to packaging only + export BUILD_COMMAND="/opt/code/scripts/package.sh" + $SCRIPT_DIR/dockerbuild.sh + else $SCRIPT_DIR/../build.sh $@ fi From 32e7a71a49a2721092648d32b64283b14cfaed8a Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Tue, 10 Nov 2015 15:48:16 -0800 Subject: [PATCH 2/3] Set up the CXX environment variables for Cmake to find the right compiler. --- scripts/bootstrap.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 5a2655b91..8536342ca 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -49,6 +49,26 @@ dotnet restore "$REPOROOT" --quiet --runtime "osx.10.10-x64" --runtime "ubuntu.1 [ -d "$STAGE1_DIR" ] && rm -Rf "$STAGE1_DIR" banner "Building corehost" + +# Set up the environment to be used for building with clang. +if which "clang-3.5" > /dev/null 2>&1 + then + export CC="$(which clang-3.5)" + export CXX="$(which clang++-3.5)" +elif which "clang-3.6" > /dev/null 2>&1 + then + export CC="$(which clang-3.6)" + export CXX="$(which clang++-3.6)" +elif which clang > /dev/null 2>&1 + then + export CC="$(which clang)" + export CXX="$(which clang++)" +else + error "Unable to find Clang Compiler" + error "Install clang-3.5 or clang3.6" + exit 1 +fi + pushd "$REPOROOT/src/corehost" 2>&1 >/dev/null [ -d "cmake/$RID" ] || mkdir -p "cmake/$RID" cd "cmake/$RID" From cdf8b9049445b0ded0c9506c3d031677aed481f5 Mon Sep 17 00:00:00 2001 From: Bryan Date: Tue, 10 Nov 2015 16:18:00 -0800 Subject: [PATCH 3/3] Refactor docker entrypoint to reduce potential for out of sync build and ci_build scripts --- build.sh | 15 +++++++++++++-- scripts/ci_build.sh | 9 ++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 016e47399..9dee26a19 100755 --- a/build.sh +++ b/build.sh @@ -22,5 +22,16 @@ fi echo Building dotnet tools verison - $DOTNET_BUILD_VERSION -$DIR/scripts/bootstrap.sh -$DIR/scripts/package.sh +if [ ! -z "$BUILD_IN_DOCKER" ]; then + export BUILD_COMMAND="/opt/code/scripts/bootstrap.sh" + $DIR/scripts/dockerbuild.sh +else + $DIR/scripts/bootstrap.sh +fi + +if [ ! -z "$PACKAGE_IN_DOCKER" ]; then + export BUILD_COMMAND="/opt/code/scripts/package.sh" + $DIR/scripts/dockerbuild.sh +else + $DIR/scripts/package.sh +fi \ No newline at end of file diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index c3dd44455..9a5a24d2f 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -33,14 +33,9 @@ if [[ "$(uname)" == "Linux" ]]; then [ ! -z "$BUILD_BUILDID" ] && container_name="$BUILD_BUILDID" export DOTNET_BUILD_CONTAINER_NAME="$container_name" + export PACKAGE_IN_DOCKER="true" - # Build Binaries outside of Docker - $SCRIPT_DIR/bootstrap.sh $@ - - # Change Docker Build command to packaging only - export BUILD_COMMAND="/opt/code/scripts/package.sh" - $SCRIPT_DIR/dockerbuild.sh - + $SCRIPT_DIR/../build.sh $@ else $SCRIPT_DIR/../build.sh $@ fi