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/08 00:26:29 UTC

[1/5] mesos git commit: Windows: Fixed CMake configuration for Ninja.

Repository: mesos
Updated Branches:
  refs/heads/master cece83f37 -> 0a4a900e5


Windows: Fixed CMake configuration for Ninja.

Only the Visual Studio generator(s) should check the toolset. The
Ninja generator requires the environment to be setup in advance, and
does not have the concept of a toolset, so this warning broke the
Ninja build.

Instead of warning that we're deprecating some arbitrary generator, we
should just say we don't officially support it so the user knows it
may not work as expected.

Fixed the assumption that all generators on Windows are
multi-configuration. Ninja is single-configuration, so the debug CRT
flag must sometimes be set for `CMAKE_CXX_FLAGS` depending on
`CMAKE_BUILD_TYPE`.

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


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

Branch: refs/heads/master
Commit: 82be06436a2a1e2919187695660986651d802343
Parents: cece83f
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Feb 16 15:27:40 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Wed Mar 7 13:35:38 2018 -0800

----------------------------------------------------------------------
 cmake/CompilationConfigure.cmake | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/82be0643/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 50cddf9..efee36c 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -52,7 +52,7 @@ if (ENABLE_PRECOMPILED_HEADERS)
   set(COTIRE_VERBOSE ${VERBOSE})
 endif ()
 
-if (WIN32)
+if (CMAKE_GENERATOR MATCHES "Visual Studio")
   # In MSVC 1900, there are two bugs in the linker, one that causes linking
   # libmesos to occasionally take hours, and one that causes us to be able to
   # fail to open the `mesos-x.lib` file. These have been confirmed as bugs with
@@ -192,7 +192,7 @@ if (WIN32)
   if (NOT CMAKE_GENERATOR MATCHES ${PREFERRED_GENERATOR})
     message(
       WARNING
-      "Mesos is deprecating support for ${CMAKE_GENERATOR}. "
+      "Mesos does not officially support ${CMAKE_GENERATOR}. "
       "Please use ${PREFERRED_GENERATOR}.")
   endif ()
 
@@ -325,10 +325,17 @@ if (WIN32)
     # 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.
-    string(APPEND CMAKE_${lang}_FLAGS_DEBUG "${CRT}d")
+    # Debug library for debug configuration, release otherwise.
 
-    # All other configurations.
+    # 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 ()


[5/5] mesos git commit: Fixed implicit conversion warnings.

Posted by an...@apache.org.
Fixed implicit conversion warnings.

This patch fixes three new "possible loss of data" implicit conversion
warnings by using `static_cast` to the LHS type.

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


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

Branch: refs/heads/master
Commit: 0a4a900e5707a76269b18f3062fff070f69ff911
Parents: 9036951
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Wed Mar 7 10:28:09 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Wed Mar 7 16:25:20 2018 -0800

----------------------------------------------------------------------
 src/docker/docker.cpp                           | 7 ++++---
 src/slave/containerizer/fetcher.cpp             | 4 ++--
 src/slave/containerizer/mesos/containerizer.cpp | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0a4a900e/src/docker/docker.cpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index bb81c4d..d000a90 100644
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -621,14 +621,15 @@ Try<Docker::RunOptions> Docker::RunOptions::create(
     // TODO(yifan): Support other resources (e.g. disk).
     Option<double> cpus = resources->cpus();
     if (cpus.isSome()) {
-      options.cpuShares =
-        std::max((uint64_t) (CPU_SHARES_PER_CPU * cpus.get()), MIN_CPU_SHARES);
+      options.cpuShares = std::max(
+          static_cast<uint64_t>(CPU_SHARES_PER_CPU * cpus.get()),
+          MIN_CPU_SHARES);
 
       if (enableCfsQuota) {
         const Duration quota =
           std::max(CPU_CFS_PERIOD * cpus.get(), MIN_CPU_CFS_QUOTA);
 
-        options.cpuQuota = quota.us();
+        options.cpuQuota = static_cast<uint64_t>(quota.us());
       }
     }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/0a4a900e/src/slave/containerizer/fetcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/fetcher.cpp b/src/slave/containerizer/fetcher.cpp
index a49411b..f9ab554 100644
--- a/src/slave/containerizer/fetcher.cpp
+++ b/src/slave/containerizer/fetcher.cpp
@@ -258,13 +258,13 @@ FetcherProcess::Metrics::Metrics(FetcherProcess *fetcher)
         "containerizer/fetcher/cache_size_total_bytes",
         [=]() {
           // This value is safe to read while it is concurrently updated.
-          return fetcher->cache.totalSpace().bytes();
+          return static_cast<double>(fetcher->cache.totalSpace().bytes());
         }),
     cache_size_used_bytes(
         "containerizer/fetcher/cache_size_used_bytes",
         [=]() {
           // This value is safe to read while it is concurrently updated.
-          return fetcher->cache.usedSpace().bytes();
+          return static_cast<double>(fetcher->cache.usedSpace().bytes());
         })
 {
   process::metrics::add(task_fetches_succeeded);

http://git-wip-us.apache.org/repos/asf/mesos/blob/0a4a900e/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index a61ed5b..7473a87 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -769,7 +769,7 @@ Future<Nothing> MesosContainerizerProcess::recover(
     // successfully launched, therefore we can assume checkpointed
     // containers should be running after recover.
     container->state = RUNNING;
-    container->pid = state.pid();
+    container->pid = static_cast<pid_t>(state.pid());
     container->directory = state.directory();
 
     // Attempt to read the launch config of the container.


[2/5] mesos git commit: Windows: Fixed location of imported libraries for Ninja.

Posted by an...@apache.org.
Windows: Fixed location of imported libraries for Ninja.

The Ninja generator does not emit binaries to "Debug" or "Release"
folders (unlike the Visual Studio generator), as it is not a
multi-configuration generator. To fix this, we explicitly set the
`IMPORTED_LOCATION` instead of `IMPORTED_LOCATION_(DEBUG|RELEASE)`
when using the Ninja generator on Windows. This does not reuse the
location used on non-Windows platforms, as they're not consistent
despite the generator being the same.

This also simplifies the `GET_BYPRODUCTS` function to set `BYPRODUCTS`
to an empty string when the generator is not Ninja, as it should be a
no-op for other generators.

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


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

Branch: refs/heads/master
Commit: e94922f1ef10cdb01ceaef6b1521f79f40c0b26b
Parents: 2a43dbb
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Feb 16 15:30:40 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Wed Mar 7 13:38:04 2018 -0800

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt | 223 +++++++++++++++++++++++++++++++------------
 1 file changed, 161 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e94922f1/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 2e1015b..61dc788 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -154,16 +154,14 @@ endfunction()
 # explicitly set.
 # https://cmake.org/pipermail/cmake/2015-April/060234.html
 function(GET_BYPRODUCTS TARGET)
-  if (WIN32)
-    get_target_property(DEBUG ${TARGET} IMPORTED_LOCATION_DEBUG)
-    get_target_property(RELEASE ${TARGET} IMPORTED_LOCATION_RELEASE)
-    set(BYPRODUCTS ${DEBUG} ${RELEASE})
-  else ()
-    get_target_property(BYPRODUCTS ${TARGET} IMPORTED_LOCATION)
-  endif ()
-
   string(TOUPPER ${TARGET} NAME)
-  set(${NAME}_BYPRODUCTS ${BYPRODUCTS} PARENT_SCOPE)
+  if (CMAKE_GENERATOR MATCHES "Ninja")
+    get_target_property(BYPRODUCTS ${TARGET} IMPORTED_LOCATION)
+    set(${NAME}_BYPRODUCTS ${BYPRODUCTS} PARENT_SCOPE)
+  else ()
+    # Make this function a no-op when not using Ninja.
+    set(${NAME}_BYPRODUCTS "" PARENT_SCOPE)
+  endif()
 endfunction()
 
 
@@ -218,11 +216,20 @@ if (WIN32)
 
   set_target_properties(
     sasl2 PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${SASL2_ROOT}-build/Debug/libsasl2${LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${SASL2_ROOT}-build/Release/libsasl2${LIBRARY_SUFFIX}
     INTERFACE_INCLUDE_DIRECTORIES ${SASL2_ROOT}-build/include
     INTERFACE_COMPILE_DEFINITIONS LIBSASL_EXPORTS=1)
 
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      sasl2 PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${SASL2_ROOT}-build/Debug/libsasl2${LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${SASL2_ROOT}-build/Release/libsasl2${LIBRARY_SUFFIX})
+  else ()
+    set_target_properties(
+      sasl2 PROPERTIES
+      IMPORTED_LOCATION ${SASL2_ROOT}-build/libsasl2${LIBRARY_SUFFIX})
+  endif ()
+
   # Patch SASL to include a minimal CMake build system which encompasses
   # only the parts that Mesos relies on (CRAM MD5).
   PATCH_CMD(SASL2_PATCH_CMD cyrus-sasl-${SASL2_VERSION}.patch)
@@ -296,14 +303,24 @@ if (WIN32)
 
   set_target_properties(
     glog PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${GLOG_ROOT}-build/Debug/glog${LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${GLOG_ROOT}-build/Release/glog${LIBRARY_SUFFIX}
-    IMPORTED_IMPLIB_DEBUG ${GLOG_ROOT}-build/Debug/glog${CMAKE_IMPORT_LIBRARY_SUFFIX}
-    IMPORTED_IMPLIB_RELEASE ${GLOG_ROOT}-build/Release/glog${CMAKE_IMPORT_LIBRARY_SUFFIX}
     INTERFACE_INCLUDE_DIRECTORIES ${GLOG_ROOT}/src/windows
     # TODO(andschwa): Remove this when glog is updated.
     IMPORTED_LINK_INTERFACE_LIBRARIES DbgHelp
     INTERFACE_COMPILE_DEFINITIONS "${GLOG_COMPILE_DEFINITIONS}")
+
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      glog PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${GLOG_ROOT}-build/Debug/glog${LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${GLOG_ROOT}-build/Release/glog${LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB_DEBUG ${GLOG_ROOT}-build/Debug/glog${CMAKE_IMPORT_LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB_RELEASE ${GLOG_ROOT}-build/Release/glog${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  else ()
+    set_target_properties(
+      glog PROPERTIES
+      IMPORTED_LOCATION ${GLOG_ROOT}-build/glog${LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB ${GLOG_ROOT}-build/glog${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  endif ()
 else ()
   # TODO(andschwa): Build with CMake instead when glog is updated.
   set(GLOG_CONFIG_CMD  ${GLOG_ROOT}/src/../configure --with-pic GTEST_CONFIG=no --prefix=${GLOG_ROOT}-build)
@@ -393,10 +410,16 @@ set_target_properties(
   INTERFACE_INCLUDE_DIRECTORIES ${HTTP_PARSER_ROOT})
 
 if (WIN32)
-  set_target_properties(
-    http_parser PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${HTTP_PARSER_ROOT}-build/Debug/http_parser${CMAKE_STATIC_LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${HTTP_PARSER_ROOT}-build/Release/http_parser${CMAKE_STATIC_LIBRARY_SUFFIX})
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      http_parser PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${HTTP_PARSER_ROOT}-build/Debug/http_parser${CMAKE_STATIC_LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${HTTP_PARSER_ROOT}-build/Release/http_parser${CMAKE_STATIC_LIBRARY_SUFFIX})
+  else ()
+    set_target_properties(
+      http_parser PROPERTIES
+      IMPORTED_LOCATION ${HTTP_PARSER_ROOT}-build/http_parser${CMAKE_STATIC_LIBRARY_SUFFIX})
+  endif ()
 else ()
   set_target_properties(
     http_parser PROPERTIES
@@ -438,10 +461,16 @@ if (ENABLE_LIBEVENT)
     INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT_ROOT}/include;${LIBEVENT_ROOT}-build/include")
 
   if (WIN32)
-    set_target_properties(
-      libevent PROPERTIES
-      IMPORTED_LOCATION_DEBUG ${LIBEVENT_ROOT}-build/lib/Debug/event${LIBRARY_SUFFIX}
-      IMPORTED_LOCATION_RELEASE ${LIBEVENT_ROOT}-build/lib/Release/event${LIBRARY_SUFFIX})
+    if (CMAKE_GENERATOR MATCHES "Visual Studio")
+      set_target_properties(
+        libevent PROPERTIES
+        IMPORTED_LOCATION_DEBUG ${LIBEVENT_ROOT}-build/lib/Debug/event${LIBRARY_SUFFIX}
+        IMPORTED_LOCATION_RELEASE ${LIBEVENT_ROOT}-build/lib/Release/event${LIBRARY_SUFFIX})
+    else ()
+      set_target_properties(
+        libevent PROPERTIES
+        IMPORTED_LOCATION ${LIBEVENT_ROOT}-build/lib/event${LIBRARY_SUFFIX})
+    endif ()
   else ()
     set_target_properties(
       libevent PROPERTIES
@@ -515,10 +544,19 @@ if (WIN32)
 
   set_target_properties(
     apr PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${LIBAPR_ROOT}-build/Debug/libapr-1${CMAKE_STATIC_LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${LIBAPR_ROOT}-build/Release/libapr-1${CMAKE_STATIC_LIBRARY_SUFFIX}
     INTERFACE_INCLUDE_DIRECTORIES "${LIBAPR_ROOT}/include;${LIBAPR_ROOT}-build")
 
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      apr PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${LIBAPR_ROOT}-build/Debug/libapr-1${CMAKE_STATIC_LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${LIBAPR_ROOT}-build/Release/libapr-1${CMAKE_STATIC_LIBRARY_SUFFIX})
+  else ()
+    set_target_properties(
+      apr PROPERTIES
+      IMPORTED_LOCATION ${LIBAPR_ROOT}-build/libapr-1${CMAKE_STATIC_LIBRARY_SUFFIX})
+  endif ()
+
   MAKE_INCLUDE_DIR(apr)
   GET_BYPRODUCTS(apr)
 
@@ -596,17 +634,33 @@ if (WIN32)
 
   set_target_properties(
     libcurl PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${CURL_ROOT}-build/lib/Debug/libcurl-d${LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${CURL_ROOT}-build/lib/Release/libcurl${LIBRARY_SUFFIX}
-    IMPORTED_IMPLIB_DEBUG ${CURL_ROOT}-build/lib/Debug/libcurl_imp${CMAKE_IMPORT_LIBRARY_SUFFIX}
-    IMPORTED_IMPLIB_RELEASE ${CURL_ROOT}-build/lib/Release/libcurl_imp${CMAKE_IMPORT_LIBRARY_SUFFIX}
     INTERFACE_INCLUDE_DIRECTORIES ${CURL_ROOT}/include
     INTERFACE_LINK_LIBRARIES crypt32)
 
-  set_target_properties(
-    curl PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${CURL_ROOT}-build/src/Debug/curl-d.exe
-    IMPORTED_LOCATION_RELEASE ${CURL_ROOT}-build/src/Release/curl.exe)
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      libcurl PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${CURL_ROOT}-build/lib/Debug/libcurl-d${LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${CURL_ROOT}-build/lib/Release/libcurl${LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB_DEBUG ${CURL_ROOT}-build/lib/Debug/libcurl_imp${CMAKE_IMPORT_LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB_RELEASE ${CURL_ROOT}-build/lib/Release/libcurl_imp${CMAKE_IMPORT_LIBRARY_SUFFIX})
+
+    set_target_properties(
+      curl PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${CURL_ROOT}-build/src/Debug/curl-d.exe
+      IMPORTED_LOCATION_RELEASE ${CURL_ROOT}-build/src/Release/curl.exe)
+  else ()
+    set_target_properties(
+      libcurl PROPERTIES
+      # TODO(andschwa): Use generator expression to remove `-d` in Release.
+      IMPORTED_LOCATION ${CURL_ROOT}-build/lib/libcurl-d${LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB ${CURL_ROOT}-build/lib/libcurl_imp${CMAKE_IMPORT_LIBRARY_SUFFIX})
+
+    set_target_properties(
+      curl PROPERTIES
+      # TODO(andschwa): Use generator expression to remove `-d` in Release.
+      IMPORTED_LOCATION ${CURL_ROOT}-build/src/curl-d.exe)
+  endif ()
 
   MAKE_INCLUDE_DIR(libcurl)
   GET_BYPRODUCTS(libcurl)
@@ -658,12 +712,23 @@ if (WIN32)
 
   set_target_properties(
     zlib PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${ZLIB_ROOT}-build/Debug/zlib${ZLIB_STATIC}d${ZLIB_SHARED}${LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${ZLIB_ROOT}-build/Release/zlib${ZLIB_STATIC}${ZLIB_SHARED}${LIBRARY_SUFFIX}
-    IMPORTED_IMPLIB_DEBUG ${ZLIB_ROOT}-build/Debug/zlib${ZLIB_STATIC}d${CMAKE_IMPORT_LIBRARY_SUFFIX}
-    IMPORTED_IMPLIB_RELEASE ${ZLIB_ROOT}-build/Release/zlib${ZLIB_STATIC}${CMAKE_IMPORT_LIBRARY_SUFFIX}
     INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_ROOT};${ZLIB_ROOT}-build")
 
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      zlib PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${ZLIB_ROOT}-build/Debug/zlib${ZLIB_STATIC}d${ZLIB_SHARED}${LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${ZLIB_ROOT}-build/Release/zlib${ZLIB_STATIC}${ZLIB_SHARED}${LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB_DEBUG ${ZLIB_ROOT}-build/Debug/zlib${ZLIB_STATIC}d${CMAKE_IMPORT_LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB_RELEASE ${ZLIB_ROOT}-build/Release/zlib${ZLIB_STATIC}${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  else ()
+    set_target_properties(
+      zlib PROPERTIES
+      # TODO(andschwa): Use generator expression to remove `d` in Release.
+      IMPORTED_LOCATION ${ZLIB_ROOT}-build/zlib${ZLIB_STATIC}d${ZLIB_SHARED}${LIBRARY_SUFFIX}
+      IMPORTED_IMPLIB ${ZLIB_ROOT}-build/zlib${ZLIB_STATIC}d${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  endif ()
+
   MAKE_INCLUDE_DIR(zlib)
   GET_BYPRODUCTS(zlib)
 
@@ -716,16 +781,29 @@ set(GOOGLETEST_CMAKE_FORWARD_ARGS ${CMAKE_FORWARD_ARGS})
 
 if (WIN32)
   set_target_properties(
-    gmock PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${GOOGLETEST_ROOT}-build/googlemock/Debug/gmock${CMAKE_STATIC_LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${GOOGLETEST_ROOT}-build/googlemock/Release/gmock${CMAKE_STATIC_LIBRARY_SUFFIX})
-
-  set_target_properties(
     gtest PROPERTIES
     # Silence deprecation warning in the interface of Google Test.
-    INTERFACE_COMPILE_DEFINITIONS _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
-    IMPORTED_LOCATION_DEBUG ${GOOGLETEST_ROOT}-build/googlemock/gtest/Debug/gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${GOOGLETEST_ROOT}-build/googlemock/gtest/Release/gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
+    INTERFACE_COMPILE_DEFINITIONS _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
+
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      gmock PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${GOOGLETEST_ROOT}-build/googlemock/Debug/gmock${CMAKE_STATIC_LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${GOOGLETEST_ROOT}-build/googlemock/Release/gmock${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+    set_target_properties(
+      gtest PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${GOOGLETEST_ROOT}-build/googlemock/gtest/Debug/gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${GOOGLETEST_ROOT}-build/googlemock/gtest/Release/gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
+  else ()
+    set_target_properties(
+      gmock PROPERTIES
+      IMPORTED_LOCATION ${GOOGLETEST_ROOT}-build/googlemock/gmock${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+    set_target_properties(
+      gtest PROPERTIES
+      IMPORTED_LOCATION ${GOOGLETEST_ROOT}-build/googlemock/gtest/gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
+  endif ()
 
   # Silence new deprecation warning in Visual Studio 15.5.
   # NOTE: This has been patched upstream, but we don't patch Google Test.
@@ -781,17 +859,28 @@ set_target_properties(
   INTERFACE_INCLUDE_DIRECTORIES ${PROTOBUF_ROOT}/src)
 
 if (WIN32)
-  set_target_properties(
-    protobuf PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${PROTOBUF_ROOT}-build/Debug/libprotobufd${LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${PROTOBUF_ROOT}-build/Release/libprotobuf${LIBRARY_SUFFIX})
-
   PATCH_CMD(PROTOBUF_PATCH_CMD protobuf-${PROTOBUF_VERSION}.patch)
 
-  set_target_properties(
-    protoc PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${PROTOBUF_ROOT}-build/Debug/protoc.exe
-    IMPORTED_LOCATION_RELEASE ${PROTOBUF_ROOT}-build/Release/protoc.exe)
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      protobuf PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${PROTOBUF_ROOT}-build/Debug/libprotobufd${LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${PROTOBUF_ROOT}-build/Release/libprotobuf${LIBRARY_SUFFIX})
+
+    set_target_properties(
+      protoc PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${PROTOBUF_ROOT}-build/Debug/protoc.exe
+      IMPORTED_LOCATION_RELEASE ${PROTOBUF_ROOT}-build/Release/protoc.exe)
+  else ()
+    set_target_properties(
+      protobuf PROPERTIES
+      # TODO(andschwa): Use generator expression to remove `d` in Release.
+      IMPORTED_LOCATION ${PROTOBUF_ROOT}-build/libprotobufd${LIBRARY_SUFFIX})
+
+    set_target_properties(
+      protoc PROPERTIES
+      IMPORTED_LOCATION ${PROTOBUF_ROOT}-build/protoc.exe)
+  endif ()
 else ()
   # This is for single-configuration generators such as GNU Make.
   if (CMAKE_BUILD_TYPE MATCHES Debug)
@@ -841,15 +930,25 @@ set_target_properties(
 PATCH_CMD(ZOOKEEPER_PATCH_CMD zookeeper-${ZOOKEEPER_VERSION}.patch)
 
 if (WIN32)
-  set_target_properties(
-    zookeeper PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${ZOOKEEPER_ROOT}-build/Debug/zookeeper${CMAKE_STATIC_LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${ZOOKEEPER_ROOT}-build/Release/zookeeper${CMAKE_STATIC_LIBRARY_SUFFIX})
+  if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    set_target_properties(
+      zookeeper PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${ZOOKEEPER_ROOT}-build/Debug/zookeeper${CMAKE_STATIC_LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${ZOOKEEPER_ROOT}-build/Release/zookeeper${CMAKE_STATIC_LIBRARY_SUFFIX})
 
-  set_target_properties(
-    zk-hashtable PROPERTIES
-    IMPORTED_LOCATION_DEBUG ${ZOOKEEPER_ROOT}-build/Debug/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX}
-    IMPORTED_LOCATION_RELEASE ${ZOOKEEPER_ROOT}-build/Release/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX})
+    set_target_properties(
+      zk-hashtable PROPERTIES
+      IMPORTED_LOCATION_DEBUG ${ZOOKEEPER_ROOT}-build/Debug/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX}
+      IMPORTED_LOCATION_RELEASE ${ZOOKEEPER_ROOT}-build/Release/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX})
+  else ()
+    set_target_properties(
+      zookeeper PROPERTIES
+      IMPORTED_LOCATION ${ZOOKEEPER_ROOT}-build/zookeeper${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+    set_target_properties(
+      zk-hashtable PROPERTIES
+      IMPORTED_LOCATION ${ZOOKEEPER_ROOT}-build/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX})
+  endif ()
 else ()
   set_target_properties(
     zookeeper PROPERTIES


[3/5] mesos git commit: Windows: Specified byproducts of `sasl2` imported target.

Posted by an...@apache.org.
Windows: Specified byproducts of `sasl2` imported target.

This is necessary to enable the Ninja build. This was not previously
fixed because we have not yet used Ninja on Windows. The same pattern
is used for other imported targets.

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


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

Branch: refs/heads/master
Commit: 2a43dbb3c42b5a780979b660d2b24226a7890e47
Parents: 82be064
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Feb 16 15:36:32 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Wed Mar 7 13:38:04 2018 -0800

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2a43dbb3/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index da60570..2e1015b 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -228,10 +228,12 @@ if (WIN32)
   PATCH_CMD(SASL2_PATCH_CMD cyrus-sasl-${SASL2_VERSION}.patch)
 
   MAKE_INCLUDE_DIR(sasl2)
+  GET_BYPRODUCTS(sasl2)
 
   ExternalProject_Add(
     ${SASL2_TARGET}
     PREFIX            ${SASL2_CMAKE_ROOT}
+    BUILD_BYPRODUCTS  ${SASL2_BYPRODUCTS}
     PATCH_COMMAND     ${SASL2_PATCH_CMD}
     INSTALL_COMMAND   ${CMAKE_NOOP}
     URL               ${SASL2_URL}


[4/5] mesos git commit: Updated Windows documentation.

Posted by an...@apache.org.
Updated Windows documentation.

This notes that Developer Mode is required for non-admin symlinks,
removes reference to the close JIRA epic, and adds information on how
to build with Ninja on Windows.

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


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

Branch: refs/heads/master
Commit: 9036951b33e131991c9837c4fc5f8379c5edf676
Parents: e94922f
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Wed Mar 7 11:17:30 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Wed Mar 7 16:25:20 2018 -0800

----------------------------------------------------------------------
 docs/windows.md | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9036951b/docs/windows.md
----------------------------------------------------------------------
diff --git a/docs/windows.md b/docs/windows.md
index cf2c7c2..046c569 100644
--- a/docs/windows.md
+++ b/docs/windows.md
@@ -14,7 +14,7 @@ Mesos 1.0.0 introduced experimental support for Windows.
 ### System Requirements
 
 1. Install the latest [Visual Studio 2017](https://www.visualstudio.com/downloads/):
-   The "Community" edition is sufficient (and free).
+   The "Community" edition is sufficient (and free of charge).
    During installation, choose the "Desktop development with C++" workload.
 
 2. Install [CMake 3.8.0](https://cmake.org/download/) or later.
@@ -62,7 +62,7 @@ Following are the instructions for Windows 10.
 
 The current implementation is known to have the following limitations:
 
-* Only the agent should be run on Windows.  The Mesos master can be
+* Only the agent should be run on Windows. The Mesos master can be
   launched, but only for testing as the master does not support
   high-availability setups on Windows.
 
@@ -74,15 +74,38 @@ The current implementation is known to have the following limitations:
   It is likely that this will increase, due to evolving Windows container
   support and developer features which ease porting.
 
+* The ability to [create symlinks][] as a non-admin user requires
+  Developer Mode to be enabled. Otherwise the agent will need to be
+  run under an administrator.
+
 [server]: https://docs.microsoft.com/en-us/windows-server/get-started/get-started-with-1709
+[create symlinks]: https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/
 
 
-## Status
+## Build Configuration Examples
 
-For more information regarding the status of Windows support in Mesos,
-please refer to the [JIRA epic](https://issues.apache.org/jira/browse/MESOS-3094).
+### Building with Ninja
+
+Instead of using MSBuild, it is also possible to build Mesos on
+Windows using [Ninja](https://ninja-build.org/), which can result in
+significantly faster builds. To use Ninja, you need to download it and
+ensure `ninja.exe` is in your `PATH`.
+
+* Download the [Windows binary](https://github.com/ninja-build/ninja/releases).
+* Unzip it and place `ninja.exe` in your `PATH`.
+* Open an "x64 Native Tools Command Prompt for VS 2017" to set your
+  environment.
+* In that command prompt, type `powershell` to use a better shell.
+* Similar to above, configure CMake with
+  `cmake .. -G Ninja -DENABLE_LIBEVENT=1`.
+* Now you can use `ninja` to build the various targets.
+* You may want to use `ninja -v` to make it verbose, as it's otherwise
+  very quiet.
+
+Note that with Ninja it is imperative to open the correct developer
+command prompt so that the 64-bit build tools are used, as Ninja does
+not otherwise know how to find them.
 
-## Build Configuration Examples
 
 ### Building with Java