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:52 UTC

[01/11] mesos git commit: Changed build commands for 3rdparty libs to be no-ops in Windows.

Repository: mesos
Updated Branches:
  refs/heads/master 3b7a6b840 -> cc0b6ea87


Changed build commands for 3rdparty libs to be no-ops in Windows.

Largely a reverse of a previous commit. We previously removed the quotes
from around some interpolated variables, to instead make them regular
variable expansions, but in their context (they expand to build commands
for third-party libraries) we now know that this doesn't work on all
platforms for all versions of CMake.

A longer explanation of the technical issue is in the code comments.

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


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

Branch: refs/heads/master
Commit: 3446c25ca9450807c2547d829412162282e38038
Parents: 3b7a6b8
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:05:59 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:14:28 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/CMakeLists.txt | 116 ++++++++++++++---------
 1 file changed, 73 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3446c25c/3rdparty/libprocess/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/CMakeLists.txt b/3rdparty/libprocess/3rdparty/CMakeLists.txt
index 997cc0d..683a003 100644
--- a/3rdparty/libprocess/3rdparty/CMakeLists.txt
+++ b/3rdparty/libprocess/3rdparty/CMakeLists.txt
@@ -16,10 +16,10 @@
 
 include(ExternalProject)
 
-# Downloads, configures, and compiles the third party libraries for the process
+# Downloads, configures, and compiles the third-party libraries for the process
 # library (i.e., 3rdparty/libprocess/3rdparty).
 
-# DEFINE SOURCES OF THIRD_PARTY DEPENDENCIES.
+# Define sources of third-party dependencies.
 #############################################
 set(REBUNDLED_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 if (REBUNDLED)
@@ -29,25 +29,29 @@ if (REBUNDLED)
   set(HTTP_PARSER_URL ${REBUNDLED_DIR}/ry-http-parser-${HTTP_PARSER_VERSION}.tar.gz)
   set(LIBEV_URL       ${REBUNDLED_DIR}/libev-${LIBEV_VERSION}.tar.gz)
 else (REBUNDLED)
-  # TODO(hausdorff): depends on the github mirror, should remove when possible.
+  # TODO(hausdorff): (MESOS-3395) depends on the github mirror, should remove
+  # when possible.
   set(BOOST_URL       https://github.com/apache/mesos/raw/master/3rdparty/libprocess/3rdparty/boost-${BOOST_VERSION}.tar.gz)
   set(GLOG_URL        https://google-glog.googlecode.com/files/glog-${GLOG_VERSION}.tar.gz)
   # NOTE: This url can't be versioned like the others, because it depends on
   #       specific commit, and isn't in our upstream.
   set(PICOJSON_URL    https://github.com/kazuho/picojson/tarball/4f93734ade33ea0f5e5b4de35fc6b2c324a8dca6)
-  # TODO(hausdorff): depends on the github mirror, should remove when possible.
+  # TODO(hausdorff): (MESOS-3395) depends on the github mirror, should remove
+  # when possible.
   set(HTTP_PARSER_URL https://github.com/apache/mesos/raw/master/3rdparty/libprocess/3rdparty/ry-http-parser-${HTTP_PARSER_VERSION}.tar.gz)
-  # TODO(hausdorff): depends on the github mirror, should remove when possible.
+  # TODO(hausdorff): (MESOS-3395) depends on the github mirror, should remove
+  # when possible.
   set(LIBEV_URL       https://github.com/apache/mesos/raw/master/3rdparty/libprocess/3rdparty/libev-${LIBEV_VERSION}.tar.gz)
 endif (REBUNDLED)
 
 if (WIN32)
-  # TODO(hausdorff): points at a random tarball in my (hausdorff's) repository.
-  # We need a more permanent solution for this eventually.
+  # TODO(hausdorff): (MESOS-3394) points at a random tarball in my
+  # (hausdorff's) repository. We need a more permanent solution for this
+  # eventually.
   set(CURL_URL https://github.com/hausdorff/3rdparty/raw/master/curl-static-${CURL_VERSION}.tar.gz)
 endif (WIN32)
 
-# DEFINE BUILD/PATCH/CONFIGURE COMMANDS FOR THIRD-PARTY LIBS.
+# Define build/patch/configure commands for third-party libs.
 #############################################################
 if (NOT WIN32)
   set(GLOG_CONFIG_CMD  ${GLOG_ROOT}/src/../configure --prefix=${GLOG_LIB})
@@ -64,27 +68,46 @@ if (NOT WIN32)
   set(LIBEV_BUILD_CMD  make)
   # Patch libev to keep it from reaping child processes.
   PATCH_CMD(${PROCESS_3RD_SRC}/libev-4.15.patch LIBEV_PATCH_CMD)
-else (NOT WIN32)
-  # Quotes are important in the following commands. Building glog on WIN32
-  # must be done in Visual Studio, and in that case, these commands must be
-  # nops. But if you take out the quote marks, CMake will treat this as an
-  # empty build command, and will attempt to build glog as a CMake project.
-  set(GLOG_CONFIG_CMD  "")
-  set(GLOG_BUILD_CMD   "")
-  set(GLOG_INSTALL_CMD "")
-  set(GLOG_PATCH_CMD   "")
-
-  set(RY_BUILD_CMD   "")
-  set(RY_INSTALL_CMD "")
-
-  set(LIBEV_CONFIG_CMD "")
-  set(LIBEV_BUILD_CMD  "")
-  set(LIBEV_PATCH_CMD  "")
 endif (NOT WIN32)
 
-# THIRD-PARTY LIBRARIES. Tell the build system how to pull in and build third-
+# Third-party libraries. Tell the build system how to pull in and build third-
 # party libraries at compile time, using the ExternalProject_Add macro.
 ##############################################################################
+# NOTE: On ExternalProject_Add calls in the next section, we pass some
+# quoted values into `ExternalProject_Add`. We do this because some of these
+# projects can't (or shouldn't) be built from the command line (for various
+# reasons), and we need to get creative about what values we pass in to make
+# sure these operations are no-ops.
+#
+# There are two flavors of work-around here. The first we use to avoid building
+# third-party projects (like Boost) that never need to be built for Mesos. This
+# looks like this:
+#
+#     BUILD_COMMAND ""
+#
+# In most of the major releases of CMake, if we don't set parameters like
+# `BUILD_COMMAND`, we will trigger the default behavior of that parameter;
+# usually, CMake attempts to configure/build/install/etc. the third-party
+# project as if it were a CMake (or perhaps make) project. Since these projects
+# are not CMake projects, they will error out. This work-around lets us avoid
+# that fate altogether.
+#
+# The second work-around allows us to build a project except on Windows. It
+# looks like this:
+#
+#     BUILD_COMMAND "${GLOG_BUILD_CMD}"
+#
+# The problem is that there is currently no way to build glog on Windows from
+# the command line. But, if GLOG_BUILD_CMD is not set (or if it's an empty
+# list), then we run into the same problem as last time; CMake sees that
+# `BUILD_COMMAND` is unset, and will default to the "normal" behavior of trying
+# to configure/build/install the project as if it was a CMake project. (Since
+# it is not, it will of course error out on Windows.)
+#
+# The work-around is to add quotes to the outside of the variable. In this case,
+# ${GLOG_BUILD_CMD} will expand to unset, which will cause us to pass the empty
+# string as a parameter to the function. This of course is different from not
+# setting the parameter value at all, and hence the work-around works.
 ExternalProject_Add(
   ${BOOST_TARGET}
   PREFIX            ${BOOST_CMAKE_ROOT}
@@ -97,11 +120,12 @@ ExternalProject_Add(
 ExternalProject_Add(
   ${GLOG_TARGET}
   PREFIX            ${GLOG_CMAKE_ROOT}
-  PATCH_COMMAND     ${GLOG_PATCH_CMD}
-  CONFIGURE_COMMAND ${GLOG_CONFIG_CMD}
-  BUILD_COMMAND     ${GLOG_BUILD_CMD}
-  INSTALL_COMMAND   ${GLOG_INSTALL_CMD}
+  PATCH_COMMAND     "${GLOG_PATCH_CMD}"
+  CONFIGURE_COMMAND "${GLOG_CONFIG_CMD}"
+  BUILD_COMMAND     "${GLOG_BUILD_CMD}"
+  INSTALL_COMMAND   "${GLOG_INSTALL_CMD}"
   URL               ${GLOG_URL}
+  DOWNLOAD_NAME     glog-${GLOG_VERSION}.tar.gz
   )
 
 ExternalProject_Add(
@@ -118,17 +142,17 @@ ExternalProject_Add(
   ${HTTP_PARSER_TARGET}
   PREFIX            ${HTTP_PARSER_CMAKE_ROOT}
   CONFIGURE_COMMAND ""
-  BUILD_COMMAND     ${RY_BUILD_CMD}
-  INSTALL_COMMAND   ${RY_INSTALL_CMD}
+  BUILD_COMMAND     "${RY_BUILD_CMD}"
+  INSTALL_COMMAND   "${RY_INSTALL_CMD}"
   URL               ${HTTP_PARSER_URL}
   )
 
 ExternalProject_Add(
   ${LIBEV_TARGET}
   PREFIX            ${LIBEV_CMAKE_ROOT}
-  PATCH_COMMAND     ${LIBEV_PATCH_CMD}
-  CONFIGURE_COMMAND ${LIBEV_CONFIG_CMD}
-  BUILD_COMMAND     ${LIBEV_BUILD_CMD}
+  PATCH_COMMAND     "${LIBEV_PATCH_CMD}"
+  CONFIGURE_COMMAND "${LIBEV_CONFIG_CMD}"
+  BUILD_COMMAND     "${LIBEV_BUILD_CMD}"
   INSTALL_COMMAND   ""
   URL               ${LIBEV_URL}
   )
@@ -140,7 +164,7 @@ if (WIN32)
   # TODO(hausdorff): maybe try to incorporate this into findpackage for Windows
   ExternalProject_Add(
     ${CURL_TARGET}
-    PREFIX            "${CURL_CMAKE_ROOT}"
+    PREFIX            ${CURL_CMAKE_ROOT}
     PATCH_COMMAND     ""
     CONFIGURE_COMMAND ""
     BUILD_COMMAND     ""
@@ -155,9 +179,11 @@ if (REBUNDLED)
   set(GMOCK_URL    ${REBUNDLED_DIR}/gmock-${GMOCK_VERSION}.tar.gz)
   set(PROTOBUF_URL ${REBUNDLED_DIR}/protobuf-${PROTOBUF_VERSION}.tar.gz)
 else (REBUNDLED)
-  # TODO(hausdorff): depends on the github mirror, should remove when possible.
+  # TODO(hausdorff): (MESOS-3395) depends on the github mirror, should remove
+  # when possible.
   set(GMOCK_URL    https://github.com/apache/mesos/raw/master/3rdparty/libprocess/3rdparty/gmock-${GMOCK_VERSION}.tar.gz)
-  # TODO(hausdorff): depends on the github mirror, should remove when possible.
+  # TODO(hausdorff): (MESOS-3395) depends on the github mirror, should remove
+  # when possible.
   set(PROTOBUF_URL https://github.com/hausdorff/mesos/raw/test_cmake/3rdparty/libprocess/3rdparty/protobuf-${PROTOBUF_VERSION}.tar.gz)
 endif (REBUNDLED)
 
@@ -177,21 +203,25 @@ if (NOT WIN32)
 endif (NOT WIN32)
 
 ExternalProject_Add(
+  # See note about third-party libraries above to understand quirky actual
+  # parameters passed in here.
   ${GMOCK_TARGET}
   PREFIX            ${GMOCK_CMAKE_ROOT}
-  CONFIGURE_COMMAND ${GMOCK_CONFIG_CMD}
-  BUILD_COMMAND     ${GMOCK_BUILD_CMD}
+  CONFIGURE_COMMAND "${GMOCK_CONFIG_CMD}"
+  BUILD_COMMAND     "${GMOCK_BUILD_CMD}"
   INSTALL_COMMAND   ""
   URL               ${GMOCK_URL}
   )
 
 ExternalProject_Add(
+  # See note about third-party libraries above to understand quirky actual
+  # parameters passed in here.
   ${PROTOBUF_TARGET}
   PREFIX            ${PROTOBUF_CMAKE_ROOT}
-  PATCH_COMMAND     ${PROTOBUF_PATCH_CMD}
-  CONFIGURE_COMMAND ${PROTOBUF_CONFIG_CMD}
-  BUILD_COMMAND     ${PROTOBUF_BUILD_CMD}
-  INSTALL_COMMAND   ${PROTOBUF_INSTALL_CMD}
+  PATCH_COMMAND     "${PROTOBUF_PATCH_CMD}"
+  CONFIGURE_COMMAND "${PROTOBUF_CONFIG_CMD}"
+  BUILD_COMMAND     "${PROTOBUF_BUILD_CMD}"
+  INSTALL_COMMAND   "${PROTOBUF_INSTALL_CMD}"
   URL               ${PROTOBUF_URL}
   )
 


[08/11] mesos git commit: Modernized the Stout tests CMakeLists file.

Posted by jo...@apache.org.
Modernized the Stout tests CMakeLists file.

Now that other people are starting to attempt to compile Stout on
Windows, it's important that we give them a CMakeLists file that
explicitly compiles the parts of Stout we're willing to support.

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


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

Branch: refs/heads/master
Commit: 066a5a8000b98199aa799c53def7ccbff76a82a6
Parents: 989eca4
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:07:34 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:15:12 2015 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/tests/CMakeLists.txt         | 34 ++++++++++++--------
 1 file changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/066a5a80/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt
index b1a5190..cf5fd5c 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt
@@ -24,41 +24,47 @@ set(STOUT_TESTS_SRC
   bits_tests.cpp
   bytes_tests.cpp
   cache_tests.cpp
-  svn_tests.cpp
   duration_tests.cpp
-  dynamiclibrary_tests.cpp
   error_tests.cpp
-  flags_tests.cpp
-  gzip_tests.cpp
   hashmap_tests.cpp
   hashset_tests.cpp
   interval_tests.cpp
-  ip_tests.cpp
   json_tests.cpp
   linkedhashmap_tests.cpp
-  mac_tests.cpp
   main.cpp
   multimap_tests.cpp
   none_tests.cpp
   option_tests.cpp
-  os_tests.cpp
-  path_tests.cpp
-  protobuf_tests.cpp
-  protobuf_tests.pb.cc
   protobuf_tests.pb.h
   protobuf_tests.proto
   result_tests.cpp
-  os/sendfile_tests.cpp
-  os/signals_tests.cpp
   set_tests.cpp
   some_tests.cpp
   strings_tests.cpp
-  subcommand_tests.cpp
-  thread_tests.cpp
   uuid_tests.cpp
   version_tests.cpp
   )
 
+if (NOT WIN32)
+  set(STOUT_TESTS_SRC
+    ${STOUT_TESTS_SRC}
+    dynamiclibrary_tests.cpp
+    flags_tests.cpp
+    gzip_tests.cpp
+    ip_tests.cpp
+    mac_tests.cpp
+    os_tests.cpp
+    path_tests.cpp
+    protobuf_tests.cpp
+    protobuf_tests.pb.cc
+    os/sendfile_tests.cpp
+    os/signals_tests.cpp
+    subcommand_tests.cpp
+    svn_tests.cpp
+    thread_tests.cpp
+    )
+endif (NOT WIN32)
+
 # INCLUDE DIRECTIVES FOR STOUT TEST BINARY (generates, e.g., -I/path/to/thing
 # on Linux).
 #############################################################################


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

Posted by jo...@apache.org.
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)


[07/11] mesos git commit: Implemented stout/os/windows/exists.hpp.

Posted by jo...@apache.org.
Implemented stout/os/windows/exists.hpp.

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


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

Branch: refs/heads/master
Commit: 989eca4db7301f8cdae37cc9f801095ff0061929
Parents: 3b03427
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:07:21 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:15:06 2015 -0700

----------------------------------------------------------------------
 .../stout/include/stout/os/posix/exists.hpp     |  3 ++
 .../stout/include/stout/os/windows/exists.hpp   | 51 ++++++++++++++++++--
 2 files changed, 50 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/989eca4d/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/exists.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/exists.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/exists.hpp
index 835466b..48489b8 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/exists.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/exists.hpp
@@ -23,9 +23,11 @@
 
 namespace os {
 
+
 inline bool exists(const std::string& path)
 {
   struct stat s;
+
   if (::lstat(path.c_str(), &s) < 0) {
     return false;
   }
@@ -48,6 +50,7 @@ inline bool exists(pid_t pid)
   return false;
 }
 
+
 } // namespace os {
 
 #endif // __STOUT_OS_POSIX_EXISTS_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/989eca4d/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/exists.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/exists.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/exists.hpp
index 46f8fd2..ddcda7b 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/exists.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/exists.hpp
@@ -16,23 +16,66 @@
 
 #include <string>
 
+#include <stout/windows.hpp>
+
 
 namespace os {
 
+
 inline bool exists(const std::string& path)
 {
-  UNIMPLEMENTED;
+  // TODO(hausdorff): (MESOS-3386) os.hpp is not yet fully ported to Windows,
+  // but when it is, we should change this to use `os::realpath` instead,
+  // rather than the raw `::realpath` API.
+  //
+  // NOTE: `::realpath` will correctly error out if path length is greater than
+  // `PATH_MAX`.
+  char absolutePath[PATH_MAX];
+
+  if (::realpath(path.c_str(), absolutePath) == NULL) {
+    return false;
+  }
+
+  // NOTE: GetFileAttributes does not support unicode natively. See also
+  // "documentation"[1] for why this is a check-if-file-exists idiom.
+  //
+  // [1] http://blogs.msdn.com/b/oldnewthing/archive/2007/10/23/5612082.aspx
+  DWORD attributes = GetFileAttributes(absolutePath);
+
+  bool fileNotFound = GetLastError() == ERROR_FILE_NOT_FOUND;
+
+  return !((attributes == INVALID_FILE_ATTRIBUTES) && fileNotFound);
 }
 
 
 // Determine if the process identified by pid exists.
-// NOTE: Zombie processes have a pid and therefore exist. See os::process(pid)
-// to get details of a process.
+// NOTE: Zombie processes have a pid and therefore exist. See
+// os::process(pid) to get details of a process.
 inline bool exists(pid_t pid)
 {
-  UNIMPLEMENTED;
+  HANDLE handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
+
+  // NOTE: `GetExitCode` will gracefully deal with the case that `handle` is
+  // `NULL`.
+  DWORD exitCode = 0;
+  BOOL exitCodeExists = GetExitCodeProcess(handle, &exitCode);
+
+  // `CloseHandle`, on the other hand, will throw an exception in the
+  // VS debugger if you pass it a broken handle. (cf. "Return value"
+  // section of the documentation[1].)
+  //
+  // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms724211(v=vs.85).aspx
+  if (handle != NULL) {
+    CloseHandle(handle);
+  }
+
+  // NOTE: Windows quirk, the exit code returned by the process can
+  // be the same number as `STILL_ACTIVE`, in which case this
+  // function will mis-report that the process still exists.
+  return exitCodeExists && (exitCode == STILL_ACTIVE);
 }
 
+
 } // namespace os {
 
 #endif // __STOUT_OS_WINDOWS_EXISTS_HPP__


[06/11] mesos git commit: Extended permissions.hpp to work on both Windows and POSIX.

Posted by jo...@apache.org.
Extended permissions.hpp to work on both Windows and POSIX.

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


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

Branch: refs/heads/master
Commit: 3b03427790a9d443c677bbbebd6016b798302b1e
Parents: 342f2b3
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:07:06 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:15:00 2015 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/include/Makefile.am          |  2 -
 .../stout/include/stout/os/permissions.hpp      | 60 ++++++++++--
 .../include/stout/os/posix/permissions.hpp      | 69 --------------
 .../include/stout/os/windows/permissions.hpp    | 41 --------
 .../3rdparty/stout/include/stout/windows.hpp    | 98 ++++++++++++++++++++
 5 files changed, 151 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3b034277/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
index 58844a2..9e9c311 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
@@ -65,7 +65,6 @@ nobase_include_HEADERS =		\
   stout/os/posix/killtree.hpp		\
   stout/os/posix/ls.hpp			\
   stout/os/posix/open.hpp		\
-  stout/os/posix/permissions.hpp	\
   stout/os/posix/process.hpp		\
   stout/os/posix/pstree.hpp		\
   stout/os/posix/read.hpp		\
@@ -93,7 +92,6 @@ nobase_include_HEADERS =		\
   stout/os/windows/killtree.hpp		\
   stout/os/windows/ls.hpp		\
   stout/os/windows/open.hpp		\
-  stout/os/windows/permissions.hpp	\
   stout/os/windows/process.hpp		\
   stout/os/windows/pstree.hpp		\
   stout/os/windows/read.hpp		\

http://git-wip-us.apache.org/repos/asf/mesos/blob/3b034277/3rdparty/libprocess/3rdparty/stout/include/stout/os/permissions.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/permissions.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/permissions.hpp
index 196c3f5..2d8820a 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/permissions.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/permissions.hpp
@@ -14,14 +14,60 @@
 #ifndef __STOUT_OS_PERMISSIONS_HPP__
 #define __STOUT_OS_PERMISSIONS_HPP__
 
+#include <sys/stat.h>
 
-// For readability, we minimize the number of #ifdef blocks in the code by
-// splitting platform specifc system calls into separate directories.
-#ifdef __WINDOWS__
-#include <stout/os/windows/permissions.hpp>
-#else
-#include <stout/os/posix/permissions.hpp>
-#endif // __WINDOWS__
+#include <string>
+
+
+namespace os {
+
+struct Permissions
+{
+  explicit Permissions(mode_t mode)
+  {
+    owner.r = mode & S_IRUSR;
+    owner.w = mode & S_IWUSR;
+    owner.x = mode & S_IXUSR;
+    owner.rwx = mode & S_IRWXU;
+    group.r = mode & S_IRGRP;
+    group.w = mode & S_IWGRP;
+    group.x = mode & S_IXGRP;
+    group.rwx = mode & S_IRWXG;
+    others.r = mode & S_IROTH;
+    others.w = mode & S_IWOTH;
+    others.x = mode & S_IXOTH;
+    others.rwx = mode & S_IRWXO;
+    setuid = mode & S_ISUID;
+    setgid = mode & S_ISGID;
+    sticky = mode & S_ISVTX;
+  }
+
+  struct
+  {
+    bool r;
+    bool w;
+    bool x;
+    bool rwx;
+  } owner, group, others;
+
+  bool setuid;
+  bool setgid;
+  bool sticky;
+};
+
+
+inline Try<Permissions> permissions(const std::string& path)
+{
+  struct stat status;
+  if (::stat(path.c_str(), &status) < 0) {
+    return ErrnoError();
+  }
+
+  return Permissions(status.st_mode);
+}
+
+
+} // namespace os {
 
 
 #endif // __STOUT_OS_PERMISSIONS_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/3b034277/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/permissions.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/permissions.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/permissions.hpp
deleted file mode 100644
index 98f0b3c..0000000
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/permissions.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __STOUT_OS_POSIX_PERMISSIONS_HPP__
-#define __STOUT_OS_POSIX_PERMISSIONS_HPP__
-
-#include <sys/stat.h>
-
-#include <string>
-
-
-namespace os {
-
-struct Permissions
-{
-  explicit Permissions(mode_t mode)
-  {
-    owner.r = mode & S_IRUSR;
-    owner.w = mode & S_IWUSR;
-    owner.x = mode & S_IXUSR;
-    owner.rwx = mode & S_IRWXU;
-    group.r = mode & S_IRGRP;
-    group.w = mode & S_IWGRP;
-    group.x = mode & S_IXGRP;
-    group.rwx = mode & S_IRWXG;
-    others.r = mode & S_IROTH;
-    others.w = mode & S_IWOTH;
-    others.x = mode & S_IXOTH;
-    others.rwx = mode & S_IRWXO;
-    setuid = mode & S_ISUID;
-    setgid = mode & S_ISGID;
-    sticky = mode & S_ISVTX;
-  }
-
-  struct {
-    bool r;
-    bool w;
-    bool x;
-    bool rwx;
-  } owner, group, others;
-
-  bool setuid;
-  bool setgid;
-  bool sticky;
-};
-
-
-inline Try<Permissions> permissions(const std::string& path)
-{
-  struct stat s;
-  if (::stat(path.c_str(), &s) < 0) {
-    return ErrnoError();
-  }
-  return Permissions(s.st_mode);
-}
-
-} // namespace os {
-
-#endif // __STOUT_OS_POSIX_PERMISSIONS_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/3b034277/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/permissions.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/permissions.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/permissions.hpp
deleted file mode 100644
index daed4b4..0000000
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/permissions.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __STOUT_OS_WINDOWS_PERMISSIONS_HPP__
-#define __STOUT_OS_WINDOWS_PERMISSIONS_HPP__
-
-#include <sys/stat.h>
-
-#include <string>
-
-
-namespace os {
-
-// Forward declaration.
-struct Permissions
-{
-  explicit Permissions(mode_t mode)
-  {
-    UNIMPLEMENTED;
-  }
-};
-
-
-inline Try<Permissions> permissions(const std::string& path)
-{
-  UNIMPLEMENTED;
-}
-
-} // namespace os {
-
-#endif // __STOUT_OS_WINDOWS_PERMISSIONS_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/3b034277/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
index 10bfa40..5f564d2 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
@@ -117,4 +117,102 @@ decltype(_mkdir(path))
 }
 
 
+// Permissions API. (cf. MESOS-3176 to track ongoing permissions work.)
+//
+// We are currently able to emulate a subset of the POSIX permissions model
+// with the Windows model:
+//   [x] User write permissions.
+//   [x] User read permissions.
+//   [ ] User execute permissions.
+//   [ ] Group permissions of any sort.
+//   [ ] Other permissions of any sort.
+//   [x] Flags to control "fallback" behavior (e.g., we might choose
+//       to fall back to user readability when the user passes the
+//       group readability flag in, since we currently do not support
+//       group readability).
+//
+//
+// Rationale:
+// Windows currently implements two permissions models: (1) an extremely
+// primitive permission model it largely inherited from DOS, and (2) the Access
+// Control List (ACL) API. Because there is no trivial way to map the classic
+// POSIX model into the ACL model, we have implemented POSIX-style permissions
+// in terms of the DOS model. The result is the permissions limitations above.
+//
+//
+// Flag implementation:
+// Flags fall into the following two categories.
+//   (1) Flags which exist in both permission models, but which have
+//       different names (e.g., `S_IRUSR` in POSIX is called `_S_IREAD` on
+//       Windows). In this case, we define the POSIX name to be the Windows
+//       value (e.g., we define `S_IRUSR` to have the same value as `_S_IREAD`),
+//       so that we can pass the POSIX name into Windows functions like
+//       `_open`.
+//   (2) Flags which exist only on POSIX (e.g., `S_IXUSR`). Here we
+//       define the POSIX name to be the value given in the glibc
+//       documentation[1], shifted left by 16 bits (since `mode_t`
+//       is unsigned short on POSIX and `int` on Windows). We give these
+//       flags glibc values to stay consistent, and so that existing
+//       calls to functions like `open` do not break when they try to
+//       use a flag that doesn't exist on Windows. But, of course,
+//       these flags do not affect the execution of these functions.
+//
+//
+// Flag strictness:
+// Because the current implementation does not directly support setting or
+// getting group or other permission bits on the Windows platform, there is a
+// question of what we should fall back to when these flags are passed in to
+// Stout methods.
+//
+// TODO(hausdorff): Investigate permissions mappings.
+// We force "strictness" of the permission flag semantics:
+//   * The group permissions flags will not fall back to anything, and will be
+//     completely ignored.
+//   * Other permissions: Same as above, but with other permissions.
+//
+//
+// Execute permissions:
+// Because DOS has no notion of "execute permissions", we define execute
+// permissions to be read permissions. This is not ideal, but it is closest to
+// being accurate.
+//
+//
+// [1] http://www.delorie.com/gnu/docs/glibc/libc_288.html
+
+
+// Corresponds to `mode_t` defined in sys/types.h of the POSIX spec.
+// See note above for an explanation of why this is an int instead of
+// unsigned short (as is common on *nix).
+typedef int mode_t;
+
+
+// User permission flags.
+const mode_t S_IRUSR = mode_t(_S_IREAD);  // Readable by user.
+const mode_t S_IWUSR = mode_t(_S_IWRITE); // Writeable by user.
+const mode_t S_IXUSR = S_IRUSR;           // Fallback to user read.
+const mode_t S_IRWXU = S_IRUSR | S_IWUSR | S_IXUSR;
+
+
+// Group permission flags. Lossy mapping to Windows permissions. See
+// note above about flag strictness for explanation.
+const mode_t S_IRGRP = 0x00200000;        // No-op.
+const mode_t S_IWGRP = 0x00100000;        // No-op.
+const mode_t S_IXGRP = 0x00080000;        // No-op.
+const mode_t S_IRWXG = S_IRGRP | S_IWGRP | S_IXGRP;
+
+
+// Other permission flags. Lossy mapping to Windows permissions. See
+// note above about flag stictness for explanation.
+const mode_t S_IROTH = 0x00040000;        // No-op.
+const mode_t S_IWOTH = 0x00020000;        // No-op.
+const mode_t S_IXOTH = 0x00010000;        // No-op.
+const mode_t S_IRWXO = S_IROTH | S_IWOTH | S_IXOTH;
+
+
+// Flags for set-ID-on-exec.
+const mode_t S_ISUID = 0x08000000;        // No-op.
+const mode_t S_ISGID = 0x04000000;        // No-op.
+const mode_t S_ISVTX = 0x02000000;        // No-op.
+
+
 #endif // __STOUT_WINDOWS_HPP__


[10/11] mesos git commit: Added firewall.cpp to the process library CMakeLists.

Posted by jo...@apache.org.
Added firewall.cpp to the process library CMakeLists.

Right now, if you try to build on a non-Windows machine with CMakeLists,
you'll get a linker error claiming that we can't find a symbol from the
process library's firewall.cpp.

This commit simply adds that source file, which fixes the problem.

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


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

Branch: refs/heads/master
Commit: 588b94e7806b4fb5ad2abb02b6229405858eef76
Parents: 788580c
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:07:56 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:15:24 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/588b94e7/3rdparty/libprocess/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index 9d1b1f5..fb9bd04 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -23,6 +23,7 @@ set(PROCESS_SRC
   decoder.hpp
   encoder.hpp
   event_loop.hpp
+  firewall.cpp
   gate.hpp
   help.cpp
   http.cpp


[09/11] mesos git commit: Cleaned up stout/windows.hpp.

Posted by jo...@apache.org.
Cleaned up stout/windows.hpp.

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


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

Branch: refs/heads/master
Commit: 788580cd808c998b6ae472c27bf8728ca37bf280
Parents: 066a5a8
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:07:46 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:15:18 2015 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/include/stout/windows.hpp    | 89 ++++++++++----------
 1 file changed, 46 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/788580cd/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
index 5f564d2..50e35f4 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
@@ -15,9 +15,14 @@
 #define __STOUT_WINDOWS_HPP__
 
 
+#include <fcntl.h>  // For file access flags like `_O_CREAT`.
+
+#include <Windows.h>
+
+
 // Definitions and constants used for Windows compat.
 //
-// Gathers most of the Windows-compatibility definitions. This makes it
+// Gathers most of the Windows-compatibility definitions.  This makes it
 // possible for files throughout the codebase to remain relatively free of all
 // the #if's we'd need to make them work.
 //
@@ -27,12 +32,44 @@
 //   * globally available throughout both the Stout codebase, and any code
 //     that uses it (such as Mesos).
 
-// Normally defined in unistd.h.
+
+// Define constants used for Windows compat. Allows a lot of code on
+// Windows and POSIX systems to be the same, because we can pass the
+// same constants to functions we call to do things like file I/O.
 #define STDIN_FILENO 0
 #define STDOUT_FILENO 1
 #define STDERR_FILENO 2
 
+#define R_OK 0x4
+#define W_OK 0x2
+#define X_OK 0x0 // No such permission on Windows.
+#define F_OK 0x0
+
+#define O_RDONLY _O_RDONLY
+#define O_WRONLY _O_WRONLY
+#define O_RDWR _O_RDWR
+#define O_CREAT _O_CREAT
+#define O_TRUNC _O_TRUNC
+#define O_APPEND _O_APPEND
+
+// TODO(hausdorff): (MESOS-3398) Not defined on Windows. This value is
+// temporary.
+#define MAXHOSTNAMELEN 64
+
+#define PATH_MAX _MAX_PATH
+
+// Corresponds to `mode_t` defined in sys/types.h of the POSIX spec.
+// See large "permissions API" comment below for an explanation of
+// why this is an int instead of unsigned short (as is common on
+// POSIX).
+typedef int mode_t;
+
+// `DWORD` is expected to be the type holding PIDs throughout the Windows API,
+// including functions like `OpenProcess`.
+typedef DWORD pid_t;
 
+// File I/O function aliases.
+//
 // NOTE: The use of `auto` and the trailing return type in the following
 // functions are meant to make it easier for Linux developers to use and
 // maintain the code. It is an explicit marker that we are using the compiler
@@ -59,32 +96,14 @@ decltype(_close(fd))
 }
 
 
-// TODO(aclemmer): (MESOS-3398) Not defined on Windows. This value is temporary.
-#define MAXHOSTNAMELEN 64
-
-
-inline auto access(const char* fileName, int accessMode) ->
-decltype(_access(fileName, accessMode))
+// Filesystem function aliases.
+inline auto mkdir(const char* path, mode_t mode) ->
+decltype(_mkdir(path))
 {
-  return _access(fileName, accessMode);
+  return _mkdir(path);
 }
-#define R_OK 0x4
-#define W_OK 0x2
-#define X_OK 0x0 // No such permission on Windows.
-#define F_OK 0x0
-
-// Aliases for file access modes.
-#include <fcntl.h>
-#define O_RDONLY _O_RDONLY
-#define O_WRONLY _O_WRONLY
-#define O_RDWR _O_RDWR
-#define O_CREAT _O_CREAT
-#define O_TRUNC _O_TRUNC
-#define O_APPEND _O_APPEND
-// TODO(josephw): No equivalent for O_NONBLOCK or O_SYNC.
 
 
-// Alias for mkstemp (requires io.h).
 inline auto mkstemp(char* path) ->
 decltype(_mktemp_s(path, strlen(path) + 1))
 {
@@ -92,9 +111,6 @@ decltype(_mktemp_s(path, strlen(path) + 1))
 }
 
 
-// Alias for realpath.
-#define PATH_MAX _MAX_PATH
-
 
 inline auto realpath(const char* path, char* resolved) ->
 decltype(_fullpath(resolved, path, PATH_MAX))
@@ -103,17 +119,10 @@ decltype(_fullpath(resolved, path, PATH_MAX))
 }
 
 
-// Corresponds to `mode_t` defined in sys/types.h of the POSIX spec.
-// See note above for an explanation of why this is an int instead of
-// unsigned short (as is common on POSIX).
-typedef int mode_t;
-
-
-// Alias for mkdir (requires direct.h).
-inline auto mkdir(const char* path, mode_t mode) ->
-decltype(_mkdir(path))
+inline auto access(const char* fileName, int accessMode) ->
+decltype(_access(fileName, accessMode))
 {
-  return _mkdir(path);
+  return _access(fileName, accessMode);
 }
 
 
@@ -180,12 +189,6 @@ decltype(_mkdir(path))
 // [1] http://www.delorie.com/gnu/docs/glibc/libc_288.html
 
 
-// Corresponds to `mode_t` defined in sys/types.h of the POSIX spec.
-// See note above for an explanation of why this is an int instead of
-// unsigned short (as is common on *nix).
-typedef int mode_t;
-
-
 // User permission flags.
 const mode_t S_IRUSR = mode_t(_S_IREAD);  // Readable by user.
 const mode_t S_IWUSR = mode_t(_S_IWRITE); // Writeable by user.


[04/11] mesos git commit: Modified definitions in windows.hpp to fit real compilation problems.

Posted by jo...@apache.org.
Modified definitions in windows.hpp to fit real compilation problems.

Essentially, there are some definitions that need to be there, and some
that are not quite right.

This commit adds and removes the definitions required to get the ip
tests to pass. We also add some nice comments.

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


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

Branch: refs/heads/master
Commit: 92ed652bf179fb93f9040602c2e8d74a90bb7114
Parents: 069f2e3
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:06:25 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:14:48 2015 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/include/stout/windows.hpp    | 97 ++++++++++++++++----
 1 file changed, 78 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/92ed652b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
index 7ab75ec..10bfa40 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
@@ -11,51 +11,110 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __STOUT_WINDOWS_PREPROCESSOR_HPP__
-#define __STOUT_WINDOWS_PREPROCESSOR_HPP__
+#ifndef __STOUT_WINDOWS_HPP__
+#define __STOUT_WINDOWS_HPP__
 
-// Provides aliases to Windows-specific nuances.
+
+// Definitions and constants used for Windows compat.
+//
+// Gathers most of the Windows-compatibility definitions. This makes it
+// possible for files throughout the codebase to remain relatively free of all
+// the #if's we'd need to make them work.
+//
+// Roughly, the things that should go in this file are definitions and
+// declarations that one would not mind being:
+//   * in global scope.
+//   * globally available throughout both the Stout codebase, and any code
+//     that uses it (such as Mesos).
 
 // Normally defined in unistd.h.
 #define STDIN_FILENO 0
 #define STDOUT_FILENO 1
 #define STDERR_FILENO 2
 
-// Alias for method in stdio.h.
-#define write(fd, buf, count) _write(fd, buf, count)
 
-// Aliases for 'inet_pton' and 'inet_ntop'.
-#define inet_pton(af, cp, buf) InetPton(af, cp, buf)
-#define inet_ntop(af, cp, buf, len) InetNtop(af, cp, buf, len)
+// NOTE: The use of `auto` and the trailing return type in the following
+// functions are meant to make it easier for Linux developers to use and
+// maintain the code. It is an explicit marker that we are using the compiler
+// to guarantee that the return type is identical to whatever is in the Windows
+// implementation of the standard.
+inline auto write(int fd, const void* buffer, size_t count) ->
+decltype(_write(fd, buffer, count))
+{
+  return _write(fd, buffer, count);
+}
+
+
+inline auto open(const char* path, int flags) ->
+decltype(_open(path, flags))
+{
+  return _open(path, flags);
+}
+
 
-// TODO(aclemmer): Not defined on Windows.  This value is temporary.
+inline auto close(int fd) ->
+decltype(_close(fd))
+{
+  return _close(fd);
+}
+
+
+// TODO(aclemmer): (MESOS-3398) Not defined on Windows. This value is temporary.
 #define MAXHOSTNAMELEN 64
 
-// Macros associated with ::access, usually defined in unistd.h.
-#define access(path, how) _access(path, how)
+
+inline auto access(const char* fileName, int accessMode) ->
+decltype(_access(fileName, accessMode))
+{
+  return _access(fileName, accessMode);
+}
 #define R_OK 0x4
 #define W_OK 0x2
-#define X_OK 0x0 // No such permission on Windows
+#define X_OK 0x0 // No such permission on Windows.
 #define F_OK 0x0
 
-// Aliases for file access modes (defined in fcntl.h).
+// Aliases for file access modes.
+#include <fcntl.h>
 #define O_RDONLY _O_RDONLY
 #define O_WRONLY _O_WRONLY
 #define O_RDWR _O_RDWR
 #define O_CREAT _O_CREAT
 #define O_TRUNC _O_TRUNC
 #define O_APPEND _O_APPEND
-// TODO(josephw): No equivalent for O_NONBLOCK or O_SYNC
+// TODO(josephw): No equivalent for O_NONBLOCK or O_SYNC.
+
 
 // Alias for mkstemp (requires io.h).
-#define mkstemp(path) _mktemp_s(path, strlen(path) + 1)
+inline auto mkstemp(char* path) ->
+decltype(_mktemp_s(path, strlen(path) + 1))
+{
+  return _mktemp_s(path, strlen(path) + 1);
+}
+
 
 // Alias for realpath.
-#define PATH_MAX MAX_PATH
-#define realpath(path, resolved) _fullpath(resolved, path, PATH_MAX)
+#define PATH_MAX _MAX_PATH
+
+
+inline auto realpath(const char* path, char* resolved) ->
+decltype(_fullpath(resolved, path, PATH_MAX))
+{
+  return _fullpath(resolved, path, PATH_MAX);
+}
+
+
+// Corresponds to `mode_t` defined in sys/types.h of the POSIX spec.
+// See note above for an explanation of why this is an int instead of
+// unsigned short (as is common on POSIX).
+typedef int mode_t;
+
 
 // Alias for mkdir (requires direct.h).
-#define mkdir(path, mode) _mkdir(path)
+inline auto mkdir(const char* path, mode_t mode) ->
+decltype(_mkdir(path))
+{
+  return _mkdir(path);
+}
 
 
-#endif // __STOUT_WINDOWS_PREPROCESSOR_HPP__
+#endif // __STOUT_WINDOWS_HPP__


[11/11] mesos git commit: Fixed CMake build compile error; don't compile GMock with cxx11 flag.

Posted by jo...@apache.org.
Fixed CMake build compile error; don't compile GMock with cxx11 flag.

Right now if you try to compile GMock a non-Windows platform using the
CMake build system, it will error out. The problem seems to be the CXX11
flag.

This commit will solve this problem by removing that flag.

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


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

Branch: refs/heads/master
Commit: cc0b6ea87f2ca9bb2d51d18f189b8d1bccc1c7a1
Parents: 588b94e
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:08:03 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:15:29 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/cc0b6ea8/3rdparty/libprocess/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/CMakeLists.txt b/3rdparty/libprocess/3rdparty/CMakeLists.txt
index c31191f..d13ba66 100644
--- a/3rdparty/libprocess/3rdparty/CMakeLists.txt
+++ b/3rdparty/libprocess/3rdparty/CMakeLists.txt
@@ -211,7 +211,7 @@ endif (REBUNDLED)
 
 if (APPLE)
   # GTEST on OSX needs its own tr1 tuple.
-  set(GMOCK_BUILD_CMD  make CPPFLAGS=-DGTEST_USE_OWN_TR1_TUPLE -DGTEST_LANG_CXX11)
+  set(GMOCK_BUILD_CMD  make CPPFLAGS=-DGTEST_USE_OWN_TR1_TUPLE)
   set(GMOCK_CONFIG_CMD ${GMOCK_ROOT}/configure --prefix=${GMOCK_ROOT}-lib/lib)
 elseif (NOT WIN32)
   set(GMOCK_CONFIG_CMD ${GMOCK_ROOT}/configure --prefix=${GMOCK_ROOT}-lib/lib)


[03/11] mesos git commit: Removed glog signal handler installation on Windows.

Posted by jo...@apache.org.
Removed glog signal handler installation on Windows.

glog declares, but does not define the function
`google::InstallFailureSignalHandler`. If you try to compile a call to
this function, you will get a linker error.

Since we can't use it, this commit will remove that code on Windows.

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


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

Branch: refs/heads/master
Commit: 069f2e3b9ae28b54b6fd550f65662022726c7b73
Parents: 66b6ab8
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:06:15 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:14:42 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/tests/main.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/069f2e3b/3rdparty/libprocess/3rdparty/stout/tests/main.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/main.cpp b/3rdparty/libprocess/3rdparty/stout/tests/main.cpp
index 1410cf1..d959216 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/main.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/main.cpp
@@ -23,8 +23,12 @@ int main(int argc, char** argv)
   // Initialize Google Mock/Test.
   testing::InitGoogleMock(&argc, argv);
 
-  // Install GLOG's signal handler.
+#ifndef __WINDOWS__
+  // Install glog's signal handler. NOTE: this function is declared but not
+  // defined on Windows, so if we attempt to compile this on Windows, we get
+  // a linker error.
   google::InstallFailureSignalHandler();
+#endif // __WINDOWS__
 
   return RUN_ALL_TESTS();
 }


[05/11] mesos git commit: Implemented os::close for Windows.

Posted by jo...@apache.org.
Implemented os::close for Windows.

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


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

Branch: refs/heads/master
Commit: 342f2b301ef42dee3077351db8debdc054e32848
Parents: 92ed652
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Sep 10 12:06:49 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Sep 10 17:14:54 2015 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/include/Makefile.am          |  2 --
 .../3rdparty/stout/include/stout/os/close.hpp   | 28 +++++++++++----
 .../stout/include/stout/os/posix/close.hpp      | 37 --------------------
 .../stout/include/stout/os/windows/close.hpp    | 31 ----------------
 4 files changed, 22 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/342f2b30/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
index 8853f92..58844a2 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
@@ -59,7 +59,6 @@ nobase_include_HEADERS =		\
   stout/os/fork.hpp			\
   stout/os/killtree.hpp			\
   stout/os/linux.hpp			\
-  stout/os/posix/close.hpp		\
   stout/os/posix/exists.hpp		\
   stout/os/posix/fcntl.hpp		\
   stout/os/posix/fork.hpp		\
@@ -88,7 +87,6 @@ nobase_include_HEADERS =		\
   stout/os/permissions.hpp		\
   stout/os/pstree.hpp			\
   stout/os/sysctl.hpp			\
-  stout/os/windows/close.hpp		\
   stout/os/windows/exists.hpp		\
   stout/os/windows/fcntl.hpp		\
   stout/os/windows/fork.hpp		\

http://git-wip-us.apache.org/repos/asf/mesos/blob/342f2b30/3rdparty/libprocess/3rdparty/stout/include/stout/os/close.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/close.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/close.hpp
index 972f833..b692596 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/close.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/close.hpp
@@ -15,13 +15,29 @@
 #define __STOUT_OS_CLOSE_HPP__
 
 
-// For readability, we minimize the number of #ifdef blocks in the code by
-// splitting platform specifc system calls into separate directories.
-#ifdef __WINDOWS__
-#include <stout/os/windows/close.hpp>
-#else
-#include <stout/os/posix/close.hpp>
+#ifndef __WINDOWS__
+#include <unistd.h>
 #endif // __WINDOWS__
 
+#include <stout/error.hpp>
+#include <stout/nothing.hpp>
+#include <stout/try.hpp>
+
+
+namespace os {
+
+
+inline Try<Nothing> close(int fd)
+{
+  if (::close(fd) != 0) {
+    return ErrnoError();
+  }
+
+  return Nothing();
+}
+
+
+} // namespace os {
+
 
 #endif // __STOUT_OS_CLOSE_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/342f2b30/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/close.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/close.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/close.hpp
deleted file mode 100644
index d8679ca..0000000
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/close.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __STOUT_OS_POSIX_CLOSE_HPP__
-#define __STOUT_OS_POSIX_CLOSE_HPP__
-
-#include <unistd.h>
-
-#include <stout/error.hpp>
-#include <stout/nothing.hpp>
-#include <stout/try.hpp>
-
-
-namespace os {
-
-inline Try<Nothing> close(int fd)
-{
-  if (::close(fd) != 0) {
-    return ErrnoError();
-  }
-
-  return Nothing();
-}
-
-} // namespace os {
-
-#endif // __STOUT_OS_POSIX_CLOSE_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/342f2b30/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/close.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/close.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/close.hpp
deleted file mode 100644
index 134a26b..0000000
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/close.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __STOUT_OS_WINDOWS_CLOSE_HPP__
-#define __STOUT_OS_WINDOWS_CLOSE_HPP__
-
-#include <stout/nothing.hpp>
-#include <stout/try.hpp>
-
-
-namespace os {
-
-inline Try<Nothing> close(int fd)
-{
-  UNIMPLEMENTED;
-}
-
-} // namespace os {
-
-#endif // __STOUT_OS_WINDOWS_CLOSE_HPP__