You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2019/09/09 07:32:10 UTC

[mesos] branch master updated (927b012 -> e0f7e2d)

This is an automated email from the ASF dual-hosted git repository.

bbannier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from 927b012  Replaced removeOffer + recoverResources pairs with specialized helpers.
     new 3ee0c3b  Added a `dist` target to the cmake build.
     new e0f7e2d  Added a `distcheck` target to the cmake build.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CMakeLists.txt     | 32 +++++++-------------------------
 cmake/dist.sh      | 37 +++++++++++++++++++++++++++++++++++++
 cmake/distcheck.sh | 31 +++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+), 25 deletions(-)
 create mode 100755 cmake/dist.sh
 create mode 100755 cmake/distcheck.sh


[mesos] 02/02: Added a `distcheck` target to the cmake build.

Posted by bb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit e0f7e2d702bb15fb402fce36b10e660b5d355c8d
Author: Benjamin Bannier <bb...@apache.org>
AuthorDate: Mon Sep 9 09:19:54 2019 +0200

    Added a `distcheck` target to the cmake build.
    
    This patch adds a `distcheck` target to the cmake build which mimics the
    target of the same name provided by the autotools build. `distcheck`
    depends on the `dist` target to create a distribution archive and then
    ensures that with the distributed sources the `check` targets succeeds.
    
    Review: https://reviews.apache.org/r/71241/
---
 CMakeLists.txt     |  4 ++++
 cmake/distcheck.sh | 31 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 319ce99..a1ca5c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,3 +98,7 @@ include(CPack)
 
 add_custom_target(dist
   COMMAND ${CMAKE_SOURCE_DIR}/cmake/dist.sh ${MESOS_PACKAGE_VERSION})
+
+add_custom_target(distcheck
+  COMMAND ${CMAKE_SOURCE_DIR}/cmake/distcheck.sh ${MESOS_PACKAGE_VERSION}
+  DEPENDS dist)
diff --git a/cmake/distcheck.sh b/cmake/distcheck.sh
new file mode 100755
index 0000000..282c551
--- /dev/null
+++ b/cmake/distcheck.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+ORIGIN=${PWD}
+
+VERSION=$1
+if [ -z "${VERSION}" ]; then
+  echo "Specify a version number as first argument"
+  exit 1
+fi
+
+WORKDIR=$(mktemp -d)
+trap 'rm -rf ${WORKDIR}' EXIT
+
+pushd "${WORKDIR}" || exit 1
+
+tar xf "${ORIGIN}"/mesos-"${VERSION}".tar.gz
+pushd mesos-"${VERSION}"
+mkdir build
+pushd  build
+
+# TODO(bbannier): Also check `install` target once the CMake build supports it.
+cmake .. ${DISTCHECK_CMAKE_FLAGS}
+cmake --build . --target check -j "$(nproc)"
+
+popd
+popd
+
+popd


[mesos] 01/02: Added a `dist` target to the cmake build.

Posted by bb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 3ee0c3b8094e746111af7ba3b883717d95c3efcf
Author: Benjamin Bannier <bb...@apache.org>
AuthorDate: Mon Sep 9 09:19:51 2019 +0200

    Added a `dist` target to the cmake build.
    
    This patch adds a `dist` target to the cmake build, analogous to the
    target provided by the autotools build.
    
    While cmake already provides a `package_source` target to create a
    source archive it does not take care of only including relevant files,
    but instead adds all files to the archive, e.g., including build or
    backup files which should not be part of a release. For that reason this
    patch introduces a script which performs a temporary `git clone` from
    the checked out git repository and creates the archive from that clean
    tree.
    
    This patch also removes a hardcoded list of ignored files which was
    by design not exhaustive.
    
    Review: https://reviews.apache.org/r/71240/
---
 CMakeLists.txt | 28 +++-------------------------
 cmake/dist.sh  | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc50dd4..319ce99 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,31 +67,6 @@ endif ()
 
 # PACKAGING.
 ############
-# List of sources we will ignore when generating a source package.
-# We assume there are no artifacts from an autotools build.
-#
-# NOTE: An in-source build is not supported. The build directory
-# must be different than the source directory.
-set(CPACK_SOURCE_IGNORE_FILES
-  .clang-format;
-  .gitignore;
-  .reviewboardrc;
-  bootstrap.bat;
-  bootstrap;
-  configure.ac;
-  Doxyfile;
-  mesos.pc.in;
-  /.git/;
-  /docs/;
-  /m4/;
-  /mpi/;
-  /site/;
-  /support/;
-  ${CMAKE_BINARY_DIR};)
-
-# Convert the ignore list to a string (as required by CPack).
-set(CPACK_SOURCE_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
-
 # Set the basename of any packages to 'mesos-<version>'.
 set(CPACK_PACKAGE_FILE_NAME "mesos-${MESOS_PACKAGE_VERSION}")
 set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
@@ -120,3 +95,6 @@ option(CPACK_SOURCE_TZ   "Enable to build TZ source packages"   OFF)
 option(CPACK_SOURCE_ZIP  "Enable to build ZIP source packages"  OFF)
 
 include(CPack)
+
+add_custom_target(dist
+  COMMAND ${CMAKE_SOURCE_DIR}/cmake/dist.sh ${MESOS_PACKAGE_VERSION})
diff --git a/cmake/dist.sh b/cmake/dist.sh
new file mode 100755
index 0000000..65dc04c
--- /dev/null
+++ b/cmake/dist.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+# Check for unstaged or uncommitted changes.
+if ! $(git diff-index --quiet HEAD --); then
+  echo 'Please commit or stash any changes before running `dist`.'
+  exit 1
+fi
+
+VERSION=$1
+if [ -z "${VERSION}" ]; then
+  echo "Specify a version number as first argument"
+  exit 1
+fi
+
+ORIGIN=$PWD
+MESOS_DIR=$(git rev-parse --show-toplevel)
+
+WORKDIR=$(mktemp -d)
+trap 'rm -rf ${WORKDIR}' EXIT
+
+pushd "${WORKDIR}" || exit 1
+
+git clone "${MESOS_DIR}"
+mkdir build
+pushd build
+
+cmake ../$(basename "${MESOS_DIR}")
+cmake --build . --target package_source -j "$(nproc)"
+cp mesos-"${VERSION}".tar.gz "${ORIGIN}"
+
+popd
+popd
+
+echo "Successfully created ${ORIGIN}/mesos-${VERSION}.tar.gz"