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 2017/01/12 01:45:24 UTC

[01/11] mesos git commit: Windows: Added check for Admin privileges in build script.

Repository: mesos
Updated Branches:
  refs/heads/master b35629be1 -> c7fc1377b


Windows: Added check for Admin privileges in build script.

The Mesos agent in particular creates symlinks regularly.  On Windows,
symlink creation requires Administrator privileges, which means that
the Mesos test suite must be run as an Administrator.  The test suite
will generally CHECK-fail otherwise.


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

Branch: refs/heads/master
Commit: 27cd5c7fe35029a7970da764901f1f4508728a5a
Parents: c17ebde
Author: Joseph Wu <jo...@apache.org>
Authored: Tue Jan 10 16:59:40 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 14:29:26 2017 -0800

----------------------------------------------------------------------
 support/windows-build.bat | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/27cd5c7f/support/windows-build.bat
----------------------------------------------------------------------
diff --git a/support/windows-build.bat b/support/windows-build.bat
index 09a9f83..4af5ae3 100644
--- a/support/windows-build.bat
+++ b/support/windows-build.bat
@@ -80,6 +80,16 @@ REM Build everything else.
 msbuild Mesos.sln /p:PreferredToolArchitecture=x64 /m
 if %errorlevel% neq 0 exit /b %errorlevel%
 
+REM Due to how Mesos uses and creates symlinks, the next test suite
+REM will only pass when run as an Administrator. The following command
+REM is a read-only command that only passes for Administrators.
+REM See: https://technet.microsoft.com/en-us/library/bb490711.aspx
+net session >nul 2>&1
+if %errorlevel% neq 0 (
+    echo Administrator permissions not detected.  Skipping Mesos tests...
+    goto :eof
+)
+
 REM Run mesos tests.
 "src/mesos-tests.exe" --verbose
 if %errorlevel% neq 0 exit /b %errorlevel%


[03/11] mesos git commit: Fixed spelling in a comment.

Posted by jo...@apache.org.
Fixed spelling in a comment.


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

Branch: refs/heads/master
Commit: f1cba06eeab00767d68965cfb5242fabb7a5c25f
Parents: b35629b
Author: Joseph Wu <jo...@apache.org>
Authored: Mon Jan 9 17:23:38 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 14:29:26 2017 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/process.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f1cba06e/3rdparty/libprocess/include/process/process.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/process.hpp b/3rdparty/libprocess/include/process/process.hpp
index 1b066b2..b118f1a 100644
--- a/3rdparty/libprocess/include/process/process.hpp
+++ b/3rdparty/libprocess/include/process/process.hpp
@@ -99,7 +99,7 @@ protected:
    * Invoked when a process is terminated.
    *
    * **NOTE**: this does not get invoked automatically if
-   * `process::ProcessBase::visit(const TerminateEvent&)` is overriden.
+   * `process::ProcessBase::visit(const TerminateEvent&)` is overridden.
    */
   virtual void finalize() {}
 


[11/11] mesos git commit: CMake: Added correct values for some build flags.

Posted by jo...@apache.org.
CMake: Added correct values for some build flags.

Currently, the CMake build does not implement certain build flags
as the autotools solution does. For example, `BUILD_DATE` is hard coded,
and the `BUILD_USER` flags is always "frank". This commit will add
correct values for all such flags, with the exception of `BUILD_FLAGS`.

In addition, this commit will take this opportunity to clean up the
organization of the build flags. Currently, we call `add_definitions`
individually for each flag we wish to define. This commit will introduce
a new variable, `MESOS_CPPFLAGS`, which holds the build flags for the
project. We call `add_definitions` once, when `MESOS_CPPFLAGS` is
completely populated.

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


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

Branch: refs/heads/master
Commit: c7fc1377b33c4eb83a01167bdb53c102c06b9a99
Parents: b5d307a
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Jan 11 17:34:16 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 17:36:40 2017 -0800

----------------------------------------------------------------------
 cmake/CompilationConfigure.cmake | 75 ++++++++++++++++++++++++++++-------
 src/CMakeLists.txt               | 10 -----
 2 files changed, 60 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c7fc1377/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 1349afb..560935b 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -190,16 +190,22 @@ if (WIN32)
   # to give the build system fine-grained control over what code is #ifdef'd
   # out in the future.  Using only flags defined by our build system to control
   # this logic is the clearest and most stable way of accomplishing this.
-  add_definitions(-D__WINDOWS__)
-  add_definitions(-DHAVE_LIBZ)
+  set(MESOS_CPPFLAGS
+    ${MESOS_CPPFLAGS}
+    -D__WINDOWS__
+    -DHAVE_LIBZ
+    )
 
   # Defines to disable warnings generated by Visual Studio when using
   # deprecated functions in CRT and the use of insecure functions in CRT.
   # TODO(dpravat): Once the entire codebase is changed to use secure CRT
   # functions, these defines should be removed.
-  add_definitions(-D_SCL_SECURE_NO_WARNINGS)
-  add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-  add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
+  set(MESOS_CPPFLAGS
+    ${MESOS_CPPFLAGS}
+    -D_SCL_SECURE_NO_WARNINGS
+    -D_CRT_SECURE_NO_WARNINGS
+    -D_CRT_NONSTDC_NO_WARNINGS
+    )
 
   # Directory structure definitions.
   # TODO(hausdorff): (MESOS-5455) These are placeholder values.
@@ -221,8 +227,11 @@ if (WIN32)
   #
   # [1] https://google-glog.googlecode.com/svn/trunk/doc/glog.html#windows
   # [2] https://code.google.com/p/google-glog/source/browse/trunk/src/windows/glog/logging.h?r=113
-  add_definitions(-DNOGDI)
-  add_definitions(-DNOMINMAX)
+  set(MESOS_CPPFLAGS
+    ${MESOS_CPPFLAGS}
+    -DNOGDI
+    -DNOMINMAX
+    )
 endif (WIN32)
 
 # GLOBAL CONFIGURATION.
@@ -232,19 +241,55 @@ if (HAS_AUTHENTICATION)
   # `-DHAS_AUTHENTICATION=${HAS_AUTHENTICATION}`, as this will define the
   # symbol, and our intention is to only define it if the CMake variable
   # `HAS_AUTHENTICATION` is set.
-  add_definitions(-DHAS_AUTHENTICATION=1)
+  set(MESOS_CPPFLAGS
+    ${MESOS_CPPFLAGS}
+    -DHAS_AUTHENTICATION=1
+    )
 endif (HAS_AUTHENTICATION)
 
 # Enable the INT64 support for PicoJSON.
-add_definitions(-DPICOJSON_USE_INT64)
-
 # NOTE: PicoJson requires __STDC_FORMAT_MACROS to be defined before importing
 # 'inttypes.h'.  Since other libraries may also import this header, it must
 # be globally defined so that PicoJson has access to the macros, regardless
 # of the order of inclusion.
-add_definitions(-D__STDC_FORMAT_MACROS)
+set(MESOS_CPPFLAGS
+  ${MESOS_CPPFLAGS}
+  -DPICOJSON_USE_INT64
+  -D__STDC_FORMAT_MACROS
+  )
+
+set(MESOS_CPPFLAGS
+  ${MESOS_CPPFLAGS}
+  -DPKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}"
+  -DLIBDIR="${LIB_INSTALL_DIR}"
+  -DVERSION="${PACKAGE_VERSION}"
+  -DPKGDATADIR="${DATA_INSTALL_PREFIX}"
+  )
+
+# Add build information to Mesos flags.
+string(TIMESTAMP BUILD_DATE "%Y-%m-%d %H:%M:%S UTC" UTC)
+string(TIMESTAMP BUILD_TIME "%s" UTC)
+if (WIN32)
+  set(BUILD_USER "$ENV{USERNAME}")
+else (WIN32)
+  set(BUILD_USER "$ENV{USER}")
+endif (WIN32)
 
-add_definitions(-DPKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}")
-add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}")
-add_definitions(-DVERSION="${PACKAGE_VERSION}")
-add_definitions(-DPKGDATADIR="${DATA_INSTALL_PREFIX}")
+# TODO(hausdorff): (MESOS-5902) Populate this value when we integrate Java
+# support.
+set(BUILD_JAVA_JVM_LIBRARY "")
+
+# NOTE: The quotes in these definitions are necessary. Without them, the
+# preprocessor will interpret the symbols as (e.g.) int literals and uquoted
+# identifiers, rather than the string values our code expects.
+set(MESOS_CPPFLAGS
+  ${MESOS_CPPFLAGS}
+  -DUSE_STATIC_LIB
+  -DBUILD_DATE="${BUILD_DATE}"
+  -DBUILD_TIME="${BUILD_TIME}"
+  -DBUILD_USER="${BUILD_USER}"
+  -DBUILD_JAVA_JVM_LIBRARY="${BUILD_JAVA_JVM_LIBRARY}"
+  )
+
+# TODO(hausdorff): (MESOS-5455) `BUILD_FLAGS` is currently a placeholder value.
+add_definitions(${MESOS_CPPFLAGS} -DBUILD_FLAGS="")

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7fc1377/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c8d4260..ce71afc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -474,21 +474,11 @@ if (LINUX)
   set(MESOS_SRC ${MESOS_SRC} ${LINUX_SRC})
 endif (LINUX)
 
-# TODO(hausdorff): (MESOS-5455) These are placeholder values. Transition away
-# from them.
-set(BUILD_DATE "\"2016-3-3 10:20\"")
-set(BUILD_TIME "\"1111100\"")
-set(BUILD_USER "\"frank\"")
-set(BUILD_FLAGS "\"\"")
-set(BUILD_JAVA_JVM_LIBRARY "")
-
 # Include source for Windows build.
 if (WIN32)
   set(MESOS_SRC ${MESOS_SRC} ${WIN32_SRC})
 endif (WIN32)
 
-add_definitions(-DUSE_STATIC_LIB -DBUILD_DATE=${BUILD_DATE} -DBUILD_TIME=${BUILD_TIME} -DBUILD_USER=${BUILD_USER} -DBUILD_FLAGS=${BUILD_FLAGS} -DBUILD_JAVA_JVM_LIBRARY="")
-
 # INCLUDE DIRECTIVES FOR MESOS LIBRARY (generates, e.g., -I/path/to/thing
 # on Linux).
 #########################################################################


[04/11] mesos git commit: CMake: Removed special case for `BUILD_DIR` on Windows.

Posted by jo...@apache.org.
CMake: Removed special case for `BUILD_DIR` on Windows.

Currently in the test harness, we pass the flags `-DSOURCE_DIR` and
`-DBUILD_DIR` to the compiler. These are used to do things like
determine where the containerizer binary is to launch it for tests.

On Windows, these paths should be Windows-style, with '\' characters
separating path components. Unfortunately, CMake does not escape these
slashes in path strings, so when we pass them as preprocessor flags,
a string like `C:\src` will look to the standard Windows API like a
string with an escaped '\s' character.

On the other hand, Windows APIs are happy to take Unix-style paths as
arguments. So, to unblock making the agent tests work, we simply use
Unix paths here.

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


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

Branch: refs/heads/master
Commit: ef060827355357880edf655d1a41071dfd3d32b1
Parents: 0734785
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Jan 11 13:45:04 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 14:29:27 2017 -0800

----------------------------------------------------------------------
 src/tests/cmake/MesosTestsConfigure.cmake | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ef060827/src/tests/cmake/MesosTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/tests/cmake/MesosTestsConfigure.cmake b/src/tests/cmake/MesosTestsConfigure.cmake
index ca042bd..8d41638 100644
--- a/src/tests/cmake/MesosTestsConfigure.cmake
+++ b/src/tests/cmake/MesosTestsConfigure.cmake
@@ -26,13 +26,17 @@ set(
 
 # COMPILER CONFIGURATION.
 #########################
-if (WIN32)
-  STRING(REGEX REPLACE "/" "\\\\" CURRENT_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
-  STRING(REGEX REPLACE "/" "\\\\" CURRENT_CMAKE_BUILD_DIR ${CMAKE_BINARY_DIR})
-else (WIN32)
-  set(CURRENT_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
-  set(CURRENT_CMAKE_BUILD_DIR ${CMAKE_BINARY_DIR})
-endif (WIN32)
+# NOTE: On Windows, these paths should be Windows-style, with '\' characters
+# separating path components. Unfortunately, CMake does not escape these
+# slashes in path strings, so when we pass them as preprocessor flags,
+# a string like `C:\src` will look to the standard Windows API like a
+# string with an escaped '\s' character.
+#
+# On the other hand, Windows APIs are happy to take Unix-style paths as
+# arguments. So, to unblock making the agent tests work, we simply use
+# Unix paths here.
+set(CURRENT_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
+set(CURRENT_CMAKE_BUILD_DIR ${CMAKE_BINARY_DIR})
 
 add_definitions(-DSOURCE_DIR="${CURRENT_CMAKE_SOURCE_DIR}")
 add_definitions(-DBUILD_DIR="${CURRENT_CMAKE_BUILD_DIR}")


[02/11] mesos git commit: Fixed spelling in a comment.

Posted by jo...@apache.org.
Fixed spelling in a comment.

Adds a missing "d" in all instances of "overriden".


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

Branch: refs/heads/master
Commit: c17ebde4c8aa181056cf6a0326374a195a903dda
Parents: f1cba06
Author: Joseph Wu <jo...@apache.org>
Authored: Mon Jan 9 17:25:26 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 14:29:26 2017 -0800

----------------------------------------------------------------------
 docs/logging.md                               |  2 +-
 src/slave/container_loggers/lib_logrotate.cpp | 20 ++++++++++----------
 src/slave/container_loggers/lib_logrotate.hpp |  4 ++--
 src/slave/container_loggers/logrotate.hpp     |  2 +-
 src/tests/containerizer/isolator.hpp          |  2 +-
 support/mesos-tidy.sh                         |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c17ebde4/docs/logging.md
----------------------------------------------------------------------
diff --git a/docs/logging.md b/docs/logging.md
index c62fa13..75c4385 100644
--- a/docs/logging.md
+++ b/docs/logging.md
@@ -124,7 +124,7 @@ setting the `--container_logger` Agent flag to
   [logrotate_stdout_options]
   size [max_stdout_size]
 }</pre>
-      NOTE: The <code>size</code> option will be overriden by this module.
+      NOTE: The <code>size</code> option will be overridden by this module.
     </td>
   </tr>
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c17ebde4/src/slave/container_loggers/lib_logrotate.cpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/lib_logrotate.cpp b/src/slave/container_loggers/lib_logrotate.cpp
index 60d6f00..b257f48 100644
--- a/src/slave/container_loggers/lib_logrotate.cpp
+++ b/src/slave/container_loggers/lib_logrotate.cpp
@@ -103,11 +103,11 @@ public:
     // Copy the global rotation flags.
     // These will act as the defaults in case the executor environment
     // overrides a subset of them.
-    LoggerFlags overridenFlags;
-    overridenFlags.max_stdout_size = flags.max_stdout_size;
-    overridenFlags.logrotate_stdout_options = flags.logrotate_stdout_options;
-    overridenFlags.max_stderr_size = flags.max_stderr_size;
-    overridenFlags.logrotate_stderr_options = flags.logrotate_stderr_options;
+    LoggerFlags overriddenFlags;
+    overriddenFlags.max_stdout_size = flags.max_stdout_size;
+    overriddenFlags.logrotate_stdout_options = flags.logrotate_stdout_options;
+    overriddenFlags.max_stderr_size = flags.max_stderr_size;
+    overriddenFlags.logrotate_stderr_options = flags.logrotate_stderr_options;
 
     // Check for overrides of the rotation settings in the
     // `ExecutorInfo`s environment variables.
@@ -129,7 +129,7 @@ public:
       }
 
       // We will error out if there are unknown flags with the same prefix.
-      Try<flags::Warnings> load = overridenFlags.load(executorEnvironment);
+      Try<flags::Warnings> load = overriddenFlags.load(executorEnvironment);
 
       if (load.isError()) {
         return Failure(
@@ -169,8 +169,8 @@ public:
 
     // Spawn a process to handle stdout.
     mesos::internal::logger::rotate::Flags outFlags;
-    outFlags.max_size = overridenFlags.max_stdout_size;
-    outFlags.logrotate_options = overridenFlags.logrotate_stdout_options;
+    outFlags.max_size = overriddenFlags.max_stdout_size;
+    outFlags.logrotate_options = overriddenFlags.logrotate_stdout_options;
     outFlags.log_filename = path::join(sandboxDirectory, "stdout");
     outFlags.logrotate_path = flags.logrotate_path;
     outFlags.user = user;
@@ -227,8 +227,8 @@ public:
 
     // Spawn a process to handle stderr.
     mesos::internal::logger::rotate::Flags errFlags;
-    errFlags.max_size = overridenFlags.max_stderr_size;
-    errFlags.logrotate_options = overridenFlags.logrotate_stderr_options;
+    errFlags.max_size = overriddenFlags.max_stderr_size;
+    errFlags.logrotate_options = overriddenFlags.logrotate_stderr_options;
     errFlags.log_filename = path::join(sandboxDirectory, "stderr");
     errFlags.logrotate_path = flags.logrotate_path;
     errFlags.user = user;

http://git-wip-us.apache.org/repos/asf/mesos/blob/c17ebde4/src/slave/container_loggers/lib_logrotate.hpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/lib_logrotate.hpp b/src/slave/container_loggers/lib_logrotate.hpp
index f2abfe7..e37d99c 100644
--- a/src/slave/container_loggers/lib_logrotate.hpp
+++ b/src/slave/container_loggers/lib_logrotate.hpp
@@ -63,7 +63,7 @@ struct LoggerFlags : public virtual flags::FlagsBase
         "    <logrotate_stdout_options>\n"
         "    size <max_stdout_size>\n"
         "  }\n"
-        "NOTE: The 'size' option will be overriden by this module.");
+        "NOTE: The 'size' option will be overridden by this module.");
 
     add(&LoggerFlags::max_stderr_size,
         "max_stderr_size",
@@ -81,7 +81,7 @@ struct LoggerFlags : public virtual flags::FlagsBase
         "    <logrotate_stderr_options>\n"
         "    size <max_stderr_size>\n"
         "  }\n"
-        "NOTE: The 'size' option will be overriden by this module.");
+        "NOTE: The 'size' option will be overridden by this module.");
   }
 
   static Option<Error> validateSize(const Bytes& value)

http://git-wip-us.apache.org/repos/asf/mesos/blob/c17ebde4/src/slave/container_loggers/logrotate.hpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/logrotate.hpp b/src/slave/container_loggers/logrotate.hpp
index 96dbd2d..1fce8e3 100644
--- a/src/slave/container_loggers/logrotate.hpp
+++ b/src/slave/container_loggers/logrotate.hpp
@@ -74,7 +74,7 @@ struct Flags : public virtual flags::FlagsBase
         "    <logrotate_options>\n"
         "    size <max_size>\n"
         "  }\n"
-        "NOTE: The 'size' option will be overriden by this command.");
+        "NOTE: The 'size' option will be overridden by this command.");
 
     add(&Flags::log_filename,
         "log_filename",

http://git-wip-us.apache.org/repos/asf/mesos/blob/c17ebde4/src/tests/containerizer/isolator.hpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/isolator.hpp b/src/tests/containerizer/isolator.hpp
index 86664a8..f31cf6d 100644
--- a/src/tests/containerizer/isolator.hpp
+++ b/src/tests/containerizer/isolator.hpp
@@ -28,7 +28,7 @@ namespace tests {
 // Provides a mock Isolator that by default expects calls to
 // Isolator::prepare, Isolator::isolate, Isolator::watch, and
 // Isolator::cleanup and simply returns "nothing" as appropriate for
-// each call. This behavior can be overriden by adding EXPECT_CALL as
+// each call. This behavior can be overridden by adding EXPECT_CALL as
 // necessary. For example, if you don't expect any calls to
 // Isolator::cleanup you can do:
 //

http://git-wip-us.apache.org/repos/asf/mesos/blob/c17ebde4/support/mesos-tidy.sh
----------------------------------------------------------------------
diff --git a/support/mesos-tidy.sh b/support/mesos-tidy.sh
index da7d7ee..98ea385 100755
--- a/support/mesos-tidy.sh
+++ b/support/mesos-tidy.sh
@@ -23,7 +23,7 @@ TAG=mesos-tidy-`date +%s`-$RANDOM
 # images on DockerHub and use them.
 docker build --no-cache=true -t $TAG mesos-tidy/
 
-# Configure how checks are run. These variables can be overriden by setting the
+# Configure how checks are run. These variables can be overridden by setting the
 # respective environment variables before invoking this script.
 # TODO(bbannier): Enable more upstream checks by default, e.g., from the Google set.
 CHECKS=${CHECKS:-'-*,mesos-*'}


[07/11] mesos git commit: CMake: Added source groups to Stout build.

Posted by jo...@apache.org.
CMake: Added source groups to Stout build.

Currently in IDEs such as XCode and Visual Studio, all mesos source
files are grouped into one huge folder, with no attempt made to reflect
the hierarchy of folders that exist on disk.

This commit groups Stout files into relevant source groups so that they
appear in a sensible directory structure in these IDEs.

In addition to beginning to directly address MESOS-3542, this is also
(indirectly) the first step towards addressing the problem of breaking
libmesos up into smaller binaries (MESOS-3542).

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


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

Branch: refs/heads/master
Commit: 1dee96660178f8c2feec701d46ca16131d453709
Parents: 60b1a6e
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Jan 11 14:26:01 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 14:29:27 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/cmake/StoutConfigure.cmake | 43 ++++++++++++++++++++++++
 3rdparty/stout/tests/CMakeLists.txt       | 46 +++++++++++++++++++-------
 2 files changed, 77 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1dee9666/3rdparty/stout/cmake/StoutConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/StoutConfigure.cmake b/3rdparty/stout/cmake/StoutConfigure.cmake
index 04e0f2f..bc27ac6 100644
--- a/3rdparty/stout/cmake/StoutConfigure.cmake
+++ b/3rdparty/stout/cmake/StoutConfigure.cmake
@@ -27,6 +27,49 @@ if (NOT WIN32)
   find_package(Svn REQUIRED)
 endif (NOT WIN32)
 
+# SOURCE GROUPS. Allows IDEs to group header files for projects taking a
+# dependency on this package.
+########################################################################
+file(
+  GLOB_RECURSE
+  STOUT_HEADERS
+  "${STOUT_INCLUDE_DIR}/stout/*.hpp"
+  "${STOUT_INCLUDE_DIR}/stout/*.h"
+  )
+
+macro(GROUP_STOUT_HEADERS)
+  source_group(
+    "Stout Headers"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/.*\\.hpp")
+  source_group(
+    "Stout Headers\\flags"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/flags/.*\\.hpp")
+  source_group(
+    "Stout Headers\\internal\\windows"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/internal/windows/.*\\.hpp")
+  source_group(
+    "Stout Headers\\os"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/os/.*\\.hpp")
+  source_group(
+    "Stout Headers\\os\\posix"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/os/posix/.*\\.hpp")
+  source_group(
+    "Stout Headers\\os\\raw"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/os/raw/.*\\.hpp")
+  source_group(
+    "Stout Headers\\os\\windows"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/os/windows/.*\\.hpp")
+  source_group(
+    "Stout Headers\\posix"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/posix/.*\\.hpp")
+  source_group(
+    "Stout Headers\\tests"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/tests/.*\\.hpp")
+  source_group(
+    "Stout Headers\\windows"
+    REGULAR_EXPRESSION "${STOUT_INCLUDE_DIR}/stout/windows/.*\\.hpp")
+endmacro(GROUP_STOUT_HEADERS)
+
 # DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
 # download/configure/build all third-party libraries before attempting to build.
 ################################################################################

http://git-wip-us.apache.org/repos/asf/mesos/blob/1dee9666/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/stout/tests/CMakeLists.txt
index 724bfb1..a8a3ac7 100644
--- a/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/stout/tests/CMakeLists.txt
@@ -16,8 +16,8 @@
 
 # STOUT TESTS.
 ##############
-set(STOUT_TESTS_SRC
-  ${STOUT_TESTS_SRC}
+set(STOUT_ROOT_TESTS_SRC
+  ${STOUT_ROOT_TESTS_SRC}
   base64_tests.cpp
   bits_tests.cpp
   bytes_tests.cpp
@@ -41,13 +41,6 @@ set(STOUT_TESTS_SRC
   numify_tests.cpp
   option_tests.cpp
   os_tests.cpp
-  os/env_tests.cpp
-  os/filesystem_tests.cpp
-  os/process_tests.cpp
-  os/rmdir_tests.cpp
-  os/socket_tests.cpp
-  os/strerror_tests.cpp
-  os/systems_tests.cpp
   protobuf_tests.pb.h
   protobuf_tests.proto
   recordio_tests.cpp
@@ -61,21 +54,45 @@ set(STOUT_TESTS_SRC
   )
 
 if (NOT WIN32)
-  set(STOUT_TESTS_SRC
-    ${STOUT_TESTS_SRC}
+  set(STOUT_ROOT_TESTS_SRC
+    ${STOUT_ROOT_TESTS_SRC}
     path_tests.cpp
     protobuf_tests.cpp
     protobuf_tests.pb.cc
     svn_tests.cpp
+    )
+endif (NOT WIN32)
+
+set(STOUT_OS_TESTS_SRC
+  ${STOUT_OS_TESTS_SRC}
+  os/env_tests.cpp
+  os/filesystem_tests.cpp
+  os/process_tests.cpp
+  os/rmdir_tests.cpp
+  os/socket_tests.cpp
+  os/strerror_tests.cpp
+  os/systems_tests.cpp
+  )
+
+if (NOT WIN32)
+  set(STOUT_OS_TESTS_SRC
+    ${STOUT_OS_TESTS_SRC}
     os/sendfile_tests.cpp
     os/signals_tests.cpp
     )
 endif (NOT WIN32)
 
 if (LINUX)
-  set(STOUT_TESTS_SRC ${STOUT_TESTS_SRC} proc_tests.cpp)
+  set(STOUT_ROOT_TESTS_SRC ${STOUT_ROOT_TESTS_SRC} proc_tests.cpp)
 endif (LINUX)
 
+set(STOUT_TESTS_SRC
+  ${STOUT_TESTS_SRC}
+  ${STOUT_HEADERS}
+  ${STOUT_ROOT_TESTS_SRC}
+  ${STOUT_OS_TESTS_SRC}
+  )
+
 # INCLUDE DIRECTIVES FOR STOUT TEST BINARY (generates, e.g., -I/path/to/thing
 # on Linux).
 #############################################################################
@@ -90,6 +107,11 @@ link_directories(${STOUT_TEST_LIB_DIRS})
 ###########################################################################
 add_executable(${STOUT_TESTS_TARGET} ${STOUT_TESTS_SRC})
 
+source_group("tests" FILES ${STOUT_ROOT_TESTS_SRC})
+source_group("tests\\os" FILES ${STOUT_OS_TESTS_SRC})
+
+GROUP_STOUT_HEADERS()
+
 # ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
 ######################################################
 target_link_libraries(${STOUT_TESTS_TARGET} ${STOUT_TEST_LIBS})


[06/11] mesos git commit: Ported apply-reviews.py script to Windows.

Posted by jo...@apache.org.
Ported apply-reviews.py script to Windows.

This removes some of the shell-specific things this script was doing
in favor of native Python, which works on Windows.

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


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

Branch: refs/heads/master
Commit: b97ed632b1c68aa6402946d3365edfef8bcec130
Parents: 27cd5c7
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Tue Jan 10 17:33:35 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 14:29:27 2017 -0800

----------------------------------------------------------------------
 support/apply-reviews.py | 81 +++++++++++++++++++++++--------------------
 1 file changed, 44 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b97ed632/support/apply-reviews.py
----------------------------------------------------------------------
diff --git a/support/apply-reviews.py b/support/apply-reviews.py
index 8dc1817..b9b978a 100755
--- a/support/apply-reviews.py
+++ b/support/apply-reviews.py
@@ -4,7 +4,9 @@ import atexit
 import json
 import linecache
 import os
+import platform
 import re
+import ssl
 import subprocess
 import sys
 import urllib2
@@ -111,52 +113,44 @@ def shell(command, dry_run):
     sys.exit(error_code)
 
 
-def remove_patch(file_name=None):
-  """Removes the file. In case the file name is not provided it reads the
-  file name from global options dictionary."""
-  if file_name == None:
-    cmd = 'rm -f {_file}.patch'.format(_file=patch_id())
-  else:
-    cmd = 'rm -f {_file}'.format(_file=file_name)
-
-  # In case of github we always need to fetch the patch to extract username and
-  # email, so to ensure that it always gets cleaned up we ignore the dry_run
-  # option by always setting the second parameter to False.
-  if options['github']:
-    shell(cmd, False)
-  else:
-    shell(cmd, options['dry_run'])
-
-
 def apply_review():
   """Applies a review with a given ID locally."""
   # Make sure we don't leave the patch behind in case of failure.
-  atexit.register(lambda: remove_patch('{_file}.patch'\
-                                       .format(_file=patch_id())))
+  atexit.register(lambda: os.remove('%s.patch' % patch_id()))
 
   fetch_patch()
   apply_patch()
   commit_patch()
-  remove_patch()
+
+
+def ssl_create_default_context():
+  """
+  Equivalent to `ssl.create_default_context` with default arguments and
+  certificate/hostname verification disabled.
+  See: https://github.com/python/cpython/blob/2.7/Lib/ssl.py#L410"""
+  context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+
+  # SSLv2 considered harmful.
+  context.options |= ssl.OP_NO_SSLv2
+
+  # SSLv3 has problematic security and is only required for really old
+  # clients such as IE6 on Windows XP.
+  context.options |= ssl.OP_NO_SSLv3
+
+  # Disable compression to prevent CRIME attacks (OpenSSL 1.0+).
+  context.options |= getattr(ssl, "OP_NO_COMPRESSION", 0)
+
+  # Disable certificate and hostname verification.
+  context.verify_mode = ssl.CERT_NONE
+  context.check_hostname = False
 
 
 def fetch_patch():
   """Fetches a patch from Review Board or GitHub."""
-  cmd = ' '.join(['wget',
-                 '--no-check-certificate',
-                 '--no-verbose',
-                 '-O '
-                 '{review_id}.patch',
-                 '{url}'])\
-                 .format(review_id=patch_id(), url=patch_url())
-
-  # In case of github we always need to fetch the patch to extract username
-  # and email, so we ignore the dry_run option by setting the second parameter
-  # to False.
-  if options['github']:
-    shell(cmd, False)
-  else:
-    shell(cmd, options['dry_run'])
+  r = urllib2.urlopen(patch_url(), context=ssl_create_default_context())
+
+  with open('%s.patch' % patch_id(), 'w') as patch:
+    patch.write(r.read())
 
 
 def patch_id():
@@ -167,6 +161,12 @@ def apply_patch():
   """Applies patch locally."""
   cmd = 'git apply --index {review_id}.patch'\
         .format(review_id=patch_id())
+
+  if platform.system() == 'Windows':
+    # NOTE: Depending on the Git settings, there may or may not be
+    # carriage returns in files and in the downloaded patch.
+    # We ignore these errors on Windows.
+    cmd += ' --ignore-whitespace'
   shell(cmd, options['dry_run'])
 
 
@@ -185,10 +185,17 @@ def commit_patch():
   else:
     amend = '-e'
 
-  cmd = u'git commit --author \'{author}\' {_amend} -am \'{message}\''\
+  # NOTE: Windows does not support multi-line commit messages via the shell.
+  message_file = '%s.message' % patch_id()
+  atexit.register(lambda: os.remove(message_file))
+
+  with open(message_file, 'w') as message:
+    message.write(data['message'])
+
+  cmd = u'git commit --author \"{author}\" {_amend} -aF \"{message}\"'\
         .format(author=quote(data['author']),
                 _amend=amend,
-                message=quote(data['message']))
+                message=message_file)
   shell(cmd, options['dry_run'])
 
 


[05/11] mesos git commit: Ported ReviewBot script to Windows.

Posted by jo...@apache.org.
Ported ReviewBot script to Windows.

Changes which script ReviewBot uses to apply reviews and
what script ReviewBot runs if on Windows.

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


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

Branch: refs/heads/master
Commit: 0734785f6d01a63f8a16acb80187d82d185a2916
Parents: b97ed63
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Tue Jan 10 17:34:11 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 14:29:27 2017 -0800

----------------------------------------------------------------------
 support/verify_reviews.py | 46 +++++++++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0734785f/support/verify_reviews.py
----------------------------------------------------------------------
diff --git a/support/verify_reviews.py b/support/verify_reviews.py
index f14951b..fadf8b9 100755
--- a/support/verify_reviews.py
+++ b/support/verify_reviews.py
@@ -6,6 +6,7 @@
 import atexit
 import json
 import os
+import platform
 import subprocess
 import sys
 import urllib
@@ -76,7 +77,7 @@ def api(url, data=None):
 
 def apply_review(review_id):
     print "Applying review %s" % review_id
-    shell("./support/apply-review.sh -n -r %s" % review_id)
+    shell("python support/apply-reviews.py -n -r %s" % review_id)
 
 
 def apply_reviews(review_request, reviews):
@@ -132,25 +133,33 @@ def verify_review(review_request):
 
         reviews.reverse() # Reviews are applied in the reverse order.
 
-        # Launch docker build script.
+        command = ""
+        if platform.system() == 'Windows':
+            command = "support\\windows-build.bat"
 
-        # TODO(jojy): Launch 'docker_build.sh' in subprocess so that
-        # verifications can be run in parallel for various configurations.
-        configuration = ("export "
-                         "OS='ubuntu:14.04' "
-                         "BUILDTOOL='autotools' "
-                         "COMPILER='gcc' "
-                         "CONFIGURATION='--verbose' "
-                         "ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'")
+            # There is no equivalent to `tee` on Windows.
+            subprocess.check_call(
+                ['cmd', '/c', '%s 2>&1 > %s' % (command, build_output)])
+        else:
+            # Launch docker build script.
 
-        command = "%s; ./support/docker_build.sh" % configuration
+            # TODO(jojy): Launch 'docker_build.sh' in subprocess so that
+            # verifications can be run in parallel for various configurations.
+            configuration = ("export "
+                             "OS='ubuntu:14.04' "
+                             "BUILDTOOL='autotools' "
+                             "COMPILER='gcc' "
+                             "CONFIGURATION='--verbose' "
+                             "ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'")
 
+            command = "%s; ./support/docker_build.sh" % configuration
 
-        # `tee` the output so that the console can log the whole build output.
-        # `pipefail` ensures that the exit status of the build command is
-        # preserved even after tee'ing.
-        subprocess.check_call(['bash', '-c', 'set -o pipefail; %s 2>&1 | tee %s'
-                               % (command, build_output)])
+
+            # `tee` the output so that the console can log the whole build output.
+            # `pipefail` ensures that the exit status of the build command is
+            # preserved even after tee'ing.
+            subprocess.check_call(['bash', '-c', 'set -o pipefail; %s 2>&1 | tee %s'
+                                   % (command, build_output)])
 
         # Success!
         post_review(
@@ -164,6 +173,11 @@ def verify_review(review_request):
         # the output from `e.output`.
         output = open(build_output).read() if os.path.exists(build_output) else e.output
 
+        if platform.system() == 'Windows':
+            # We didn't output anything during the build (because `tee`
+            # doesn't exist), so we print the output to stdout upon error.
+            print output
+
         # Truncate the output when posting the review as it can be very large.
         output = output if len(output) <= REVIEW_SIZE else "...<truncated>...\n" + output[-REVIEW_SIZE:]
         output = output + "\nFull log: " + os.path.join(os.environ['BUILD_URL'], 'console')


[08/11] mesos git commit: Windows: Shortened test directories to avoid long path problem.

Posted by jo...@apache.org.
Windows: Shortened test directories to avoid long path problem.

Currently some tests that use particularly long sandbox paths will fail
due to the notorious Windows path length limitations. Here, we change
test directory names to exclude the test name (which is useful for
debugging) in order to avoid these errors.

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


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

Branch: refs/heads/master
Commit: 60b1a6e323b3bedf1d2dae6cd419c0c93161d1c7
Parents: ef06082
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Jan 11 13:57:36 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 14:29:27 2017 -0800

----------------------------------------------------------------------
 src/tests/environment.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/60b1a6e3/src/tests/environment.cpp
----------------------------------------------------------------------
diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp
index b73f50d..df92679 100644
--- a/src/tests/environment.cpp
+++ b/src/tests/environment.cpp
@@ -905,7 +905,16 @@ Try<string> Environment::TemporaryDirectoryEventListener::mkdtemp()
   const string tmpdir = os::temp();
 
   const string& path =
+#ifndef __WINDOWS__
     path::join(tmpdir, strings::join("_", testCase, testName, "XXXXXX"));
+#else
+    // TODO(hausdorff): When we resolve MESOS-5849, we should change
+    // this back to the same path as the Unix version. This is
+    // currently necessary to make the sandbox path short enough to
+    // avoid the infamous Windows path length errors, which would
+    // normally cause many of our tests to fail.
+    path::join(tmpdir, "XXXXXX");
+#endif // !__WINDOWS__
 
   Try<string> mkdtemp = os::mkdtemp(path);
   if (mkdtemp.isSome()) {


[09/11] mesos git commit: CMake: Stopped searching for SVN and APR after we've found them.

Posted by jo...@apache.org.
CMake: Stopped searching for SVN and APR after we've found them.

Currently, the CMake build system employs scripts to find system
installations of libsvn and libapr on Unix machines. These scripts
will always repeat the search from scratch, independent of whether
we've already searched for these libraries.

This commit will cause these scripts to terminate early if we've already
searched and found these libraries.

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


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

Branch: refs/heads/master
Commit: 938c70f9d212d01af32322b17a4f660bf7ec7091
Parents: 1dee966
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Jan 11 17:24:22 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 17:36:39 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/cmake/FindApr.cmake | 5 ++++-
 3rdparty/stout/cmake/FindSvn.cmake | 7 ++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/938c70f9/3rdparty/stout/cmake/FindApr.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/FindApr.cmake b/3rdparty/stout/cmake/FindApr.cmake
index 98adeab..13156a5 100644
--- a/3rdparty/stout/cmake/FindApr.cmake
+++ b/3rdparty/stout/cmake/FindApr.cmake
@@ -39,12 +39,15 @@
 # CONFIGURE THE APR SEARCH. Specify what we're looking for, and which directories
 # we're going to look through to find them.
 #############################################################################
+if (APR_FOUND)
+  return()
+endif (APR_FOUND)
+
 unset(APRUTIL_LIB)
 unset(APRUTIL_INCLUDE_DIR)
 unset(APR_LIB)
 unset(APR_INCLUDE_DIR)
 unset(APR_LIBS)
-unset(APR_FOUND)
 
 # NOTE: If this fails, stderr is ignored, and the output variable is empty.
 # This has no deleterious effect our path search.

http://git-wip-us.apache.org/repos/asf/mesos/blob/938c70f9/3rdparty/stout/cmake/FindSvn.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/FindSvn.cmake b/3rdparty/stout/cmake/FindSvn.cmake
index e85e882..d57eed9 100644
--- a/3rdparty/stout/cmake/FindSvn.cmake
+++ b/3rdparty/stout/cmake/FindSvn.cmake
@@ -35,10 +35,13 @@
 # CONFIGURE OUR SEARCH. Specify what we're looking for, and which directories
 # we're going to look through to find them.
 #############################################################################
+if (SVN_FOUND)
+  return()
+endif (SVN_FOUND)
+
 unset(SVN_LIB)
 unset(SVN_INCLUDE_DIR)
 unset(SVN_LIBS)
-unset(SVN_FOUND)
 
 set(POSSIBLE_SVN_INCLUDE_DIRECTORIES
   ${POSSIBLE_SVN_INCLUDE_DIRECTORIES}
@@ -112,6 +115,8 @@ else ((NUM_FOUND_LIBS AND (NUM_REQD_LIBS EQUAL NUM_FOUND_LIBS)) AND
 endif ((NUM_FOUND_LIBS AND (NUM_REQD_LIBS EQUAL NUM_FOUND_LIBS)) AND
        SVN_INCLUDE_DIR_FOUND)
 
+set(SVN_FOUND 1)
+
 # Export variables.
 mark_as_advanced(
   SVN_LIB


[10/11] mesos git commit: CMake: Removed unnecessary calls to FindApr and FindSvn.

Posted by jo...@apache.org.
CMake: Removed unnecessary calls to FindApr and FindSvn.

`StoutConfigure` is intended to handle these calls.

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


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

Branch: refs/heads/master
Commit: b5d307a0ebd93e87cc6512835972af0e9a209731
Parents: 938c70f
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Jan 11 17:25:56 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jan 11 17:36:39 2017 -0800

----------------------------------------------------------------------
 src/master/cmake/MasterConfigure.cmake | 5 -----
 src/slave/cmake/AgentConfigure.cmake   | 5 -----
 2 files changed, 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b5d307a0/src/master/cmake/MasterConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/master/cmake/MasterConfigure.cmake b/src/master/cmake/MasterConfigure.cmake
index a15f689..3d316d6 100644
--- a/src/master/cmake/MasterConfigure.cmake
+++ b/src/master/cmake/MasterConfigure.cmake
@@ -16,11 +16,6 @@
 
 include(StoutConfigure)
 
-if (NOT WIN32)
-  find_package(Apr REQUIRED)
-  find_package(Svn REQUIRED)
-endif (NOT WIN32)
-
 # Define process library dependencies. Tells the process library build targets
 # download/configure/build all third-party libraries before attempting to build.
 ################################################################################

http://git-wip-us.apache.org/repos/asf/mesos/blob/b5d307a0/src/slave/cmake/AgentConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/slave/cmake/AgentConfigure.cmake b/src/slave/cmake/AgentConfigure.cmake
index fcac980..1582127 100644
--- a/src/slave/cmake/AgentConfigure.cmake
+++ b/src/slave/cmake/AgentConfigure.cmake
@@ -16,11 +16,6 @@
 
 include(StoutConfigure)
 
-if (NOT WIN32)
-  find_package(Apr REQUIRED)
-  find_package(Svn REQUIRED)
-endif (NOT WIN32)
-
 set(LOGROTATE_CONTAINER_LOGGER_TARGET logrotate_container_logger
   CACHE STRING "Library containing the logrotate container logger."
   )