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 2015/09/11 02:25:53 UTC

[02/11] mesos git commit: Transitioned Windows builds to use glog v0.3.4.

Transitioned Windows builds to use glog v0.3.4.

To get Stout tests to compile on Windows, it is necessary to upgrade the
glog dependency to 0.3.4 (which will allow you to compile with MSVC
1800), and then port glog 0.3.4 to support compiling with MSVC 1900
(which Mesos requires). The code comments explain why we can't compile
with 1800 and link simply have Mesos link to it.

Note that we have supplied the MSVC 1900 port to the glog project, under
pull request #43[1].

The longer story follows:

glog v0.3.3 will not build on Windows for a few reasons that are fixed
in the 0.3.4 release. (For example, `algorithms` is not included in one
file the requires it.)

Since 0.3.4 appears to only fix bugs, and because there appear to be no
major changes in (e.g.) the ABI, I believe this is a safe change to
make. Additionally, when we ported it to compile on MSVC 1900, we didn't
want to re-write the changes they made in 0.3.4 to make it run on MSVC
1800, so this was a natural starting point for us.

I choose not to attempt to upgrade the Linux glog dependency, either in
the CMake solution, or in the autotools solution, for 3 reasons.

(1) I don't want to ask the community reconsider its dependency choices
    on the basis that an experimental Windows port requires a more
    recent version.
(2) We are currently rebundling the glog library as a binary, which
    means that a solution will be somewhat involved (i.e., either we
    have to change the patch command we're running on glog, or we have
    to change the binary)
(3) We can easily support both versions in CMake using the very powerful
    macro system, which will allow us download the dependency on Windows
    machines and use the tarball on other systems.

Footnotes:
[1] https://github.com/google/glog/pull/43

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


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

Branch: refs/heads/master
Commit: 66b6ab84091428f2f3391887e29fbfe9ad14b64f
Parents: 3446c25
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:06:07 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:14:36 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/CMakeLists.txt     | 22 ++++++++++++
 .../libprocess/cmake/ProcessConfigure.cmake     | 37 ++++++++++++--------
 2 files changed, 44 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/66b6ab84/3rdparty/libprocess/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/CMakeLists.txt b/3rdparty/libprocess/3rdparty/CMakeLists.txt
index 683a003..c31191f 100644
--- a/3rdparty/libprocess/3rdparty/CMakeLists.txt
+++ b/3rdparty/libprocess/3rdparty/CMakeLists.txt
@@ -45,6 +45,28 @@ else (REBUNDLED)
 endif (REBUNDLED)
 
 if (WIN32)
+  # TODO(hausdorff): (MESOS-3394) Upgrade Windows to use glog v0.3.5, as that
+  # release will contain fixes that will allow us to build glog on Windows.
+  #
+  # NOTE: hausdorff has ported glog v0.3.4 to support compilation with MSVC
+  # 1900 (it works on MSVC 1800, but not 1900). The patch has been submitted
+  # to the glog project which you can see in pull request #43[1].
+  #
+  # Note also that this tarball actually points directly at the branch the
+  # PR is issued from, and uses the GitHub REST API to get a tarball of it.
+  # We think this is stictly better than pulling a tarball out of 3rdparty, or
+  # running `patch` on a tarball version of the vanilla 0.3.4 release, because
+  # it means that this code will automatically be up-to-date, and to transition
+  # to the next release of glog (when this will presumably be fixed), we need
+  # only change this line.
+  #
+  # Finally, for our third-party libraries, MSVC 1800 and 1900 are not
+  # linker-compatible, so it's important for us to be able to build glog
+  # (as well as all the other third-party dependencies) on MSVC 1900.
+  #
+  # [1] https://github.com/google/glog/pull/43
+  set(GLOG_URL https://github.com/hausdorff/glog/tarball/glog-${GLOG_VERSION}-msvc1900)
+
   # TODO(hausdorff): (MESOS-3394) points at a random tarball in my
   # (hausdorff's) repository. We need a more permanent solution for this
   # eventually.

http://git-wip-us.apache.org/repos/asf/mesos/blob/66b6ab84/3rdparty/libprocess/cmake/ProcessConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessConfigure.cmake b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
index 12506a1..a5f8d39 100755
--- a/3rdparty/libprocess/cmake/ProcessConfigure.cmake
+++ b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
@@ -15,16 +15,16 @@
 # limitations under the License.
 
 ###############################################################
-# EXPORTS VARIABLES NEEDED TO LINK TO THIRD-PARTY LIBS. These are used
-# throughout the Mesos project.
+# This file exports variables needed ot link to third-party libs. These are
+# used throughout the Mesos project.
 #
-# THIS INCLUDES things like:
-#   * "Public interface" stuff, like which headers we need in order to link to
-#     libprocess.
+# This includes things like:
+#   * Components defining the public interface, like which headers we need in
+#     order to link to libprocess.
 #   * Where to look to find built libraries.
 #   * Version information of the third-party libraries in use.
 #
-# This DOES NOT include:
+# This does not include:
 #   * Where to find include headers for tests -- the rest of Mesos does not
 #     need this information.
 #   * Any information about how to build these libraries. That's in
@@ -33,7 +33,7 @@
 #     files we need to compile libprocess.
 #   * Build commands actually used to compile (e.g.) libprocess.
 #
-# RATIONALE: Autoconf makes linking to third party dependencies as simple as
+# Rationale: Autoconf makes linking to third party dependencies as simple as
 # pointing at the underlying makefile. In CMake, this is harder because we do
 # not assume there are Makefiles at all. Thus, it is useful to export variables
 # with things like which header files you need to include to link to third
@@ -52,20 +52,27 @@ set(PROCESS_3RD_BIN ${CMAKE_BINARY_DIR}/3rdparty/libprocess/3rdparty)
 set(STOUT ${PROCESS_3RD_SRC}/stout)
 
 EXTERNAL("boost"       "1.53.0"  "${PROCESS_3RD_BIN}")
-EXTERNAL("glog"        "0.3.3"   "${PROCESS_3RD_BIN}")
 EXTERNAL("picojson"    "4f93734" "${PROCESS_3RD_BIN}")
 EXTERNAL("http_parser" "1c3624a" "${PROCESS_3RD_BIN}")
 EXTERNAL("libev"       "4.15"    "${PROCESS_3RD_BIN}")
 
+if (NOT WIN32)
+  EXTERNAL("glog" "0.3.3" "${PROCESS_3RD_BIN}")
+elseif (WIN32)
+  # Glog 0.3.3 does not compile out of the box on Windows. Therefore, we
+  # require 0.3.4.
+  EXTERNAL("glog" "0.3.4" "${PROCESS_3RD_BIN}")
+endif (NOT WIN32)
+
 set(GLOG_LIB ${GLOG_ROOT}-lib/lib)
 
-# DIRECTORY STRUCTURE FOR WINDOWS-ONLY THIRD-PARTY LIBS.
+# Directory structure for windows-only third-party libs.
 ########################################################
 if (WIN32)
   EXTERNAL("curl" "7.43.0" "${PROCESS_3RD_BIN}")
 endif (WIN32)
 
-# DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
+# Define process library dependencies. Tells the process library build targets
 # download/configure/build all third-party libraries before attempting to build.
 ################################################################################
 set(PROCESS_DEPENDENCIES
@@ -77,7 +84,7 @@ set(PROCESS_DEPENDENCIES
   ${LIBEV_TARGET}
   )
 
-# DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
+# Define third-party include directories. Tells compiler toolchain where to get
 # headers for our third party libs (e.g., -I/path/to/glog on Linux).
 ###############################################################################
 set(PROCESS_INCLUDE_DIRS
@@ -113,7 +120,7 @@ if (HAS_GPERFTOOLS)
     )
 endif (HAS_GPERFTOOLS)
 
-# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
+# Define third-party lib install directories. Used to tell the compiler
 # toolchain where to find our third party libs (e.g., -L/path/to/glog on
 # Linux).
 ########################################################################
@@ -124,7 +131,7 @@ set(PROCESS_LIB_DIRS
   ${HTTP_PARSER_ROOT}-build
   )
 
-# DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
+# Define third-party libs. Used to generate flags that the linker uses to
 # include our third-party libs (e.g., -lglog on Linux).
 #########################################################################
 find_package(Threads REQUIRED)
@@ -141,8 +148,8 @@ set(PROCESS_LIBS
 if (NOT WIN32)
   find_package(ZLIB REQUIRED)
 
-  # TODO(hausdorff): The `LINUX` flag comes from MesosConfigure; when
-  # we port the bootstrap script to CMake, we should also copy this
+  # TODO(hausdorff): (MESOS-3396) The `LINUX` flag comes from MesosConfigure;
+  # when we port the bootstrap script to CMake, we should also copy this
   # logic into .cmake files in the Stout and Process libraries'
   # folders individually.
   if (LINUX)