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 2017/12/15 23:59:25 UTC

[1/6] mesos git commit: Windows: Patched protobuf to fix warnings.

Repository: mesos
Updated Branches:
  refs/heads/master 071e8cfbe -> 3eaab8a2e


Windows: Patched protobuf to fix warnings.

The patch was generated by diffing the following commit against tag
v3.5.0, this was merged upstream in
https://github.com/google/protobuf/pull/4000:

commit 80809271a
Author: Rodrigo Hernandez <kw...@aeongames.com>
Date:   Mon Dec 4 19:04:42 2017 -0600

    Using binary one's complement to negate an unsigned int

    This removes a Visual Studio warning:

    warning C4146: unary minus operator applied to unsigned type, result
    still unsigned.

And the addition of three static casts to make the return of
`std::distance` match the LHS type.

With the patch applied, we can stop disabling all warnings for protobuf
code (which didn't entirely work anyway, because these warnings were in
public headers included everywhere in Mesos).


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

Branch: refs/heads/master
Commit: 3eaab8a2e37e6d9c3a7e74123611637d20aa9729
Parents: bd7b1f3
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Wed Dec 13 16:01:52 2017 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Fri Dec 15 15:57:56 2017 -0800

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt       |  3 +++
 3rdparty/protobuf-3.5.0.patch | 46 ++++++++++++++++++++++++++++++++++++++
 src/CMakeLists.txt            |  5 -----
 3 files changed, 49 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3eaab8a2/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index dbbe75a..d9f52e2 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -783,6 +783,8 @@ if (WIN32)
     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
@@ -808,6 +810,7 @@ GET_BYPRODUCTS(protobuf)
 ExternalProject_Add(
   ${PROTOBUF_TARGET}
   PREFIX            ${PROTOBUF_CMAKE_ROOT}
+  PATCH_COMMAND     ${PROTOBUF_PATCH_CMD}
   BUILD_BYPRODUCTS  ${PROTOBUF_BYPRODUCTS}
   SOURCE_SUBDIR     cmake
   CMAKE_ARGS        ${CMAKE_FORWARD_ARGS};-Dprotobuf_BUILD_TESTS=OFF

http://git-wip-us.apache.org/repos/asf/mesos/blob/3eaab8a2/3rdparty/protobuf-3.5.0.patch
----------------------------------------------------------------------
diff --git a/3rdparty/protobuf-3.5.0.patch b/3rdparty/protobuf-3.5.0.patch
new file mode 100644
index 0000000..19da2c7
--- /dev/null
+++ b/3rdparty/protobuf-3.5.0.patch
@@ -0,0 +1,46 @@
+diff --git c/src/google/protobuf/repeated_field.h w/src/google/protobuf/repeated_field.h
+index 8eb6c795b..faa930523 100644
+--- c/src/google/protobuf/repeated_field.h
++++ w/src/google/protobuf/repeated_field.h
+@@ -86,7 +86,7 @@ void LogIndexOutOfBounds(int index, int size);
+ 
+ template <typename Iter>
+ inline int CalculateReserve(Iter begin, Iter end, std::forward_iterator_tag) {
+-  return std::distance(begin, end);
++  return static_cast<int>(std::distance(begin, end));
+ }
+ 
+ template <typename Iter>
+@@ -2123,8 +2123,8 @@ RepeatedPtrField<Element>::erase(const_iterator position) {
+ template <typename Element>
+ inline typename RepeatedPtrField<Element>::iterator
+ RepeatedPtrField<Element>::erase(const_iterator first, const_iterator last) {
+-  size_type pos_offset = std::distance(cbegin(), first);
+-  size_type last_offset = std::distance(cbegin(), last);
++  size_type pos_offset = static_cast<size_type>(std::distance(cbegin(), first));
++  size_type last_offset = static_cast<size_type>(std::distance(cbegin(), last));
+   DeleteSubrange(pos_offset, last_offset - pos_offset);
+   return begin() + pos_offset;
+ }
+diff --git c/src/google/protobuf/wire_format_lite.h w/src/google/protobuf/wire_format_lite.h
+index cf614c02a..361920b8e 100644
+--- c/src/google/protobuf/wire_format_lite.h
++++ w/src/google/protobuf/wire_format_lite.h
+@@ -860,7 +860,7 @@ inline uint32 WireFormatLite::ZigZagEncode32(int32 n) {
+ 
+ inline int32 WireFormatLite::ZigZagDecode32(uint32 n) {
+   // Note:  Using unsigned types prevent undefined behavior
+-  return static_cast<int32>((n >> 1) ^ -(n & 1));
++  return static_cast<int32>((n >> 1) ^ (~(n & 1) + 1));
+ }
+ 
+ inline uint64 WireFormatLite::ZigZagEncode64(int64 n) {
+@@ -871,7 +871,7 @@ inline uint64 WireFormatLite::ZigZagEncode64(int64 n) {
+ 
+ inline int64 WireFormatLite::ZigZagDecode64(uint64 n) {
+   // Note:  Using unsigned types prevent undefined behavior
+-  return static_cast<int64>((n >> 1) ^ -(n & 1));
++  return static_cast<int64>((n >> 1) ^ (~(n & 1) + 1));
+ }
+ 
+ // String is for UTF-8 text only, but, even so, ReadString() can simply

http://git-wip-us.apache.org/repos/asf/mesos/blob/3eaab8a2/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4062be0..5b54153 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -96,11 +96,6 @@ target_link_libraries(mesos-protobufs PUBLIC protobuf)
 target_include_directories(
   mesos-protobufs PUBLIC ${MESOS_PROTOBUF_HEADER_INCLUDE_DIRS})
 
-if (WIN32)
-  # Disable all compiler warnings on Protocol Buffers source.
-  target_compile_options(mesos-protobufs PRIVATE "/w")
-endif ()
-
 
 # BUILD JAVA ARTIFACTS.
 #######################


[6/6] mesos git commit: Windows: Removed `/debug:fastlink` linker flag.

Posted by an...@apache.org.
Windows: Removed `/debug:fastlink` linker flag.

With Visual Studio 2017, `fastlink` is now the default, so this is
superfluous. Morever, this particular CMake variable also passes the
flag to `lib.exe` when generating a static library, and this emits a
warning because `lib.exe` does not accept this flag. It was intended to
be sent to the `link.exe` linker, and so should not have included
`STATIC` in the list of types.


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

Branch: refs/heads/master
Commit: d95686674445d75f3ebd9d69fd42dd5cb84b3bdb
Parents: 9ac9156
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Wed Dec 13 15:31:35 2017 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Fri Dec 15 15:57:56 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/d9568667/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 854e3c9..dc9dc16 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -264,12 +264,6 @@ string(COMPARE EQUAL ${CMAKE_SYSTEM_NAME} "Linux" LINUX)
 # WINDOWS CONFIGURATION.
 ########################
 if (WIN32)
-  # Speed up incremental linking for the VS compiler/linker, for more info, see:
-  # https://blogs.msdn.microsoft.com/vcblog/2014/11/12/speeding-up-the-incremental-developer-build-scenario/
-  foreach (type EXE SHARED STATIC MODULE)
-    string(APPEND CMAKE_${type}_LINKER_FLAGS_DEBUG " /debug:fastlink")
-  endforeach ()
-
   # 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 /permissive-")


[3/6] mesos git commit: Windows: Silenced known deprecation warning from Google Test.

Posted by an...@apache.org.
Windows: Silenced known deprecation warning from Google Test.

We previously fixed the Google Test build by defining
`_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING` when building Google Test,
but by not also adding it to the interface, it generates a warning for
every test file including it. This is very noisy, and we have already
acknowledged the warning.


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

Branch: refs/heads/master
Commit: c8ee3a020486c80bd89a82ee19ef798f19277c91
Parents: 071e8cf
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Tue Dec 12 09:29:31 2017 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Fri Dec 15 15:57:56 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/c8ee3a02/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index e2370fd..dbbe75a 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -719,6 +719,8 @@ if (WIN32)
 
   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})
 


[4/6] mesos git commit: Windows: Fixed type in job object `pid_list` struct.

Posted by an...@apache.org.
Windows: Fixed type in job object `pid_list` struct.

This type was erroneously declared as `ULONG_PTR` because the
documentation states it as such. This is true if the array is
dynamically allocated, then the struct ends with a pointer to the first
element of the array. However, we avoid this allocation by statically
defining the struct with an array the size of `max_pids` for process
identifiers. PIDs on Windows are `DWORD` typed, and since the array is
defined statically, the type is the element type, not the pointer type.

The compiler warning for this was missed in the noise of existent
compiler warnings on Windows.


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

Branch: refs/heads/master
Commit: 9ac915688a4083860bcec9f9fc26e258e28b94ff
Parents: c8ee3a0
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Tue Dec 12 09:38:00 2017 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Fri Dec 15 15:57:56 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/include/stout/windows/os.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9ac91568/3rdparty/stout/include/stout/windows/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/windows/os.hpp b/3rdparty/stout/include/stout/windows/os.hpp
index 586c35f..26a1a04 100644
--- a/3rdparty/stout/include/stout/windows/os.hpp
+++ b/3rdparty/stout/include/stout/windows/os.hpp
@@ -780,7 +780,7 @@ Result<std::set<Process>> _get_job_processes(const SharedHandle& job_handle) {
   struct {
     DWORD     NumberOfAssignedProcesses;
     DWORD     NumberOfProcessIdsInList;
-    ULONG_PTR ProcessIdList[max_pids];
+    DWORD     ProcessIdList[max_pids];
   } pid_list;
 
   BOOL result = ::QueryInformationJobObject(


[5/6] mesos git commit: Included `` where used.

Posted by an...@apache.org.
Included `<stout/os/ftruncate.hpp>` where used.

This was not caught previously because the pre-compiled header included
implicitly.


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

Branch: refs/heads/master
Commit: bd7b1f32ea7e948afe434b0950f6334a46a32823
Parents: 51d1e8e
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Dec 14 18:13:57 2017 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Fri Dec 15 15:57:56 2017 -0800

----------------------------------------------------------------------
 src/status_update_manager/status_update_manager_process.hpp | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/bd7b1f32/src/status_update_manager/status_update_manager_process.hpp
----------------------------------------------------------------------
diff --git a/src/status_update_manager/status_update_manager_process.hpp b/src/status_update_manager/status_update_manager_process.hpp
index e575d8c..ce05a8e 100644
--- a/src/status_update_manager/status_update_manager_process.hpp
+++ b/src/status_update_manager/status_update_manager_process.hpp
@@ -44,6 +44,8 @@
 #include <stout/utils.hpp>
 #include <stout/uuid.hpp>
 
+#include <stout/os/ftruncate.hpp>
+
 #include "common/protobuf_utils.hpp"
 
 #include "slave/constants.hpp"


[2/6] mesos git commit: Windows: Stopped compiling files with no source code.

Posted by an...@apache.org.
Windows: Stopped compiling files with no source code.

These two `utils.cpp` files have no code on Windows due to the source
being wrapped in `#ifdef __linux__`, and so they generate warnings as
the compiled objects defined no new symbols. Since they are unused,
removing them from the Windows build fixes the warning.


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

Branch: refs/heads/master
Commit: 51d1e8e1e11d7a6a66ac809cb2bedba199ea4ba9
Parents: d956866
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Wed Dec 13 17:22:22 2017 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Fri Dec 15 15:57:56 2017 -0800

----------------------------------------------------------------------
 src/CMakeLists.txt                                  | 6 +++---
 src/slave/containerizer/mesos/provisioner/utils.cpp | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/51d1e8e1/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fa83061..4062be0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -146,13 +146,11 @@ set(AGENT_SRC
   slave/containerizer/mesos/launcher.cpp
   slave/containerizer/mesos/mount.cpp
   slave/containerizer/mesos/paths.cpp
-  slave/containerizer/mesos/utils.cpp
   slave/containerizer/mesos/io/switchboard.cpp
   slave/containerizer/mesos/provisioner/backend.cpp
   slave/containerizer/mesos/provisioner/paths.cpp
   slave/containerizer/mesos/provisioner/provisioner.cpp
   slave/containerizer/mesos/provisioner/store.cpp
-  slave/containerizer/mesos/provisioner/utils.cpp
   slave/containerizer/mesos/provisioner/appc/cache.cpp
   slave/containerizer/mesos/provisioner/appc/fetcher.cpp
   slave/containerizer/mesos/provisioner/appc/paths.cpp
@@ -172,6 +170,7 @@ if (WIN32)
     slave/containerizer/mesos/isolators/windows/mem.cpp)
 else ()
   list(APPEND AGENT_SRC
+    slave/containerizer/mesos/utils.cpp
     slave/containerizer/mesos/isolators/environment_secret.cpp
     slave/containerizer/mesos/isolators/docker/volume/driver.cpp
     slave/containerizer/mesos/isolators/docker/volume/paths.cpp
@@ -180,7 +179,8 @@ else ()
     slave/containerizer/mesos/isolators/network/cni/spec.cpp
     slave/containerizer/mesos/isolators/posix/disk.cpp
     slave/containerizer/mesos/isolators/posix/rlimits.cpp
-    slave/containerizer/mesos/isolators/volume/sandbox_path.cpp)
+    slave/containerizer/mesos/isolators/volume/sandbox_path.cpp
+    slave/containerizer/mesos/provisioner/utils.cpp)
 endif ()
 
 set(APPC_SRC

http://git-wip-us.apache.org/repos/asf/mesos/blob/51d1e8e1/src/slave/containerizer/mesos/provisioner/utils.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/utils.cpp b/src/slave/containerizer/mesos/provisioner/utils.cpp
index 7fd7315..6d24ce6 100644
--- a/src/slave/containerizer/mesos/provisioner/utils.cpp
+++ b/src/slave/containerizer/mesos/provisioner/utils.cpp
@@ -15,11 +15,9 @@
 // limitations under the License.
 
 
-#ifndef __WINDOWS__
 #include <fts.h>
 
 #include <sys/stat.h>
-#endif // __WINDOWS__
 
 #include <string>
 #include <string.h>