You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2018/10/31 20:54:35 UTC

[mesos] branch master updated (3628e0b -> d455e2a)

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

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


    from 3628e0b  Fixed flaky `CgroupsIsolatorTest.ROOT_CGROUPS_CreateRecursively` test.
     new a73fcb2  Allowed for unbundled libarchive on cmake builds.
     new d455e2a  Added small style fix-ups for libevent unbundling on CMake builds.

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:
 3rdparty/CMakeLists.txt                            |  8 ++---
 .../{FindLIBEVENT.cmake => FindLIBARCHIVE.cmake}   | 37 +++++++++++-----------
 3rdparty/cmake/FindLIBEVENT.cmake                  |  9 ++++--
 cmake/CompilationConfigure.cmake                   | 23 ++++++++++----
 4 files changed, 46 insertions(+), 31 deletions(-)
 copy 3rdparty/cmake/{FindLIBEVENT.cmake => FindLIBARCHIVE.cmake} (53%)


[mesos] 02/02: Added small style fix-ups for libevent unbundling on CMake builds.

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

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

commit d455e2adf3f66267caf73a56ff0fad56bc009be1
Author: Till Toenshoff <to...@me.com>
AuthorDate: Wed Oct 31 12:45:52 2018 -0700

    Added small style fix-ups for libevent unbundling on CMake builds.
    
    Review: https://reviews.apache.org/r/69216/
---
 3rdparty/cmake/FindLIBEVENT.cmake |  9 +++++++--
 cmake/CompilationConfigure.cmake  | 12 +++++-------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/3rdparty/cmake/FindLIBEVENT.cmake b/3rdparty/cmake/FindLIBEVENT.cmake
index 5741ef0..13169fa 100644
--- a/3rdparty/cmake/FindLIBEVENT.cmake
+++ b/3rdparty/cmake/FindLIBEVENT.cmake
@@ -18,14 +18,19 @@ include(FindPackageHelper)
 
 # TODO(tillt): Consider moving "_ROOT_DIR" logic into FindPackageHelper.
 if ("${LIBEVENT_ROOT_DIR}" STREQUAL "")
+  # NOTE: If this fails, stderr is ignored, and the output variable is empty.
+  # This has no deleterious effect on our path search.
   execute_process(
     COMMAND brew --prefix libevent
     OUTPUT_VARIABLE LIBEVENT_PREFIX
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 
+  set(POSSIBLE_LIBEVENT_INCLUDE_DIRS "")
+  set(POSSIBLE_LIBEVENT_LIB_DIRS "")
+
   if (NOT "${LIBEVENT_PREFIX}" STREQUAL "")
-    set(POSSIBLE_LIBEVENT_INCLUDE_DIRS ${LIBEVENT_PREFIX}/include)
-    set(POSSIBLE_LIBEVENT_LIB_DIRS ${LIBEVENT_PREFIX}/lib)
+    list(APPEND POSSIBLE_LIBEVENT_INCLUDE_DIRS ${LIBEVENT_PREFIX}/include)
+    list(APPEND POSSIBLE_LIBEVENT_LIB_DIRS ${LIBEVENT_PREFIX}/lib)
   endif()
 
   list(
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index f6c6e62..2130c9b 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -96,13 +96,11 @@ if (ENABLE_LIBEVENT)
     "Build libprocess with an installed libevent version instead of the bundled."
     FALSE)
 
-  if (UNBUNDLED_LIBEVENT)
-    set(
-      LIBEVENT_ROOT_DIR
-      ""
-      CACHE STRING
-      "Specify the path to libevent, e.g. \"C:\\libevent-Win64\".")
-  endif()
+  set(
+    LIBEVENT_ROOT_DIR
+    ""
+    CACHE STRING
+    "Specify the path to libevent, e.g. \"C:\\libevent-Win64\".")
 endif()
 
 option(


[mesos] 01/02: Allowed for unbundled libarchive on cmake builds.

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

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

commit a73fcb2aca53596bb419c6c3dc8b73854d135442
Author: Till Toenshoff <to...@me.com>
AuthorDate: Wed Oct 31 12:45:47 2018 -0700

    Allowed for unbundled libarchive on cmake builds.
    
    Review: https://reviews.apache.org/r/69140/
---
 3rdparty/CMakeLists.txt             |  8 +++---
 3rdparty/cmake/FindLIBARCHIVE.cmake | 52 +++++++++++++++++++++++++++++++++++++
 cmake/CompilationConfigure.cmake    | 11 ++++++++
 3 files changed, 67 insertions(+), 4 deletions(-)

diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 9584f53..fb80b39 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -995,7 +995,7 @@ set_target_properties(
 # libarchive: Multi-format archive and compression library.
 # https://github.com/libarchive/libarchive
 ###########################################################
-if (WIN32 OR REBUNDLED)
+if (NOT UNBUNDLED_LIBARCHIVE)
   EXTERNAL(libarchive ${LIBARCHIVE_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
 
   add_library(libarchive STATIC IMPORTED GLOBAL)
@@ -1069,11 +1069,11 @@ if (WIN32 OR REBUNDLED)
     URL               ${LIBARCHIVE_URL}
     URL_HASH          ${LIBARCHIVE_HASH})
 else ()
-  find_package(LibArchive REQUIRED)
+  find_package(LIBARCHIVE REQUIRED)
   add_library(libarchive SHARED IMPORTED GLOBAL)
   set_target_properties(libarchive PROPERTIES
-    IMPORTED_LOCATION ${LibArchive_LIBRARIES}
-    INTERFACE_INCLUDE_DIRECTORIES ${LibArchive_INCLUDE_DIRS})
+    IMPORTED_LOCATION ${LIBARCHIVE_LIBS}
+    INTERFACE_INCLUDE_DIRECTORIES ${LIBARCHIVE_INCLUDE_DIR})
 endif ()
 
 # Google Test: Google's C++ test framework (GoogleTest and GoogleMock).
diff --git a/3rdparty/cmake/FindLIBARCHIVE.cmake b/3rdparty/cmake/FindLIBARCHIVE.cmake
new file mode 100644
index 0000000..f0c29d0
--- /dev/null
+++ b/3rdparty/cmake/FindLIBARCHIVE.cmake
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+include(FindPackageHelper)
+
+# TODO(tillt): Consider moving "_ROOT_DIR" logic into FindPackageHelper.
+if ("${LIBARCHIVE_ROOT_DIR}" STREQUAL "")
+  # NOTE: If this fails, stderr is ignored, and the output variable is empty.
+  # This has no deleterious effect on our path search.
+  execute_process(
+    COMMAND brew --prefix libarchive
+    OUTPUT_VARIABLE LIBARCHIVE_PREFIX
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+  set(POSSIBLE_LIBARCHIVE_INCLUDE_DIRS "")
+  set(POSSIBLE_LIBARCHIVE_LIB_DIRS "")
+
+  if (NOT "${LIBARCHIVE_PREFIX}" STREQUAL "")
+    list(APPEND POSSIBLE_LIBARCHIVE_INCLUDE_DIRS ${LIBARCHIVE_PREFIX}/include)
+    list(APPEND POSSIBLE_LIBARCHIVE_LIB_DIRS ${LIBARCHIVE_PREFIX}/lib)
+  endif()
+
+  list(
+    APPEND POSSIBLE_LIBARCHIVE_INCLUDE_DIRS
+    /usr/include/libarchive
+    /usr/local/include/libarchive)
+
+  list(
+    APPEND POSSIBLE_LIBARCHIVE_LIB_DIRS
+    /usr/lib
+    /usr/local/lib)
+else()
+  set(POSSIBLE_LIBARCHIVE_INCLUDE_DIRS ${LIBARCHIVE_ROOT_DIR}/include)
+  set(POSSIBLE_LIBARCHIVE_LIB_DIRS ${LIBARCHIVE_ROOT_DIR}/lib)
+endif()
+
+set(LIBARCHIVE_LIBRARY_NAMES archive)
+
+FIND_PACKAGE_HELPER(LIBARCHIVE archive.h)
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 5d2be0a..f6c6e62 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -75,6 +75,17 @@ option(
   TRUE)
 
 option(
+  UNBUNDLED_LIBARCHIVE
+  "Build with an installed libarchive version instead of the bundled."
+  FALSE)
+
+set(
+  LIBARCHIVE_ROOT_DIR
+  ""
+  CACHE STRING
+  "Specify the path to libarchive, e.g. \"C:\\libarchive-Win64\".")
+
+option(
   ENABLE_LIBEVENT
   "Use libevent instead of libev as the core event loop implementation."
   FALSE)