You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/01/29 03:47:20 UTC
[1/2] mesos git commit: Windows:[1/2] Added patch for Windows ZK
version.
Repository: mesos
Updated Branches:
refs/heads/master 3f6dfe713 -> 00a4db174
Windows:[1/2] Added patch for Windows ZK version.
Review: https://reviews.apache.org/r/40851/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e5478450
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e5478450
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e5478450
Branch: refs/heads/master
Commit: e5478450ade7e810abee4fe83a3ec721759c1f29
Parents: 3f6dfe7
Author: M Lawindi <ml...@microsoft.com>
Authored: Thu Jan 28 18:30:29 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Jan 28 18:31:24 2016 -0800
----------------------------------------------------------------------
3rdparty/zookeeper-06d3f3f.patch | 112 ++++++++++++++++++++++++++++++++++
1 file changed, 112 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/e5478450/3rdparty/zookeeper-06d3f3f.patch
----------------------------------------------------------------------
diff --git a/3rdparty/zookeeper-06d3f3f.patch b/3rdparty/zookeeper-06d3f3f.patch
new file mode 100644
index 0000000..8f8f72c
--- /dev/null
+++ b/3rdparty/zookeeper-06d3f3f.patch
@@ -0,0 +1,112 @@
+diff --git a/src/c/zookeeper-vs2015.sln b/src/c/zookeeper-vs2015.sln
+new file mode 100644
+index 0000000..44d738f
+--- /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/include/winconfig.h b/src/c/include/winconfig.h
+old mode 100644
+new mode 100755
+index ccc3c18..b1f4bfe
+--- 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
+
+@@ -171,12 +173,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 +199,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
+old mode 100755
+new mode 100644
+index d02608a..be60a65
+--- 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;
[2/2] mesos git commit: Windows:[2/2] Used ZK in Windows build.
Posted by jo...@apache.org.
Windows:[2/2] Used ZK in Windows build.
Review: https://reviews.apache.org/r/42016/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/00a4db17
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/00a4db17
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/00a4db17
Branch: refs/heads/master
Commit: 00a4db174edc7ff3639bdf3de61d988c8341090a
Parents: e547845
Author: M Lawindi <ml...@microsoft.com>
Authored: Thu Jan 28 18:28:24 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Jan 28 18:31:29 2016 -0800
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 15 ++++-
3rdparty/cmake/Mesos3rdpartyConfigure.cmake | 84 +++++++++++++++++++++++-
3rdparty/patch.exe.manifest | 12 ++++
CMakeLists.txt | 9 +++
src/slave/cmake/SlaveConfigure.cmake | 1 +
5 files changed, 116 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/00a4db17/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
old mode 100644
new mode 100755
index ac5c25a..3253da7
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -42,9 +42,18 @@ if (NOT WIN32)
${MESOS_3RDPARTY_SRC}/zookeeper-${ZOOKEEPER_VERSION}.patch
ZOOKEEPER_PATCH_CMD)
elseif (WIN32)
- set(ZOOKEEPER_PATCH_CMD ${CMAKE_NOOP})
+ # Set the patch command which will utilize patch.exe in temp location for no elevation prompt
+ set(
+ ZOOKEEPER_PATCH_CMD
+ ${PATCHEXE_LOCATION} --binary -p1 < ${MESOS_3RDPARTY_SRC}/zookeeper-${ZOOKEEPER_VERSION}.patch)
+
+ VS_BUILD_CMD(
+ ZOOKEEPER
+ ${ZOOKEEPER_C_ROOT}/zookeeper-vs2015.sln
+ ${CMAKE_BUILD_TYPE}
+ "zookeeper")
+
set(ZOOKEEPER_CONFIG_CMD ${CMAKE_NOOP})
- set(ZOOKEEPER_BUILD_CMD ${CMAKE_NOOP})
set(ZOOKEEPER_INSTALL_CMD ${CMAKE_NOOP})
endif (NOT WIN32)
@@ -59,4 +68,4 @@ ExternalProject_Add(
BUILD_COMMAND ${ZOOKEEPER_BUILD_CMD}
INSTALL_COMMAND ${ZOOKEEPER_INSTALL_CMD}
URL ${ZOOKEEPER_URL}
- )
\ No newline at end of file
+ )
http://git-wip-us.apache.org/repos/asf/mesos/blob/00a4db17/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
old mode 100644
new mode 100755
index 34e61ff..0c80fb8
--- a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
+++ b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
@@ -19,14 +19,21 @@
set(MESOS_3RDPARTY_SRC ${CMAKE_SOURCE_DIR}/3rdparty)
set(MESOS_3RDPARTY_BIN ${CMAKE_BINARY_DIR}/3rdparty)
-EXTERNAL("zookeeper" ${ZOOKEEPER_VERSION} "${MESOS_3RDPARTY_BIN}")
+if (NOT WIN32)
+ EXTERNAL("zookeeper" ${ZOOKEEPER_VERSION} "${MESOS_3RDPARTY_BIN}")
+elseif (WIN32)
+ # The latest release of ZK, 3.4.7, does not compile on Windows. Therefore, we
+ # pick a recent commit that does until the next release stabilizes.
+ EXTERNAL("zookeeper" "06d3f3f" "${MESOS_3RDPARTY_BIN}")
+endif (NOT WIN32)
# Intermediate convenience variables for oddly-structured directories.
set(ZOOKEEPER_C_ROOT ${ZOOKEEPER_ROOT}/src/c)
set(ZOOKEEPER_LIB ${ZOOKEEPER_ROOT}-lib/lib)
# Convenience variables for include directories of third-party dependencies.
-set(ZOOKEEPER_INCLUDE_DIR ${ZOOKEEPER_LIB}/include/zookeeper)
+set(ZOOKEEPER_INCLUDE_GENDIR ${ZOOKEEPER_C_ROOT}/generated)
+set(ZOOKEEPER_INCLUDE_DIR ${ZOOKEEPER_C_ROOT}/include)
# Convenience variables for `lib` directories of built third-party dependencies.
set(ZOOKEEPER_LIB_DIR ${ZOOKEEPER_LIB}/lib)
@@ -34,3 +41,76 @@ set(ZOOKEEPER_LIB_DIR ${ZOOKEEPER_LIB}/lib)
# Convenience variables for "lflags", the symbols we pass to CMake to generate
# things like `-L/path/to/glog` or `-lglog`.
set(ZOOKEEPER_LFLAG zookeeper_mt)
+
+# Configure Windows use of the GNU patch utility;
+# we attempt to find it in its default location,
+# but this path may be customized.
+#################################################
+if (WIN32)
+ set(PROGRAMFILESX86 "PROGRAMFILES(X86)")
+ set(PATCHEXE_DEFAULT_LOCATION $ENV{${PROGRAMFILESX86}}/GnuWin32/bin)
+
+ set(PATCHEXE_PATH
+ ${PATCHEXE_DEFAULT_LOCATION}
+ CACHE PATH "Path for GnuWin32 patch.exe")
+
+ set(
+ GNUWIN32_PATCH_EXECUTABLE
+ ${PATCHEXE_PATH}/patch.exe
+ CACHE PATH "Full path for GnuWin32 patch.exe")
+
+ if (NOT EXISTS ${GNUWIN32_PATCH_EXECUTABLE})
+ message(
+ FATAL_ERROR
+ "GnuWin32 patch.exe was not found. Use -DPATCHEXE_PATH to "
+ "provide the local path of GnuWin32 patch.exe. "
+ "Mesos for Windows requires GnuWin32 patch.exe "
+ "to apply updates. You may get it from "
+ "http://gnuwin32.sourceforge.net/packages/patch.htm"
+ )
+ else (NOT EXISTS ${GNUWIN32_PATCH_EXECUTABLE})
+ message(
+ STATUS
+ "GnuWin32 patch.exe exists at: "
+ ${GNUWIN32_PATCH_EXECUTABLE})
+
+ # Since Windows Vista patch.exe has been reqesting elevation to work
+ # eventhough it is not required to apply patches. So to avoid a prompt
+ # for elevation a manifest will be applied to patch.exe in the current
+ # user temp directory.
+
+ # First: Copy patch.exe and patch.exe.manifest to the user temp dir where
+ # elevation is not required. 'Set \Users\<user>\AppData\Local\Temp' dir.
+ set(USER_TMP_DIR "TMP")
+
+ # Set full path for temp location of patch.exe.
+ set(PATCHEXE_LOCATION $ENV{${USER_TMP_DIR}}/patch.exe)
+
+ #set full path for patch.exe.manifest.
+ set(PATCHMANIFEST_LOCATION ${MESOS_3RDPARTY_SRC}/patch.exe.manifest)
+
+ # Set full path for temp location of patch.exe.manifest.
+ set(PATCHMANIFEST_TMP_LOCATION $ENV{${USER_TMP_DIR}}/patch.exe.manifest)
+
+ # Copy patch.exe and path.exe.manifest to temp location.
+ configure_file(
+ ${GNUWIN32_PATCH_EXECUTABLE}
+ ${PATCHEXE_LOCATION}
+ COPYONLY)
+ configure_file(
+ ${PATCHMANIFEST_LOCATION}
+ ${PATCHMANIFEST_TMP_LOCATION}
+ COPYONLY)
+
+ # Second: Apply manifest to patch command.
+ set(
+ APPLY_PATCH_MANIFEST_COMMAND
+ "mt.exe"
+ -manifest mt ${PATCHMANIFEST_TMP_LOCATION}
+ -outputresource:${PATCHEXE_LOCATION};1)
+
+ add_custom_command(
+ OUTPUT patch.exe
+ COMMAND ${APPLY_PATCH_MANIFEST_COMMAND})
+ endif (NOT EXISTS ${GNUWIN32_PATCH_EXECUTABLE})
+endif (WIN32)
http://git-wip-us.apache.org/repos/asf/mesos/blob/00a4db17/3rdparty/patch.exe.manifest
----------------------------------------------------------------------
diff --git a/3rdparty/patch.exe.manifest b/3rdparty/patch.exe.manifest
new file mode 100644
index 0000000..cebcdad
--- /dev/null
+++ b/3rdparty/patch.exe.manifest
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <!-- Make sure that UAC believes
+ that it does not require administrative privilege -->
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/mesos/blob/00a4db17/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d828b75..7f83dc8 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,15 @@ if (REBUNDLED AND ENABLE_LIBEVENT)
)
endif (REBUNDLED AND ENABLE_LIBEVENT)
+if (WIN32 AND REBUNDLED)
+ message(
+ WARNING
+ "The current supported version of ZK does not compile on Windows, and does "
+ "not come rebundled in the Mesos repository. It must be downloaded from "
+ "the Internet, even though the `REBUNDLED` flag was set."
+ )
+endif (WIN32 AND REBUNDLED)
+
if (WIN32 AND (NOT ENABLE_LIBEVENT))
message(
FATAL_ERROR
http://git-wip-us.apache.org/repos/asf/mesos/blob/00a4db17/src/slave/cmake/SlaveConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/slave/cmake/SlaveConfigure.cmake b/src/slave/cmake/SlaveConfigure.cmake
index cf378a2..a8270a9 100644
--- a/src/slave/cmake/SlaveConfigure.cmake
+++ b/src/slave/cmake/SlaveConfigure.cmake
@@ -47,6 +47,7 @@ set(AGENT_INCLUDE_DIRS
${PICOJSON_INCLUDE_DIR}
${PROTOBUF_INCLUDE_DIR}
${ZOOKEEPER_INCLUDE_DIR}
+ ${ZOOKEEPER_INCLUDE_GENDIR}
)
# Define third-party lib install directories. Used to tell the compiler