You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2017/01/17 22:27:34 UTC
[2/2] mesos git commit: Used CMake to generate the compilation
database instead.
Used CMake to generate the compilation database instead.
Review: https://reviews.apache.org/r/55489/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3c40db69
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3c40db69
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3c40db69
Branch: refs/heads/master
Commit: 3c40db69a1de8a7ff42b1a7abfb0414d1eb988ca
Parents: 9f3e11d
Author: Michael Park <mp...@apache.org>
Authored: Tue Jan 17 14:27:09 2017 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Tue Jan 17 14:27:09 2017 -0800
----------------------------------------------------------------------
support/mesos-tidy.sh | 29 +++++++++++++-------------
support/mesos-tidy/Dockerfile | 16 --------------
support/mesos-tidy/entrypoint.sh | 39 +++++++++++++++++++++++++++++------
3 files changed, 47 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3c40db69/support/mesos-tidy.sh
----------------------------------------------------------------------
diff --git a/support/mesos-tidy.sh b/support/mesos-tidy.sh
index 98ea385..96d3ecb 100755
--- a/support/mesos-tidy.sh
+++ b/support/mesos-tidy.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -16,22 +16,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-# Prepare clang-tidy docker image.
-TAG=mesos-tidy-`date +%s`-$RANDOM
-# TODO(vinod): Instead of building Docker images on the fly host the
-# images on DockerHub and use them.
-docker build --no-cache=true -t $TAG mesos-tidy/
+set -e
+set -o pipefail
# Configure how checks are run. These variables can be overridden by setting the
# respective environment variables before invoking this script.
# TODO(bbannier): Enable more upstream checks by default, e.g., from the Google set.
CHECKS=${CHECKS:-'-*,mesos-*'}
-# By default perform an optimized build since it appears to finish
-# slightly faster. Note that this has no effect on the static analysis.
-CONFIGURE_FLAGS=${CONFIGURE_FLAGS:-'--enable-optimize'}
-
MESOS_DIRECTORY=$(cd "$(dirname "$0")/.." && pwd)
# Check for unstaged or uncommitted changes.
@@ -40,13 +32,20 @@ if ! $(git diff-index --quiet HEAD --); then
exit 1
fi
+# Prepare clang-tidy docker image.
+TAG=mesos-tidy-`date +%s`-$RANDOM
+
+# TODO(vinod): Instead of building Docker images on the fly host the
+# images on DockerHub and use them.
+docker build --no-cache=true -t $TAG mesos-tidy/
+
+# Set a trap to delete the image on exit.
+trap "docker rmi $TAG" EXIT
+
# Execute the container.
docker run \
--rm \
-v "${MESOS_DIRECTORY}":/SRC \
-e CHECKS="${CHECKS}" \
-e CONFIGURE_FLAGS="${CONFIGURE_FLAGS}" \
- $TAG || exit 1
-
-# Set a trap to delete the image on exit.
-trap "docker rmi $TAG" EXIT
+ $TAG
http://git-wip-us.apache.org/repos/asf/mesos/blob/3c40db69/support/mesos-tidy/Dockerfile
----------------------------------------------------------------------
diff --git a/support/mesos-tidy/Dockerfile b/support/mesos-tidy/Dockerfile
index 86b6062..8d8c476 100644
--- a/support/mesos-tidy/Dockerfile
+++ b/support/mesos-tidy/Dockerfile
@@ -42,22 +42,6 @@ RUN \
rm -rf /tmp/llvm && \
rm -rf /tmp/build
-# Install Bear.
-RUN apt-get install -qy \
- curl && \
- apt-get clean
-
-RUN \
- curl -k -O https://codeload.github.com/rizsotto/Bear/tar.gz/2.2.0 && \
- tar xzf 2.2.0 && \
- rm 2.2.0 && \
- cd Bear-2.2.0/ && \
- cmake . -DCMAKE_INSTALL_PREFIX=/opt && \
- make -j $(nproc) install && \
- \
- cd / && \
- rm -rf Bear-2.2.0
-
ENV PATH /opt/bin:$PATH
# Install Mesos dependencies
http://git-wip-us.apache.org/repos/asf/mesos/blob/3c40db69/support/mesos-tidy/entrypoint.sh
----------------------------------------------------------------------
diff --git a/support/mesos-tidy/entrypoint.sh b/support/mesos-tidy/entrypoint.sh
index 7287237..c1de199 100755
--- a/support/mesos-tidy/entrypoint.sh
+++ b/support/mesos-tidy/entrypoint.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -16,17 +16,44 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+set -e
+set -o pipefail
+
SRCDIR=/tmp/SRC
# Prepare sources
-git clone --depth 1 file:///SRC "${SRCDIR}" || exit 1
-(cd ${SRCDIR} && ./bootstrap) || exit 1
+git clone --depth 1 file:///SRC "${SRCDIR}"
+(cd "${SRCDIR}" && ./bootstrap)
# Configure sources
-${SRCDIR}/configure ${CONFIGURE_FLAGS} || exit 1
+cmake -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
+ ${CONFIGURE_FLAGS} \
+ "${SRCDIR}"
+
+# Build the external dependencies.
+# TODO(mpark): Use an external dependencies target once MESOS-6924 is resolved.
+cmake --build 3rdparty --target boost-1.53.0 -- -j $(nproc)
+cmake --build 3rdparty --target elfio-3.2 -- -j $(nproc)
+cmake --build 3rdparty --target glog-0.3.3 -- -j $(nproc)
+cmake --build 3rdparty --target gmock-1.7.0 -- -j $(nproc)
+cmake --build 3rdparty --target http_parser-2.6.2 -- -j $(nproc)
+
+# TODO(mpark): The `|| true` is a hack to try both `libev` and `libevent` and
+# use whichever one happens to be configured. This would also go
+# away with MESOS-6924.
+cmake --build 3rdparty --target libev-4.22 -- -j $(nproc) || true
+cmake --build 3rdparty --target libevent-2.1.5-beta -- -j $(nproc) || true
+
+cmake --build 3rdparty --target leveldb-1.4 -- -j $(nproc)
+cmake --build 3rdparty --target nvml-352.79 -- -j $(nproc)
+cmake --build 3rdparty --target picojson-1.3.0 -- -j $(nproc)
+cmake --build 3rdparty --target protobuf-2.6.1 -- -j $(nproc)
+cmake --build 3rdparty --target zookeeper-3.4.8 -- -j $(nproc)
-# Build sources
-bear make -j $(nproc) tests || exit 1
+# Generate the protobuf definitions.
+# TODO(mpark): Use a protobuf generation target once MESOS-6925 is resolved.
+cmake --build . --target mesos-protobufs -- -j $(nproc)
# TODO(bbannier): Use a less restrictive `grep` pattern and `header-filter`
# once MESOS-6115 is fixed.