You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2018/03/19 20:20:39 UTC

[1/9] mesos git commit: CMake: Set C++11 as standard automatically.

Repository: mesos
Updated Branches:
  refs/heads/master a0053257e -> 3459072c8


CMake: Set C++11 as standard automatically.

Instead of setting the compiler option manually, we use the
`CMAKE_CXX_STANDARD` variable to set the default for all targets. This
automatically appends the correct flag for each compiler.

Review: https://reviews.apache.org/r/66007


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0c18ca17
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0c18ca17
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0c18ca17

Branch: refs/heads/master
Commit: 0c18ca1766e72bbabcd08fdc01f24ed817804d4e
Parents: a005325
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Mar 8 10:03:48 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:26:37 2018 -0700

----------------------------------------------------------------------
 cmake/CompilationConfigure.cmake | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0c18ca17/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index efee36c..9eab0d6 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -164,6 +164,13 @@ endif ()
 
 # SYSTEM CHECKS.
 ################
+
+# Set the default standard to C++11 for all targets.
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+# Do not use, for example, `-std=gnu++11`.
+set(CMAKE_CXX_EXTENSIONS OFF)
+
 # Check that we are targeting a 64-bit architecture.
 if (NOT (CMAKE_SIZEOF_VOID_P EQUAL 8))
   message(
@@ -178,12 +185,6 @@ if (NOT (CMAKE_SIZEOF_VOID_P EQUAL 8))
     "    `cmake -DCMAKE_OSX_ARCHITECTURES=x86_64`.\n")
 endif ()
 
-# Make sure C++ 11 features we need are supported.
-# This is split into two cases: Windows and "other platforms".
-#   * For "other platforms", we simply check if the C++11 flags work
-#   * For Windows, C++11 is enabled by default on MSVC 1900.
-#     We just check the MSVC version.
-CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
 if (WIN32)
   # Versions of Visual Studio older than 2017 do not support all core features
   # of C++14, which prevents Mesos from moving past C++11. This adds a
@@ -220,15 +221,6 @@ endif ()
 # POSIX CONFIGURATION.
 ######################
 if (NOT WIN32)
-  if (NOT COMPILER_SUPPORTS_CXX11)
-    message(
-      FATAL_ERROR
-      "The compiler ${CMAKE_CXX_COMPILER} does not support the `-std=c++11` "
-      "flag. Please use a different C++ compiler.")
-  endif ()
-
-  string(APPEND CMAKE_CXX_FLAGS " -std=c++11")
-
   # Warn about use of format functions that can produce security issues.
   string(APPEND CMAKE_CXX_FLAGS " -Wformat-security")
 


[6/9] mesos git commit: CMake: Split `CMAKE_FORWARD_ARGS` into `C` and `CXX` versions.

Posted by an...@apache.org.
CMake: Split `CMAKE_FORWARD_ARGS` into `C` and `CXX` versions.

By passing `CMAKE_C_FORWARD_ARGS` to C libraries, e.g. curl, libapr,
libevent, and zlib, we avoid CMake warning us about set but unused
variables (since they do not use the `CXX` variables).

Review: https://reviews.apache.org/r/66012


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5d1a2b18
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5d1a2b18
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5d1a2b18

Branch: refs/heads/master
Commit: 5d1a2b18d376a64125dff312e52098e52df5684e
Parents: 5915f8f
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Mar 9 12:36:47 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5d1a2b18/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 06f8aa0..7892e2f 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -112,13 +112,14 @@ if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")
 endif ()
 
 foreach (lang C CXX)
-  list(APPEND CMAKE_FORWARD_ARGS
+  list(APPEND CMAKE_${lang}_FORWARD_ARGS
+    ${CMAKE_FORWARD_ARGS}
     -DCMAKE_${lang}_COMPILER=${CMAKE_${lang}_COMPILER}
     -DCMAKE_${lang}_COMPILER_LAUNCHER=${CMAKE_${lang}_COMPILER_LAUNCHER}
     -DCMAKE_${lang}_FLAGS=${CMAKE_${lang}_FLAGS})
 
   foreach (config DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
-    list(APPEND CMAKE_FORWARD_ARGS
+    list(APPEND CMAKE_${lang}_FORWARD_ARGS
       -DCMAKE_${lang}_FLAGS_${config}=${CMAKE_${lang}_FLAGS_${config}})
   endforeach ()
 endforeach ()
@@ -368,7 +369,7 @@ ExternalProject_Add(
   PREFIX            ${GLOG_CMAKE_ROOT}
   BUILD_BYPRODUCTS  ${GLOG_BYPRODUCTS}
   PATCH_COMMAND     ${GLOG_PATCH_CMD}
-  CMAKE_ARGS        ${CMAKE_FORWARD_ARGS};-DBUILD_TESTING=OFF
+  CMAKE_ARGS        ${CMAKE_CXX_FORWARD_ARGS};-DBUILD_TESTING=OFF
   CONFIGURE_COMMAND ${GLOG_CONFIG_CMD}
   BUILD_COMMAND     ${GLOG_BUILD_CMD}
   INSTALL_COMMAND   ${GLOG_INSTALL_CMD}
@@ -469,7 +470,7 @@ ExternalProject_Add(
   PREFIX            ${HTTP_PARSER_CMAKE_ROOT}
   BUILD_BYPRODUCTS  ${HTTP_PARSER_BYPRODUCTS}
   PATCH_COMMAND     ${HTTP_PARSER_PATCH_CMD}
-  CMAKE_ARGS        ${CMAKE_FORWARD_ARGS}
+  CMAKE_ARGS        ${CMAKE_CXX_FORWARD_ARGS}
   INSTALL_COMMAND   ${CMAKE_NOOP}
   URL               ${HTTP_PARSER_URL}
   URL_HASH          ${HTTP_PARSER_HASH})
@@ -505,7 +506,7 @@ if (ENABLE_LIBEVENT)
   endif ()
 
   set(LIBEVENT_CMAKE_FORWARD_ARGS
-    ${CMAKE_FORWARD_ARGS}
+    ${CMAKE_C_FORWARD_ARGS}
     ${CMAKE_SSL_FORWARD_ARGS}
     # NOTE: Libevent does not respect the BUILD_SHARED_LIBS global flag.
     -DEVENT__BUILD_SHARED_LIBRARIES=${BUILD_SHARED_LIBS}
@@ -594,7 +595,7 @@ if (WIN32)
     ${LIBAPR_TARGET}
     PREFIX            ${LIBAPR_CMAKE_ROOT}
     BUILD_BYPRODUCTS  ${APR_BYPRODUCTS}
-    CMAKE_ARGS        ${CMAKE_FORWARD_ARGS}
+    CMAKE_ARGS        ${CMAKE_C_FORWARD_ARGS}
     INSTALL_COMMAND   ${CMAKE_NOOP}
     URL               ${LIBAPR_URL}
     URL_HASH          ${LIBAPR_HASH})
@@ -647,7 +648,7 @@ if (WIN32)
   add_executable(curl IMPORTED GLOBAL)
 
   set(CURL_CMAKE_FORWARD_ARGS
-    ${CMAKE_FORWARD_ARGS}
+    ${CMAKE_C_FORWARD_ARGS}
     -DCMAKE_USE_WINSSL=ON
     -DCURL_DISABLE_LDAP=ON
     -DBUILD_TESTING=OFF)
@@ -766,7 +767,7 @@ if (WIN32)
     ${ZLIB_TARGET}
     PREFIX            ${ZLIB_CMAKE_ROOT}
     BUILD_BYPRODUCTS  ${ZLIB_BYPRODUCTS}
-    CMAKE_ARGS        ${CMAKE_FORWARD_ARGS}
+    CMAKE_ARGS        ${CMAKE_C_FORWARD_ARGS}
     INSTALL_COMMAND   ${CMAKE_NOOP}
     URL               ${ZLIB_URL}
     URL_HASH          ${ZLIB_HASH})
@@ -807,7 +808,7 @@ set_target_properties(
   gtest PROPERTIES
   INTERFACE_INCLUDE_DIRECTORIES ${GOOGLETEST_ROOT}/googletest/include)
 
-set(GOOGLETEST_CMAKE_FORWARD_ARGS ${CMAKE_FORWARD_ARGS})
+set(GOOGLETEST_CMAKE_FORWARD_ARGS ${CMAKE_CXX_FORWARD_ARGS})
 
 if (WIN32)
   set_target_properties(
@@ -888,7 +889,7 @@ set_target_properties(
   protobuf PROPERTIES
   INTERFACE_INCLUDE_DIRECTORIES ${PROTOBUF_ROOT}/src)
 
-set(PROTOBUF_CMAKE_FORWARD_ARGS ${CMAKE_FORWARD_ARGS}
+set(PROTOBUF_CMAKE_FORWARD_ARGS ${CMAKE_CXX_FORWARD_ARGS}
   -Dprotobuf_BUILD_TESTS=OFF)
 
 if (WIN32)
@@ -1006,7 +1007,7 @@ ExternalProject_Add(
   BUILD_BYPRODUCTS  ${ZOOKEEPER_BYPRODUCTS};${ZK-HASHTABLE_BYPRODUCTS}
   PATCH_COMMAND     ${ZOOKEEPER_PATCH_CMD}
   SOURCE_SUBDIR     src/c
-  CMAKE_ARGS        ${CMAKE_FORWARD_ARGS};-DWANT_CPPUNIT=OFF
+  CMAKE_ARGS        ${CMAKE_CXX_FORWARD_ARGS};-DWANT_CPPUNIT=OFF
   INSTALL_COMMAND   ${CMAKE_NOOP}
   URL               ${ZOOKEEPER_URL}
   URL_HASH          ${ZOOKEEPER_HASH})


[7/9] mesos git commit: Windows: Made SASL use default CRT linking.

Posted by an...@apache.org.
Windows: Made SASL use default CRT linking.

Review: https://reviews.apache.org/r/66014


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/80cb7163
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/80cb7163
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/80cb7163

Branch: refs/heads/master
Commit: 80cb7163bad28b369460190290f5729e130cae13
Parents: 5ddb740
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Mar 9 12:55:25 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 3rdparty/cyrus-sasl-2.1.27rc3.patch | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/80cb7163/3rdparty/cyrus-sasl-2.1.27rc3.patch
----------------------------------------------------------------------
diff --git a/3rdparty/cyrus-sasl-2.1.27rc3.patch b/3rdparty/cyrus-sasl-2.1.27rc3.patch
index e363b9e..fc273f3 100644
--- a/3rdparty/cyrus-sasl-2.1.27rc3.patch
+++ b/3rdparty/cyrus-sasl-2.1.27rc3.patch
@@ -3,16 +3,10 @@ new file mode 100644
 index 0000000..ae81f5c
 --- /dev/null
 +++ b/CMakeLists.txt
-@@ -0,0 +1,40 @@
+@@ -0,0 +1,34 @@
 +cmake_minimum_required (VERSION 3.8)
 +project (libsasl2)
 +
-+string(APPEND CMAKE_C_FLAGS_RELEASE " /MT")
-+string(APPEND CMAKE_C_FLAGS_DEBUG   " /MTd")
-+
-+string(APPEND CMAKE_CXX_FLAGS_RELEASE " /MT")
-+string(APPEND CMAKE_CXX_FLAGS_DEBUG   " /MTd")
-+
 +file(COPY
 +  include/hmac-md5.h
 +  include/md5.h


[8/9] mesos git commit: Windows: Set 3rdparty libraries to link to CRT dynamically.

Posted by an...@apache.org.
Windows: Set 3rdparty libraries to link to CRT dynamically.

This also fixes a bug where the `libevent` build on Windows would add
`''` to the compiler flags, which is an unrecognized flag, and sets
the names of our `CMAKE_FORWARD_ARGS` variables consistently (some
were missing the `FORWARD` part).

Review: https://reviews.apache.org/r/66011


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5915f8f1
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5915f8f1
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5915f8f1

Branch: refs/heads/master
Commit: 5915f8f19a70b895742288f852afc45fc178e9aa
Parents: b9abc38
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Mar 9 11:57:21 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5915f8f1/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 0436c59..06f8aa0 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -504,18 +504,21 @@ if (ENABLE_LIBEVENT)
       IMPORTED_LOCATION ${LIBEVENT_ROOT}-build/lib/libevent${LIBRARY_SUFFIX})
   endif ()
 
-  set(LIBEVENT_CMAKE_ARGS
+  set(LIBEVENT_CMAKE_FORWARD_ARGS
     ${CMAKE_FORWARD_ARGS}
     ${CMAKE_SSL_FORWARD_ARGS}
     # NOTE: Libevent does not respect the BUILD_SHARED_LIBS global flag.
     -DEVENT__BUILD_SHARED_LIBRARIES=${BUILD_SHARED_LIBS}
     -DEVENT__DISABLE_OPENSSL=$<NOT:$<BOOL:${ENABLE_SSL}>>
-    -DCMAKE_C_FLAGS=$<IF:$<PLATFORM_ID:Windows>,"",-fPIC>
     -DEVENT__DISABLE_BENCHMARK=ON
     -DEVENT__DISABLE_REGRESS=ON
     -DEVENT__DISABLE_SAMPLES=ON
     -DEVENT__DISABLE_TESTS=ON)
 
+  if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang)
+    list(APPEND LIBEVENT_CMAKE_FORWARD_ARGS -DCMAKE_C_FLAGS=-fPIC)
+  endif ()
+
   MAKE_INCLUDE_DIR(libevent)
   GET_BYPRODUCTS(libevent)
 
@@ -523,7 +526,7 @@ if (ENABLE_LIBEVENT)
     ${LIBEVENT_TARGET}
     PREFIX            ${LIBEVENT_CMAKE_ROOT}
     BUILD_BYPRODUCTS  ${LIBEVENT_BYPRODUCTS}
-    CMAKE_ARGS        ${LIBEVENT_CMAKE_ARGS}
+    CMAKE_ARGS        ${LIBEVENT_CMAKE_FORWARD_ARGS}
     INSTALL_COMMAND   ${CMAKE_NOOP}
     URL               ${LIBEVENT_URL}
     URL_HASH          ${LIBEVENT_HASH})
@@ -643,7 +646,7 @@ if (WIN32)
   # `add_dependencies` creates a cycle.
   add_executable(curl IMPORTED GLOBAL)
 
-  set(CURL_CMAKE_ARGS
+  set(CURL_CMAKE_FORWARD_ARGS
     ${CMAKE_FORWARD_ARGS}
     -DCMAKE_USE_WINSSL=ON
     -DCURL_DISABLE_LDAP=ON
@@ -652,7 +655,7 @@ if (WIN32)
   # NOTE: cURL does not respect BUILD_SHARED_LIBS.
   if (NOT BUILD_SHARED_LIBS)
     # This is both a CMake argument and a pre-processor definition.
-    list(APPEND CURL_CMAKE_ARGS -DCURL_STATICLIB=ON)
+    list(APPEND CURL_CMAKE_FORWARD_ARGS -DCURL_STATICLIB=ON)
 
     set_target_properties(
       libcurl PROPERTIES
@@ -698,7 +701,7 @@ if (WIN32)
     PREFIX            ${CURL_CMAKE_ROOT}
     BUILD_BYPRODUCTS  ${LIBCURL_BYPRODUCTS};${CURL_BYPRODUCTS}
     PATCH_COMMAND     ${CMAKE_NOOP}
-    CMAKE_ARGS        ${CURL_CMAKE_ARGS}
+    CMAKE_ARGS        ${CURL_CMAKE_FORWARD_ARGS}
     INSTALL_COMMAND   ${CMAKE_NOOP}
     URL               ${CURL_URL}
     URL_HASH          ${CURL_HASH})
@@ -855,9 +858,9 @@ GET_BYPRODUCTS(gtest)
 # Unconditionally build static libraries.
 list(APPEND GOOGLETEST_CMAKE_FORWARD_ARGS -DBUILD_SHARED_LIBS=OFF)
 
-# Link to the correct CRT based on other libraries' linkage.
+# But also link to the CRT dynamically.
 list(APPEND GOOGLETEST_CMAKE_FORWARD_ARGS
-  -Dgtest_force_shared_crt=${BUILD_SHARED_LIBS})
+  -Dgtest_force_shared_crt=ON)
 
 ExternalProject_Add(
   ${GOOGLETEST_TARGET}
@@ -885,9 +888,16 @@ set_target_properties(
   protobuf PROPERTIES
   INTERFACE_INCLUDE_DIRECTORIES ${PROTOBUF_ROOT}/src)
 
+set(PROTOBUF_CMAKE_FORWARD_ARGS ${CMAKE_FORWARD_ARGS}
+  -Dprotobuf_BUILD_TESTS=OFF)
+
 if (WIN32)
   PATCH_CMD(PROTOBUF_PATCH_CMD protobuf-${PROTOBUF_VERSION}.patch)
 
+  # Link to the CRT dynamically.
+  list(APPEND PROTOBUF_CMAKE_FORWARD_ARGS
+    -Dprotobuf_MSVC_STATIC_RUNTIME=OFF)
+
   if (CMAKE_GENERATOR MATCHES "Visual Studio")
     set_target_properties(
       protobuf PROPERTIES
@@ -932,7 +942,7 @@ ExternalProject_Add(
   PATCH_COMMAND     ${PROTOBUF_PATCH_CMD}
   BUILD_BYPRODUCTS  ${PROTOBUF_BYPRODUCTS}
   SOURCE_SUBDIR     cmake
-  CMAKE_ARGS        ${CMAKE_FORWARD_ARGS};-Dprotobuf_BUILD_TESTS=OFF
+  CMAKE_ARGS        ${PROTOBUF_CMAKE_FORWARD_ARGS}
   INSTALL_COMMAND   ${CMAKE_NOOP}
   URL               ${PROTOBUF_URL}
   URL_HASH          ${PROTOBUF_HASH})


[4/9] mesos git commit: CMake: Added `-Wno-unused-local-typedefs` to Boost interface.

Posted by an...@apache.org.
CMake: Added `-Wno-unused-local-typedefs` to Boost interface.

As found in the Autotools builds, GCC and Clang will emit an used
local typedef warning for headers including Boost. Since it is
3rdparty code, we disable this warning in its interface.

Review: https://reviews.apache.org/r/66009


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6613e6a6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6613e6a6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6613e6a6

Branch: refs/heads/master
Commit: 6613e6a60e746626bd4e81694952103644235f09
Parents: 5cb1017
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Mar 9 10:35:03 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt | 6 ++++++
 configure.ac            | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6613e6a6/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index e0c1538..0436c59 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -177,6 +177,12 @@ endfunction()
 EXTERNAL(boost ${BOOST_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
 add_library(boost INTERFACE)
 add_dependencies(boost ${BOOST_TARGET})
+if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
+  # Headers including Boost 1.65.0 fail to compile with GCC 7.2 and
+  # CLang 3.6 without `-Wno-unused-local-typedefs`.
+  # TODO(andschwa): Remove this when Boost has a resolution.
+  target_compile_options(boost INTERFACE -Wno-unused-local-typedefs)
+endif ()
 target_include_directories(boost INTERFACE ${BOOST_ROOT})
 
 ExternalProject_Add(

http://git-wip-us.apache.org/repos/asf/mesos/blob/6613e6a6/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 30fbadc..f3d1169 100644
--- a/configure.ac
+++ b/configure.ac
@@ -540,7 +540,7 @@ AS_CASE($ax_cv_cxx_compiler_vendor,
   [clang], [
     # Check if -Wno-unused-local-typedef is needed by checking a sample
     # compilation which contains a local unused typedef.
-    # This is needed because Boost 1.53.0 fails to compile with upstream
+    # This is needed because Boost 1.65.0 fails to compile with upstream
     # Clang 3.6 without -Wno-unused-local-typedef. Apple LLVM based on
     # Clang 3.6 doesn't have the same behavior.
     AC_LANG_PUSH([C++])
@@ -571,7 +571,7 @@ AS_CASE($ax_cv_cxx_compiler_vendor,
     fi
 
     AC_MSG_NOTICE([Setting up CXXFLAGS for g++ version >= 4.8])
-    # Boost 1.53.0 fails to compile with GCC 4.8 without
+    # Boost 1.65.0 fails to compile with GCC 7.2 without
     # -Wno-unused-local-typedefs, and automake does not recognize the
     # flag.
     # TODO(brenden): Remove this when Boost has a resolution.


[2/9] mesos git commit: CMake: Enabled compiler warnings.

Posted by an...@apache.org.
CMake: Enabled compiler warnings.

We had previously been using the default sets of warnings, but now we
use the same warnings as on Autotools. This meant disabling two common
possible-loss-of-data warnings on Windows that are not part of the
GNU/Clang default warnings.

This also replaces the use of `string(APPEND CMAKE_CXX_FLAGS)` with
the canonical command `add_compile_options`. Although generally the
use of `target_compile_options` is preferred, it would currently
result in a lot more churn, and the build already supports setting
these flags globally.

Review: https://reviews.apache.org/r/66008


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5cb10176
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5cb10176
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5cb10176

Branch: refs/heads/master
Commit: 5cb1017617f90878fa9c26546ed0e73b74a74017
Parents: 0c18ca1
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Mar 8 14:56:22 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:06 2018 -0700

----------------------------------------------------------------------
 cmake/CompilationConfigure.cmake | 50 ++++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5cb10176/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 9eab0d6..7419024 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -217,21 +217,46 @@ if (WIN32)
   endif ()
 endif ()
 
+# GLOBAL WARNINGS.
+##################
+if (CMAKE_CXX_COMPILER_ID MATCHES GNU
+    OR CMAKE_CXX_COMPILER_ID MATCHES Clang) # Also matches AppleClang.
+  # TODO(andschwa): Add `-Wextra`, `-Wpedantic`, `-Wconversion`.
+  add_compile_options(
+    -Wall
+    -Wsign-compare)
+elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
+  # TODO(andschwa): Switch to `/W4` and re-enable possible-loss-of-data warnings.
+  #
+  # The last two warnings are disabled (well, put into `/W4`) because
+  # there is no easy equivalent to enable them for GCC/Clang without
+  # also fixing all the warnings from `-Wconversion`.
+  add_compile_options(
+    # Like `-Wall`; `/W4` is more like `-Wall -Wextra`.
+    /W3
+    # Disable permissiveness.
+    /permissive-
+    # C4244 is a possible loss of data warning for integer conversions.
+    /w44244
+    # C4267 is a possible loss of data warning when converting from `size_t`.
+    /w44267)
+endif ()
+
 
 # POSIX CONFIGURATION.
 ######################
 if (NOT WIN32)
   # Warn about use of format functions that can produce security issues.
-  string(APPEND CMAKE_CXX_FLAGS " -Wformat-security")
+  add_compile_options(-Wformat-security)
 
   # Protect many of the functions with stack guards. The exact flag
   # depends on compiler support.
   CHECK_CXX_COMPILER_FLAG(-fstack-protector-strong STRONG_STACK_PROTECTORS)
   CHECK_CXX_COMPILER_FLAG(-fstack-protector STACK_PROTECTORS)
   if (STRONG_STACK_PROTECTORS)
-    string(APPEND CMAKE_CXX_FLAGS " -fstack-protector-strong")
+    add_compile_options(-fstack-protector-strong)
   elseif (STACK_PROTECTORS)
-    string(APPEND CMAKE_CXX_FLAGS " -fstack-protector")
+    add_compile_options(-fstack-protector)
   else ()
     message(
       WARNING
@@ -259,7 +284,7 @@ if (ENABLE_GC_UNUSED)
   set(CMAKE_REQUIRED_FLAGS "-ffunction-sections -fdata-sections -Wl,--gc-sections")
   CHECK_CXX_COMPILER_FLAG("" GC_FUNCTION_SECTIONS)
   if (GC_FUNCTION_SECTIONS)
-    string(APPEND CMAKE_CXX_FLAGS " -ffunction-sections -fdata-sections")
+    add_compile_options(-ffunction-sections -fdata-sections)
     string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections")
     string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--gc-sections")
   else ()
@@ -282,14 +307,11 @@ string(COMPARE EQUAL ${CMAKE_SYSTEM_NAME} "Linux" LINUX)
 if (WIN32)
   # COFF/PE and friends are somewhat limited in the number of sections they
   # allow for an object file. We use this to avoid those problems.
-  string(APPEND CMAKE_CXX_FLAGS " /bigobj /vd2")
-
-  # Disable permissiveness.
-  string(APPEND CMAKE_CXX_FLAGS " /permissive-")
+  add_compile_options(/bigobj /vd2)
 
   # Fix Warning C4530: C++ exception handler used, but unwind semantics are not
   # enabled.
-  string(APPEND CMAKE_CXX_FLAGS " /EHsc")
+  add_compile_options(/EHsc)
 
   # Build against the multi-threaded version of the C runtime library (CRT).
   if (BUILD_SHARED_LIBS)
@@ -310,13 +332,15 @@ if (WIN32)
     set(OPENSSL_MSVC_STATIC_RT TRUE)
   endif ()
 
+  # Enable multi-threaded compilation for `cl.exe`.
+  add_compile_options(/MP)
+
+  # Force use of Unicode C and C++ Windows APIs.
+  add_definitions(-DUNICODE -D_UNICODE)
+
   # NOTE: We APPEND ${CRT} rather than REPLACE so it gets picked up by
   # dependencies.
   foreach (lang C CXX)
-    # Enable multi-threaded and UNICODE compilation.
-    # NOTE: We do not add CRT here because dependencies will use it incorrectly.
-    string(APPEND CMAKE_${lang}_FLAGS " /MP -DUNICODE -D_UNICODE")
-
     # Debug library for debug configuration, release otherwise.
 
     # Handle single-configuration generators such as Ninja.


[3/9] mesos git commit: Windows: Made ZooKeeper use default CRT linking.

Posted by an...@apache.org.
Windows: Made ZooKeeper use default CRT linking.

Also deleted extraneous patch files.

Review: https://reviews.apache.org/r/66013


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5ddb740f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5ddb740f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5ddb740f

Branch: refs/heads/master
Commit: 5ddb740f347069e884a00907aa632275dc4ace10
Parents: 5d1a2b1
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Mar 9 12:54:41 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt              |   4 +-
 3rdparty/zookeeper-06d3f3f.patch     | 216 ---------
 3rdparty/zookeeper-3.4.8.patch       |   7 +-
 3rdparty/zookeeper-3.5.2-alpha.patch | 729 ------------------------------
 4 files changed, 4 insertions(+), 952 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5ddb740f/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 7892e2f..b438f0a 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -965,6 +965,8 @@ set_target_properties(
   INTERFACE_LINK_LIBRARIES zk-hashtable
   INTERFACE_COMPILE_DEFINITIONS "${ZOOKEEPER_COMPILE_DEFINITIONS}")
 
+set(ZOOKEEPER_CMAKE_FORWARD_ARGS ${CMAKE_CXX_FORWARD_ARGS} -DWANT_CPPUNIT=OFF)
+
 PATCH_CMD(ZOOKEEPER_PATCH_CMD zookeeper-${ZOOKEEPER_VERSION}.patch)
 
 if (WIN32)
@@ -1007,7 +1009,7 @@ ExternalProject_Add(
   BUILD_BYPRODUCTS  ${ZOOKEEPER_BYPRODUCTS};${ZK-HASHTABLE_BYPRODUCTS}
   PATCH_COMMAND     ${ZOOKEEPER_PATCH_CMD}
   SOURCE_SUBDIR     src/c
-  CMAKE_ARGS        ${CMAKE_CXX_FORWARD_ARGS};-DWANT_CPPUNIT=OFF
+  CMAKE_ARGS        ${ZOOKEEPER_CMAKE_FORWARD_ARGS}
   INSTALL_COMMAND   ${CMAKE_NOOP}
   URL               ${ZOOKEEPER_URL}
   URL_HASH          ${ZOOKEEPER_HASH})

http://git-wip-us.apache.org/repos/asf/mesos/blob/5ddb740f/3rdparty/zookeeper-06d3f3f.patch
----------------------------------------------------------------------
diff --git a/3rdparty/zookeeper-06d3f3f.patch b/3rdparty/zookeeper-06d3f3f.patch
deleted file mode 100644
index 7f66875..0000000
--- a/3rdparty/zookeeper-06d3f3f.patch
+++ /dev/null
@@ -1,216 +0,0 @@
-diff --git a/src/c/include/winconfig.h b/src/c/include/winconfig.h
-index ccc3c189..a4b3287a 100644
---- a/src/c/include/winconfig.h
-+++ b/src/c/include/winconfig.h
-@@ -1,3 +1,5 @@
-+#pragma once
-+
- /* Define to 1 if you have the <arpa/inet.h> header file. */
- #undef HAVE_ARPA_INET_H
-
-@@ -152,13 +154,6 @@
- #define __attribute__(x)
- #define __func__ __FUNCTION__
-
--#ifndef _WIN32_WINNT_NT4
--#define _WIN32_WINNT_NT4 0x0400
--#endif
--
--#define NTDDI_VERSION _WIN32_WINNT_NT4
--#define _WIN32_WINNT _WIN32_WINNT_NT4
--
- #define _CRT_SECURE_NO_WARNINGS
- #define WIN32_LEAN_AND_MEAN
- #include <Windows.h>
-@@ -171,12 +166,17 @@
- #undef max
-
- #include <errno.h>
-+#include <stdlib.h>
-
- #define strtok_r strtok_s
- #define localtime_r(a,b) localtime_s(b,a)
- #define get_errno() errno=GetLastError()
--#define random rand
-+
-+inline int __cdecl random() { return rand(); }
-+
-+#if ((defined(_MSC_VER) && _MSC_VER < 1900) || !defined(_MSC_VER))
- #define snprintf _snprintf
-+#endif
-
- #define ACL ZKACL  // Conflict with windows API
-
-@@ -192,5 +192,5 @@
- #define EINPROGRESS WSAEINPROGRESS
- #endif
-
--typedef int pid_t;
-+typedef DWORD pid_t;
- #endif
-diff --git a/src/c/include/winstdint.h b/src/c/include/winstdint.h
-index d02608a5..196ecc5d 100644
---- a/src/c/include/winstdint.h
-+++ b/src/c/include/winstdint.h
-@@ -41,6 +41,7 @@
- #endif
-
- #include <limits.h>
-+#include <stdint.h>
-
- // For Visual Studio 6 in C++ mode and for many Visual Studio versions when
- // compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
-@@ -100,16 +101,6 @@ typedef uint16_t  uint_least16_t;
- typedef uint32_t  uint_least32_t;
- typedef uint64_t  uint_least64_t;
-
--// 7.18.1.3 Fastest minimum-width integer types
--typedef int8_t    int_fast8_t;
--typedef int16_t   int_fast16_t;
--typedef int32_t   int_fast32_t;
--typedef int64_t   int_fast64_t;
--typedef uint8_t   uint_fast8_t;
--typedef uint16_t  uint_fast16_t;
--typedef uint32_t  uint_fast32_t;
--typedef uint64_t  uint_fast64_t;
--
- // 7.18.1.4 Integer types capable of holding object pointers
- #ifdef _WIN64 // [
-    typedef signed __int64    intptr_t;
-@@ -126,7 +117,7 @@ typedef uint64_t  uintmax_t;
-
- // 7.18.2 Limits of specified-width integer types
-
--#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
-+#if (_MSC_VER < 1900) && (!defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)) // [   See footnote 220 at page 257 and footnote 221 at page 259
-
- // 7.18.2.1 Limits of exact-width integer types
- #define INT8_MIN     ((int8_t)_I8_MIN)
-@@ -223,7 +214,7 @@ typedef uint64_t  uintmax_t;
-
- // 7.18.4 Limits of other integer types
-
--#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
-+#if (_MSC_VER < 1900) && (!defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)) // [   See footnote 224 at page 260
-
- // 7.18.4.1 Macros for minimum-width integer constants
-
-diff --git a/src/c/zookeeper-vs2015.sln b/src/c/zookeeper-vs2015.sln
-new file mode 100644
-index 00000000..44d738f8
---- /dev/null
-+++ b/src/c/zookeeper-vs2015.sln
-@@ -0,0 +1,37 @@
-+Microsoft Visual Studio Solution File, Format Version 12.00
-+# Visual Studio 14
-+VisualStudioVersion = 14.0.23107.0
-+MinimumVisualStudioVersion = 10.0.40219.1
-+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zookeeper", "zookeeper.vcxproj", "{5754FB2B-5EA5-4988-851D-908CA533A626}"
-+EndProject
-+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cli", "cli.vcxproj", "{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}"
-+EndProject
-+Global
-+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-+		Debug|Win32 = Debug|Win32
-+		Debug|x64 = Debug|x64
-+		Release|Win32 = Release|Win32
-+		Release|x64 = Release|x64
-+	EndGlobalSection
-+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|Win32.ActiveCfg = Debug|Win32
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|Win32.Build.0 = Debug|Win32
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|x64.ActiveCfg = Debug|x64
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|x64.Build.0 = Debug|x64
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|Win32.ActiveCfg = Release|Win32
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|Win32.Build.0 = Release|Win32
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|x64.ActiveCfg = Release|x64
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|x64.Build.0 = Release|x64
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|Win32.ActiveCfg = Debug|Win32
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|Win32.Build.0 = Debug|Win32
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|x64.ActiveCfg = Debug|x64
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|x64.Build.0 = Debug|x64
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|Win32.ActiveCfg = Release|Win32
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|Win32.Build.0 = Release|Win32
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|x64.ActiveCfg = Release|x64
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|x64.Build.0 = Release|x64
-+	EndGlobalSection
-+	GlobalSection(SolutionProperties) = preSolution
-+		HideSolutionNode = FALSE
-+	EndGlobalSection
-+EndGlobal
-diff --git a/src/c/zookeeper.vcxproj b/src/c/zookeeper.vcxproj
-index be4ad9ab..5e75f779 100644
---- a/src/c/zookeeper.vcxproj
-+++ b/src/c/zookeeper.vcxproj
-@@ -1,5 +1,5 @@
- <?xml version="1.0" encoding="utf-8"?>
--<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-   <ItemGroup Label="ProjectConfigurations">
-     <ProjectConfiguration Include="Debug|Win32">
-       <Configuration>Debug</Configuration>
-@@ -22,24 +22,25 @@
-     <ProjectGuid>{5754FB2B-5EA5-4988-851D-908CA533A626}</ProjectGuid>
-     <RootNamespace>zookeeper</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
-+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
--    <ConfigurationType>DynamicLibrary</ConfigurationType>
--    <PlatformToolset>v120</PlatformToolset>
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <PlatformToolset>v140</PlatformToolset>
-   </PropertyGroup>
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
--    <ConfigurationType>DynamicLibrary</ConfigurationType>
--    <PlatformToolset>v120</PlatformToolset>
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <PlatformToolset>v140</PlatformToolset>
-   </PropertyGroup>
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
--    <ConfigurationType>DynamicLibrary</ConfigurationType>
--    <PlatformToolset>v120</PlatformToolset>
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <PlatformToolset>v140</PlatformToolset>
-     <CharacterSet>MultiByte</CharacterSet>
-   </PropertyGroup>
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
--    <ConfigurationType>DynamicLibrary</ConfigurationType>
--    <PlatformToolset>v120</PlatformToolset>
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <PlatformToolset>v140</PlatformToolset>
-     <CharacterSet>MultiByte</CharacterSet>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-@@ -80,10 +81,10 @@
-     <ClCompile>
-       <Optimization>Disabled</Optimization>
-       <AdditionalIncludeDirectories>./include;./generated;./hashtable;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
--      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ZOOKEEPER_EXPORTS;DLL_EXPORT;THREADED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ZOOKEEPER_EXPORTS;THREADED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-       <MinimalRebuild>true</MinimalRebuild>
-       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
--      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-       <PrecompiledHeader />
-       <WarningLevel>Level3</WarningLevel>
-       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-@@ -104,7 +105,7 @@
-       <AdditionalIncludeDirectories>./include;./generated;./hashtable;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ZOOKEEPER_EXPORTS;DLL_EXPORT;THREADED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
--      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-       <PrecompiledHeader>
-       </PrecompiledHeader>
-       <WarningLevel>Level3</WarningLevel>
-@@ -124,7 +125,7 @@
-     <ClCompile>
-       <AdditionalIncludeDirectories>./include;./generated;./hashtable;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ZOOKEEPER_EXPORTS;DLL_EXPORT;THREADED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
--      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-       <PrecompiledHeader />
-       <WarningLevel>Level3</WarningLevel>
-       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

http://git-wip-us.apache.org/repos/asf/mesos/blob/5ddb740f/3rdparty/zookeeper-3.4.8.patch
----------------------------------------------------------------------
diff --git a/3rdparty/zookeeper-3.4.8.patch b/3rdparty/zookeeper-3.4.8.patch
index c532a69..2eaa056 100644
--- a/3rdparty/zookeeper-3.4.8.patch
+++ b/3rdparty/zookeeper-3.4.8.patch
@@ -3,7 +3,7 @@ new file mode 100644
 index 000000000..0f256b59c
 --- /dev/null
 +++ w/src/c/CMakeLists.txt
-@@ -0,0 +1,237 @@
+@@ -0,0 +1,232 @@
 +# 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
@@ -45,11 +45,6 @@ index 000000000..0f256b59c
 +option(WANT_SYNCAPI "Enables Sync API support" ON)
 +if(WANT_SYNCAPI)
 +  add_definitions(-DTHREADED)
-+  if(WIN32)
-+    # Note that the generator expression ensures that `/MTd` is used when Debug
-+    # configurations are built.
-+    add_compile_options(/MT$<$<CONFIG:Debug>:d>)
-+  endif()
 +endif()
 +
 +# CppUnit option

http://git-wip-us.apache.org/repos/asf/mesos/blob/5ddb740f/3rdparty/zookeeper-3.5.2-alpha.patch
----------------------------------------------------------------------
diff --git a/3rdparty/zookeeper-3.5.2-alpha.patch b/3rdparty/zookeeper-3.5.2-alpha.patch
deleted file mode 100644
index 6d5db53..0000000
--- a/3rdparty/zookeeper-3.5.2-alpha.patch
+++ /dev/null
@@ -1,729 +0,0 @@
-diff --git c/src/c/CMakeLists.txt w/src/c/CMakeLists.txt
-new file mode 100644
-index 000000000..85e500e05
---- /dev/null
-+++ w/src/c/CMakeLists.txt
-@@ -0,0 +1,204 @@
-+cmake_minimum_required(VERSION 3.6)
-+
-+project(zookeeper VERSION 3.5.2)
-+set(email user@zookeeper.apache.org)
-+set(description "zookeeper C client")
-+
-+# general options
-+include_directories(include tests generated ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
-+if(UNIX)
-+  add_compile_options(-Wall -fPIC)
-+elseif(WIN32)
-+  add_compile_options(/W3)
-+endif()
-+add_definitions(-DUSE_STATIC_LIB)
-+
-+# TODO: Enable /WX and /W4 on Windows. Currently there are ~1000 warnings.
-+# TODO: Add Solaris support.
-+# TODO: Add debug configuration.
-+# TODO: Add a shared library option.
-+
-+# Sync API option
-+option(WANT_SYNCAPI "Enables Sync API support" ON)
-+if(WANT_SYNCAPI)
-+  add_definitions(-DTHREADED)
-+  if(WIN32)
-+    add_compile_options(/MT)
-+  endif()
-+endif()
-+
-+# CppUnit option
-+option(WANT_CPPUNIT "Enables CppUnit" ON)
-+
-+# header checks
-+function(to_have in out)
-+  string(TOUPPER ${in} str)
-+  string(REGEX REPLACE "/|\\." "_" str ${str})
-+  set(${out} "HAVE_${str}" PARENT_SCOPE)
-+endfunction()
-+
-+# include file checks
-+foreach(f generated/zookeeper.jute.h generated/zookeeper.jute.c)
-+  if(EXISTS "${CMAKE_SOURCE_DIR}/${f}")
-+    to_have(${f} name)
-+    set(${name} 1)
-+  else()
-+    message(FATAL_ERROR
-+      "jute files are missing!\n"
-+      "Please run 'ant compile_jute' while in the zookeeper top level directory.")
-+  endif()
-+endforeach()
-+
-+include(CheckIncludeFile)
-+set(check_headers
-+  arpa/inet.h
-+  dlfcn.h
-+  fcntl.h
-+  inttypes.h
-+  memory.h
-+  netdb.h
-+  netinet/in.h
-+  stdint.h
-+  stdlib.h
-+  string.h
-+  strings.h
-+  sys/socket.h
-+  sys/stat.h
-+  sys/time.h
-+  sys/types.h
-+  unistd.h
-+  sys/utsname.h)
-+
-+foreach(f ${check_headers})
-+  to_have(${f} name)
-+  check_include_file(${f} ${name})
-+endforeach()
-+
-+# function checks
-+include(CheckFunctionExists)
-+set(check_functions
-+  getcwd
-+  gethostbyname
-+  gethostname
-+  getlogin
-+  getpwuid_r
-+  gettimeofday
-+  getuid
-+  memmove
-+  memset
-+  poll
-+  socket
-+  strchr
-+  strdup
-+  strerror
-+  strtol)
-+
-+foreach(fn ${check_functions})
-+  to_have(${fn} name)
-+  check_function_exists(${fn} ${name})
-+endforeach()
-+
-+# library checks
-+set(check_libraries rt m pthread)
-+foreach(lib ${check_libraries})
-+  to_have("lib${lib}" name)
-+  find_library(${name} ${lib})
-+endforeach()
-+
-+# IPv6 check
-+include(CheckStructHasMember)
-+check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h" ZOO_IPV6_ENABLED)
-+
-+# configure
-+configure_file(cmake_config.h.in config.h)
-+
-+# hashtable library
-+set(hashtable_sources src/hashtable/hashtable_itr.c src/hashtable/hashtable.c)
-+add_library(hashtable STATIC ${hashtable_sources})
-+
-+# zookeeper library
-+set(zookeeper_sources
-+  src/zookeeper.c
-+  src/recordio.c
-+  generated/zookeeper.jute.c
-+  src/zk_log.c
-+  src/zk_hashtable.c
-+  src/addrvec.c)
-+
-+if(WANT_SYNCAPI)
-+  list(APPEND zookeeper_sources src/mt_adaptor.c)
-+else()
-+  list(APPEND zookeeper_sources src/st_adaptor.c)
-+endif()
-+
-+if(WIN32)
-+  list(APPEND zookeeper_sources src/winport.c)
-+endif()
-+
-+add_library(zookeeper STATIC ${zookeeper_sources})
-+target_link_libraries(zookeeper PUBLIC hashtable)
-+if(UNIX)
-+  target_link_libraries(zookeeper PUBLIC m rt)
-+elseif(WIN32)
-+  target_link_libraries(zookeeper PUBLIC wsock32 Ws2_32)
-+endif()
-+
-+if(WANT_SYNCAPI AND NOT WIN32)
-+  target_link_libraries(zookeeper PUBLIC pthread)
-+endif()
-+# TODO: Specify symbols to export.
-+
-+# cli executable
-+add_executable(cli src/cli.c)
-+target_link_libraries(cli zookeeper)
-+
-+# load_gen executable
-+if(WANT_SYNCAPI AND NOT WIN32)
-+  add_executable(load_gen src/load_gen.c)
-+  target_link_libraries(load_gen zookeeper)
-+endif()
-+
-+# tests
-+set(test_sources
-+  tests/TestDriver.cc
-+  tests/LibCMocks.cc
-+  tests/LibCSymTable.cc
-+  tests/MocksBase.cc
-+  tests/ZKMocks.cc
-+  tests/Util.cc
-+  tests/ThreadingUtil.cc
-+  tests/TestZookeeperInit.cc
-+  tests/TestZookeeperClose.cc
-+  tests/TestReconfig.cc
-+  tests/TestReconfigServer.cc
-+  tests/TestClientRetry.cc
-+  tests/TestOperations.cc
-+  tests/TestMulti.cc
-+  tests/TestWatchers.cc
-+  tests/TestClient.cc
-+  tests/ZooKeeperQuorumServer.cc
-+  tests/TestReadOnlyClient.cc)
-+
-+if(WANT_SYNCAPI)
-+  list(APPEND test_sources tests/PthreadMocks.cc)
-+endif()
-+
-+if(WANT_CPPUNIT)
-+  add_executable(zktest ${test_sources})
-+  target_compile_definitions(zktest
-+    PRIVATE -DZKSERVER_CMD="${CMAKE_SOURCE_DIR}/tests/zkServer.sh")
-+  target_link_libraries(zktest zookeeper cppunit dl)
-+
-+  file(STRINGS tests/wrappers.opt symbol_wrappers)
-+  if(WANT_SYNCAPI)
-+    file(STRINGS tests/wrappers-mt.opt symbol_wrappers_mt)
-+  endif()
-+
-+  target_link_libraries(zktest ${symbol_wrappers} ${symbol_wrappers_mt})
-+
-+  enable_testing()
-+  add_test(NAME zktest_runner COMMAND zktest)
-+  set_property(TEST zktest_runner PROPERTY ENVIRONMENT
-+    "ZKROOT=${CMAKE_SOURCE_DIR}/../.."
-+    "CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover.jar")
-+endif()
-diff --git c/src/c/cmake_config.h.in w/src/c/cmake_config.h.in
-new file mode 100644
-index 000000000..5f945033e
---- /dev/null
-+++ w/src/c/cmake_config.h.in
-@@ -0,0 +1,136 @@
-+#ifndef CONFIG_H_
-+#define CONFIG_H_
-+
-+/* Define to 1 if you have the <arpa/inet.h> header file. */
-+#cmakedefine HAVE_ARPA_INET_H 1
-+
-+/* Define to 1 if you have the <dlfcn.h> header file. */
-+#cmakedefine HAVE_DLFCN_H 1
-+
-+/* Define to 1 if you have the <fcntl.h> header file. */
-+#cmakedefine HAVE_FCNTL_H 1
-+
-+/* Define to 1 if you have the file `generated/zookeeper.jute.c'. */
-+#cmakedefine HAVE_GENERATED_ZOOKEEPER_JUTE_C 1
-+
-+/* Define to 1 if you have the file `generated/zookeeper.jute.h'. */
-+#cmakedefine HAVE_GENERATED_ZOOKEEPER_JUTE_H 1
-+
-+/* Define to 1 if you have the `getcwd' function. */
-+#cmakedefine HAVE_GETCWD 1
-+
-+/* Define to 1 if you have the `gethostbyname' function. */
-+#cmakedefine HAVE_GETHOSTBYNAME 1
-+
-+/* Define to 1 if you have the `gethostname' function. */
-+#cmakedefine HAVE_GETHOSTNAME 1
-+
-+/* Define to 1 if you have the `getlogin' function. */
-+#cmakedefine HAVE_GETLOGIN 1
-+
-+/* Define to 1 if you have the `getpwuid_r' function. */
-+#cmakedefine HAVE_GETPWUID_R 1
-+
-+/* Define to 1 if you have the `gettimeofday' function. */
-+#cmakedefine HAVE_GETTIMEOFDAY 1
-+
-+/* Define to 1 if you have the `getuid' function. */
-+#cmakedefine HAVE_GETUID 1
-+
-+/* Define to 1 if you have the <inttypes.h> header file. */
-+#cmakedefine HAVE_INTTYPES_H 1
-+
-+/* Define to 1 if you have the `rt' library (-lrt). */
-+#cmakedefine HAVE_LIBRT 1
-+
-+/* Define to 1 if you have the `memmove' function. */
-+#cmakedefine HAVE_MEMMOVE 1
-+
-+/* Define to 1 if you have the <memory.h> header file. */
-+#cmakedefine HAVE_MEMORY_H 1
-+
-+/* Define to 1 if you have the `memset' function. */
-+#cmakedefine HAVE_MEMSET 1
-+
-+/* Define to 1 if you have the <netdb.h> header file. */
-+#cmakedefine HAVE_NETDB_H 1
-+
-+/* Define to 1 if you have the <netinet/in.h> header file. */
-+#cmakedefine HAVE_NETINET_IN_H 1
-+
-+/* Define to 1 if you have the `poll' function. */
-+#cmakedefine HAVE_POLL 1
-+
-+/* Define to 1 if you have the `socket' function. */
-+#cmakedefine HAVE_SOCKET 1
-+
-+/* Define to 1 if you have the <stdint.h> header file. */
-+#cmakedefine HAVE_STDINT_H 1
-+
-+/* Define to 1 if you have the <stdlib.h> header file. */
-+#cmakedefine HAVE_STDLIB_H 1
-+
-+/* Define to 1 if you have the `strchr' function. */
-+#cmakedefine HAVE_STRCHR 1
-+
-+/* Define to 1 if you have the `strdup' function. */
-+#cmakedefine HAVE_STRDUP 1
-+
-+/* Define to 1 if you have the `strerror' function. */
-+#cmakedefine HAVE_STRERROR 1
-+
-+/* Define to 1 if you have the <strings.h> header file. */
-+#cmakedefine HAVE_STRINGS_H 1
-+
-+/* Define to 1 if you have the <string.h> header file. */
-+#cmakedefine HAVE_STRING_H 1
-+
-+/* Define to 1 if you have the `strtol' function. */
-+#cmakedefine HAVE_STRTOL 1
-+
-+/* Define to 1 if you have the <sys/socket.h> header file. */
-+#cmakedefine HAVE_SYS_SOCKET_H 1
-+
-+/* Define to 1 if you have the <sys/stat.h> header file. */
-+#cmakedefine HAVE_SYS_STAT_H 1
-+
-+/* Define to 1 if you have the <sys/time.h> header file. */
-+#cmakedefine HAVE_SYS_TIME_H 1
-+
-+/* Define to 1 if you have the <sys/types.h> header file. */
-+#cmakedefine HAVE_SYS_TYPES_H 1
-+
-+/* Define to 1 if you have the <sys/utsname.h> header file. */
-+#cmakedefine HAVE_SYS_UTSNAME_H 1
-+
-+/* Define to 1 if you have the <unistd.h> header file. */
-+#cmakedefine HAVE_UNISTD_H 1
-+
-+/* Define to 1 if IPv6 support is available. */
-+#cmakedefine ZOO_IPV6_ENABLED 1
-+
-+/* poll() second argument type */
-+#define POLL_NFDS_TYPE nfds_t
-+
-+/* Name of package */
-+#define PACKAGE "${PROJECT_NAME}"
-+
-+/* Define to the address where bug reports for this package should be sent. */
-+#define PACKAGE_BUGREPORT "${email}"
-+
-+/* Define to the full name of this package. */
-+#define PACKAGE_NAME "${description}"
-+
-+/* Define to the full name and version of this package. */
-+#define PACKAGE_STRING "${description} ${PROJECT_VERSION}"
-+
-+/* Define to the one symbol short name of this package. */
-+#define PACKAGE_TARNAME "${PROJECT_NAME}"
-+
-+/* Define to the version of this package. */
-+#define PACKAGE_VERSION "${PROJECT_VERSION}"
-+
-+/* Version number of package */
-+#define VERSION "${PROJECT_VERSION}"
-+
-+#endif
-diff --git c/src/c/include/winconfig.h w/src/c/include/winconfig.h
-index ed33aa6e5..725d1624b 100644
---- c/src/c/include/winconfig.h
-+++ w/src/c/include/winconfig.h
-@@ -1,164 +1,15 @@
--/* Define to 1 if you have the <arpa/inet.h> header file. */
--#undef HAVE_ARPA_INET_H
--
--/* Define to 1 if you have the <dlfcn.h> header file. */
--#undef HAVE_DLFCN_H
--
--/* Define to 1 if you have the <fcntl.h> header file. */
--#undef HAVE_FCNTL_H
--
--/* Define to 1 if you have the file `generated/zookeeper.jute.c'. */
--#define HAVE_GENERATED_ZOOKEEPER_JUTE_C 1
--
--/* Define to 1 if you have the file `generated/zookeeper.jute.h'. */
--#define HAVE_GENERATED_ZOOKEEPER_JUTE_H 1
--
--/* Define to 1 if you have the `getcwd' function. */
--#undef HAVE_GETCWD
--
--/* Define to 1 if you have the `gethostbyname' function. */
--#undef HAVE_GETHOSTBYNAME
--
--/* Define to 1 if you have the `gethostname' function. */
--#define HAVE_GETHOSTNAME 1
--
--/* Define to 1 if you have the `getlogin' function. */
--#undef HAVE_GETLOGIN
--
--/* Define to 1 if you have the `getpwuid_r' function. */
--#undef HAVE_GETPWUID_R
--
--/* Define to 1 if you have the `gettimeofday' function. */
--#undef HAVE_GETTIMEOFDAY
--
--/* Define to 1 if you have the `getuid' function. */
--#undef HAVE_GETUID
--
--/* Define to 1 if you have the <inttypes.h> header file. */
--#undef HAVE_INTTYPES_H
--
--/* Define to 1 if you have the `memmove' function. */
--#undef HAVE_MEMMOVE
--
--/* Define to 1 if you have the <memory.h> header file. */
--#undef HAVE_MEMORY_H
--
--/* Define to 1 if you have the `memset' function. */
--#undef HAVE_MEMSET
--
--/* Define to 1 if you have the <netdb.h> header file. */
--#undef HAVE_NETDB_H
--
--/* Define to 1 if you have the <netinet/in.h> header file. */
--#undef HAVE_NETINET_IN_H
--
--/* Define to 1 if you have the `poll' function. */
--#undef HAVE_POLL
--
--/* Define to 1 if you have the `socket' function. */
--#undef HAVE_SOCKET
--
--/* Define to 1 if you have the <stdint.h> header file. */
--#undef HAVE_STDINT_H
--
--/* Define to 1 if you have the <stdlib.h> header file. */
--#define HAVE_STDLIB_H 1
--
--/* Define to 1 if you have the `strchr' function. */
--#define HAVE_STRCHR 1
--
--/* Define to 1 if you have the `strdup' function. */
--#define HAVE_STRDUP 1
--
--/* Define to 1 if you have the `strerror' function. */
--#define HAVE_STRERROR 1
--
--/* Define to 1 if you have the <strings.h> header file. */
--#undef HAVE_STRINGS_H
--
--/* Define to 1 if you have the <string.h> header file. */
--#undef HAVE_STRING_H
--
--/* Define to 1 if you have the `strtol' function. */
--#undef HAVE_STRTOL
--
--/* Define to 1 if you have the <sys/socket.h> header file. */
--#undef HAVE_SYS_SOCKET_H
--
--/* Define to 1 if you have the <sys/stat.h> header file. */
--#undef HAVE_SYS_STAT_H
--
--/* Define to 1 if you have the <sys/time.h> header file. */
--#undef HAVE_SYS_TIME_H
--
--/* Define to 1 if you have the <sys/types.h> header file. */
--#undef HAVE_SYS_TYPES_H
--
--/* Define to 1 if you have the <sys/utsname.h> header file. */
--#undef HAVE_SYS_UTSNAME_H
--
--/* Define to 1 if you have the <unistd.h> header file. */
--#undef HAVE_UNISTD_H
--
--/* Define to the sub-directory in which libtool stores uninstalled libraries.
--   */
--#define LT_OBJDIR
--
--/* Define to 1 if your C compiler doesn't accept -c and -o together. */
--/* #undef NO_MINUS_C_MINUS_O */
--
--/* Name of package */
--#define PACKAGE "c-client-src"
--
--/* Define to the address where bug reports for this package should be sent. */
--#define PACKAGE_BUGREPORT "user@zookeeper.apache.org"
--
--/* Define to the full name of this package. */
--#define PACKAGE_NAME "zookeeper C client"
--
--/* Define to the full name and version of this package. */
--#define PACKAGE_STRING "zookeeper C client 3.5.2 win32"
--
--/* Define to the one symbol short name of this package. */
--#define PACKAGE_TARNAME "c-client-src"
--
--/* Define to the home page for this package. */
--#define PACKAGE_URL ""
--
--/* Define to the version of this package. */
--#define PACKAGE_VERSION "3.5.2"
--
--/* poll() second argument type */
--#define POLL_NFDS_TYPE
--
--/* Define to 1 if you have the ANSI C header files. */
--#define STDC_HEADERS
--
--/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
--#define TIME_WITH_SYS_TIME
--
--/* Version number of package */
--#define VERSION "3.5.2"
--
--/* Define to empty if `const' does not conform to ANSI C. */
--/* #undef const */
-+#ifndef WINCONFIG_H_
-+#define WINCONFIG_H_
- 
- /* Define to `__inline__' or `__inline' if that's what the C compiler
-    calls it, or to nothing if 'inline' is not supported under any name.  */
- #ifndef __cplusplus
- #define inline __inline
- #endif
--#ifdef WIN32
-+
- #define __attribute__(x)
- #define __func__ __FUNCTION__
- 
--#ifndef _WIN32_WINNT_NT4
--#define _WIN32_WINNT_NT4 0x0400
--#endif
--
--#define NTDDI_VERSION _WIN32_WINNT_NT4
--#define _WIN32_WINNT _WIN32_WINNT_NT4
--
- #define _CRT_SECURE_NO_WARNINGS
- #define WIN32_LEAN_AND_MEAN
- #include <Windows.h>
-@@ -171,12 +22,17 @@
- #undef max
- 
- #include <errno.h>
-+#include <stdlib.h>
- 
- #define strtok_r strtok_s
- #define localtime_r(a,b) localtime_s(b,a)
- #define get_errno() errno=GetLastError()
--#define random rand
-+
-+inline int __cdecl random() { return rand(); }
-+
-+#if ((defined(_MSC_VER) && _MSC_VER < 1900) || !defined(_MSC_VER))
- #define snprintf _snprintf
-+#endif
- 
- #define ACL ZKACL  // Conflict with windows API
- 
-@@ -192,5 +48,6 @@
- #define EINPROGRESS WSAEINPROGRESS
- #endif
- 
--typedef int pid_t;
-+typedef DWORD pid_t;
-+
- #endif
-diff --git c/src/c/include/winstdint.h w/src/c/include/winstdint.h
-index d02608a59..2470199e5 100644
---- c/src/c/include/winstdint.h
-+++ w/src/c/include/winstdint.h
-@@ -100,16 +100,6 @@ typedef uint16_t  uint_least16_t;
- typedef uint32_t  uint_least32_t;
- typedef uint64_t  uint_least64_t;
- 
--// 7.18.1.3 Fastest minimum-width integer types
--typedef int8_t    int_fast8_t;
--typedef int16_t   int_fast16_t;
--typedef int32_t   int_fast32_t;
--typedef int64_t   int_fast64_t;
--typedef uint8_t   uint_fast8_t;
--typedef uint16_t  uint_fast16_t;
--typedef uint32_t  uint_fast32_t;
--typedef uint64_t  uint_fast64_t;
--
- // 7.18.1.4 Integer types capable of holding object pointers
- #ifdef _WIN64 // [
-    typedef signed __int64    intptr_t;
-@@ -126,7 +116,7 @@ typedef uint64_t  uintmax_t;
- 
- // 7.18.2 Limits of specified-width integer types
- 
--#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
-+#if (_MSC_VER < 1900) && (!defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)) // [   See footnote 220 at page 257 and footnote 221 at page 259
- 
- // 7.18.2.1 Limits of exact-width integer types
- #define INT8_MIN     ((int8_t)_I8_MIN)
-@@ -223,7 +213,7 @@ typedef uint64_t  uintmax_t;
- 
- // 7.18.4 Limits of other integer types
- 
--#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
-+#if (_MSC_VER < 1900) && (!defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)) // [   See footnote 224 at page 260
- 
- // 7.18.4.1 Macros for minimum-width integer constants
- 
-diff --git c/src/c/include/zookeeper.h w/src/c/include/zookeeper.h
-index 18a203d75..f51ab7512 100644
---- c/src/c/include/zookeeper.h
-+++ w/src/c/include/zookeeper.h
-@@ -20,12 +20,17 @@
- #define ZOOKEEPER_H_
- 
- #include <stdlib.h>
--#ifndef WIN32
-+
-+#include "config.h"
-+
-+#ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
-+#endif
-+
-+#ifdef HAVE_SYS_TIME_H
- #include <sys/time.h>
--#else
--#include "winconfig.h"
- #endif
-+
- #include <stdio.h>
- #include <ctype.h>
- 
-diff --git c/src/c/src/load_gen.c w/src/c/src/load_gen.c
-index b062af6dd..886fe1b3e 100644
---- c/src/c/src/load_gen.c
-+++ w/src/c/src/load_gen.c
-@@ -19,13 +19,9 @@
- #include <zookeeper.h>
- #include "zookeeper_log.h"
- #include <errno.h>
--#ifndef WIN32
- #ifdef THREADED 
- #include <pthread.h>
- #endif
--#else
--#include "win32port.h"
--#endif
- #include <string.h>
- #include <stdlib.h>
- 
-diff --git c/src/c/src/mt_adaptor.c w/src/c/src/mt_adaptor.c
-index fe4792a17..38cced425 100644
---- c/src/c/src/mt_adaptor.c
-+++ w/src/c/src/mt_adaptor.c
-@@ -19,7 +19,7 @@
- #define THREADED
- #endif
- 
--#ifndef DLL_EXPORT
-+#if !defined(DLL_EXPORT) && !defined(USE_STATIC_LIB)
- #  define USE_STATIC_LIB
- #endif
- 
-@@ -375,8 +375,7 @@ void *do_io(void *v)
-         int interest;
-         int timeout;
-         int maxfd=1;
--        int rc;
--        
-+
-         zookeeper_interest(zh, &fd, &interest, &tv);
-         if (fd != -1) {
-             fds[1].fd=fd;
-@@ -449,7 +448,7 @@ void *do_io(void *v)
- 
- #endif
-         // dispatch zookeeper events
--        rc = zookeeper_process(zh, interest);
-+        zookeeper_process(zh, interest);
-         // check the current state of the zhandle and terminate 
-         // if it is_unrecoverable()
-         if(is_unrecoverable(zh))
-diff --git c/src/c/src/zk_log.c w/src/c/src/zk_log.c
-index afe030097..009234a2a 100644
---- c/src/c/src/zk_log.c
-+++ w/src/c/src/zk_log.c
-@@ -16,7 +16,7 @@
-  * limitations under the License.
-  */
- 
--#ifndef DLL_EXPORT
-+#if !defined(DLL_EXPORT) && !defined(USE_STATIC_LIB)
- #  define USE_STATIC_LIB
- #endif
- 
-diff --git c/src/c/src/zookeeper.c w/src/c/src/zookeeper.c
-index 7549d4897..b4079861f 100644
---- c/src/c/src/zookeeper.c
-+++ w/src/c/src/zookeeper.c
-@@ -16,7 +16,7 @@
-  * limitations under the License.
-  */
- 
--#ifndef DLL_EXPORT
-+#if !defined(DLL_EXPORT) && !defined(USE_STATIC_LIB)
- #  define USE_STATIC_LIB
- #endif
- 
-@@ -41,18 +41,33 @@
- #include <stdarg.h>
- #include <limits.h>
- 
--#ifndef _WIN32
-+#ifdef HAVE_SYS_TIME_H
- #include <sys/time.h>
-+#endif
-+
-+#ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
-+#endif
-+
-+#ifdef HAVE_POLL
- #include <poll.h>
-+#endif
-+
-+#ifdef HAVE_NETINET_IN_H
- #include <netinet/in.h>
- #include <netinet/tcp.h>
-+#endif
-+
-+#ifdef HAVE_ARPA_INET_H
- #include <arpa/inet.h>
-+#endif
-+
-+#ifdef HAVE_NETDB_H
- #include <netdb.h>
-+#endif
-+
-+#ifdef HAVE_UNISTD_H
- #include <unistd.h> // needed for _POSIX_MONOTONIC_CLOCK
--#include "config.h"
--#else
--#include "winstdint.h"
- #endif
- 
- #ifdef HAVE_SYS_UTSNAME_H


[5/9] mesos git commit: Windows: Switched to default CRT linkage.

Posted by an...@apache.org.
Windows: Switched to default CRT linkage.

We previously attempted to manually override the CRT to be static
everywhere. Not only did this emit warnings, it was also error-prone
and unnecessary. We can, and should, just use the defaults, which is
`/MDd` in debug mode (multi-threaded, dynamic, debug linkage). Linking
to the CRT dynamically results in smaller libraries and executables,
reduces linking time, and avoids bugs when sharing allocated memory
across modules.

Review: https://reviews.apache.org/r/66010


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b9abc386
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b9abc386
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b9abc386

Branch: refs/heads/master
Commit: b9abc386ec64e99ddc4a2f8791b9f0cf0674669c
Parents: 6613e6a
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Mar 8 15:49:20 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 cmake/CompilationConfigure.cmake | 26 --------------------------
 1 file changed, 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b9abc386/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 7419024..64cc56e 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -316,14 +316,7 @@ if (WIN32)
   # Build against the multi-threaded version of the C runtime library (CRT).
   if (BUILD_SHARED_LIBS)
     message(WARNING "Building with shared libraries is a work-in-progress.")
-
     set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
-
-    # Use dynamic CRT.
-    set(CRT " /MD")
-  else ()
-    # Use static CRT.
-    set(CRT " /MT")
   endif ()
 
   if (ENABLE_SSL)
@@ -338,25 +331,6 @@ if (WIN32)
   # Force use of Unicode C and C++ Windows APIs.
   add_definitions(-DUNICODE -D_UNICODE)
 
-  # NOTE: We APPEND ${CRT} rather than REPLACE so it gets picked up by
-  # dependencies.
-  foreach (lang C CXX)
-    # Debug library for debug configuration, release otherwise.
-
-    # Handle single-configuration generators such as Ninja.
-    if (CMAKE_BUILD_TYPE MATCHES Debug)
-      string(APPEND CMAKE_${lang}_FLAGS "${CRT}d")
-    else ()
-      string(APPEND CMAKE_${lang}_FLAGS ${CRT})
-    endif ()
-
-    # Handle multi-configuration generators such as Visual Studio.
-    string(APPEND CMAKE_${lang}_FLAGS_DEBUG "${CRT}d")
-    foreach (config RELEASE RELWITHDEBINFO MINSIZEREL)
-      string(APPEND CMAKE_${lang}_FLAGS_${config} ${CRT})
-    endforeach ()
-  endforeach ()
-
   # Convenience flags to simplify Windows support in C++ source; used to
   # `#ifdef` out some platform-specific parts of Mesos.  We choose to define
   # a new flag rather than using an existing flag (`_WIN32`) because we want


[9/9] mesos git commit: CMake: Patched Boost to remove spurious warnings.

Posted by an...@apache.org.
CMake: Patched Boost to remove spurious warnings.

On Windows, Boost explicitly checks if it's being compiled with a
compiler version they've tested. As we tend to update Visual Studio
whenever a stable update is available, this leads to a Boost warning,
"Unknown compiler version..." being emitted repeatedly (for every file
which includes a Boost header).

If it were emitted once, we would leave it be, but because it's
repeated hundreds of times, and is mostly harmless, we patch the build
to remove the warning itself. Unfortunately, there is no compile-time
option to disable the warning instead of a patch.

Note that it is not straight-forward to generate a patch file for
Boost. The steps were: clone the Boost repo recursively, go the
`libs/config` submodule, edit the `visualc.hpp` file, go to the
`include` subdirectory, and use `git diff --relative` to generate the
patch with the corrects paths expected for the extracted tarball.

Review: https://reviews.apache.org/r/66046


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3459072c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3459072c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3459072c

Branch: refs/heads/master
Commit: 3459072c8f003424b9ceea3d7b8029487b04aa6b
Parents: 80cb716
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Tue Mar 13 14:20:15 2018 -0700
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt     |  4 ++++
 3rdparty/boost-1.65.0.patch | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3459072c/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index b438f0a..2b63b58 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -186,9 +186,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
 endif ()
 target_include_directories(boost INTERFACE ${BOOST_ROOT})
 
+# Patch Boost to avoid repeated "Unknown compiler warnings" on Windows.
+PATCH_CMD(BOOST_PATCH_CMD boost-${BOOST_VERSION}.patch)
+
 ExternalProject_Add(
   ${BOOST_TARGET}
   PREFIX            ${BOOST_CMAKE_ROOT}
+  PATCH_COMMAND     ${BOOST_PATCH_CMD}
   CONFIGURE_COMMAND ${CMAKE_NOOP}
   BUILD_COMMAND     ${CMAKE_NOOP}
   INSTALL_COMMAND   ${CMAKE_NOOP}

http://git-wip-us.apache.org/repos/asf/mesos/blob/3459072c/3rdparty/boost-1.65.0.patch
----------------------------------------------------------------------
diff --git a/3rdparty/boost-1.65.0.patch b/3rdparty/boost-1.65.0.patch
new file mode 100644
index 0000000..75be3bc
--- /dev/null
+++ b/3rdparty/boost-1.65.0.patch
@@ -0,0 +1,18 @@
+diff --git c/boost/config/compiler/visualc.hpp i/boost/config/compiler/visualc.hpp
+index c0557de71..c06eaea45 100644
+--- c/boost/config/compiler/visualc.hpp
++++ i/boost/config/compiler/visualc.hpp
+@@ -319,13 +319,3 @@
+ 
+ #  define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
+ #endif
+-
+-//
+-// last known and checked version is 19.10.25017 (VC++ 2017):
+-#if (_MSC_VER > 1910)
+-#  if defined(BOOST_ASSERT_CONFIG)
+-#     error "Unknown compiler version - please run the configure tests and report the results"
+-#  else
+-#     pragma message("Unknown compiler version - please run the configure tests and report the results")
+-#  endif
+-#endif