You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2018/08/21 17:30:37 UTC

[mesos] branch master updated (dbcf3c6 -> 6cac5ad)

This is an automated email from the ASF dual-hosted git repository.

andschwa pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from dbcf3c6  Removed MESOS-4509 from the 1.7.0 CHANGELOG.
     new db6a22b  Windows: Made `libwinio` the default option for libprocess.
     new 6cac5ad  Windows: Made `libwinio` the default option for Mesos.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 3rdparty/CMakeLists.txt                      |  2 +-
 3rdparty/libprocess/src/CMakeLists.txt       | 13 +++++--------
 3rdparty/libprocess/src/tests/CMakeLists.txt | 16 +++++++---------
 cmake/CompilationConfigure.cmake             | 27 ++++++++-------------------
 docs/windows.md                              | 15 +++++++--------
 src/tests/CMakeLists.txt                     |  6 +-----
 6 files changed, 29 insertions(+), 50 deletions(-)


[mesos] 02/02: Windows: Made `libwinio` the default option for Mesos.

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andschwa pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 6cac5ad42cc5774236952fcf02a6df65b60d3e85
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
AuthorDate: Mon Aug 13 15:14:36 2018 -0700

    Windows: Made `libwinio` the default option for Mesos.
    
    With no options specified, Windows will now build with the
    `libwinio` (native Windows Thread API eventing library) by
    default (similar to POSIX defaulting to `libev` without options). To
    use `libevent` (NOT recommended), it must be explicitly enabled, and
    will emit an appropriate warning. Furthermore, the tests which were
    previously excluded when `libevent` was enabled are now enabled on
    Windows unconditionally. This serves two reasons: (1) it simplifies
    the build logic and (2) by failing with `libevent` it demonstrates why
    it is not recommended (and avoids giving false impressions).
    
    Review: https://reviews.apache.org/r/68331/
---
 3rdparty/CMakeLists.txt          |  2 +-
 cmake/CompilationConfigure.cmake | 27 ++++++++-------------------
 docs/windows.md                  | 15 +++++++--------
 src/tests/CMakeLists.txt         |  6 +-----
 4 files changed, 17 insertions(+), 33 deletions(-)

diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 629b196..8a69685 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -593,7 +593,7 @@ if (ENABLE_LIBEVENT)
       target_link_libraries(libevent INTERFACE ${LIBEVENT_LIB})
     endforeach ()
   endif ()
-elseif (NOT ENABLE_LIBWINIO)
+elseif (NOT WIN32) # Windows defaults to `libwinio`, a native implementation.
   # libev: Full-featured high-performance event loop.
   # https://github.com/enki/libev
   ###################################################
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 10cacfb..a820c86 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -102,11 +102,6 @@ if (ENABLE_LIBEVENT)
 endif()
 
 option(
-  ENABLE_LIBWINIO
-  "Use Windows IOCP instead of libev as the core event loop implementation."
-  FALSE)
-
-option(
   ENABLE_SSL
   "Build libprocess with SSL support."
   FALSE)
@@ -223,21 +218,15 @@ if (WIN32 AND REBUNDLED)
     "the Internet, even though the `REBUNDLED` flag was set.")
 endif ()
 
-if (WIN32 AND (NOT ENABLE_LIBEVENT AND NOT ENABLE_LIBWINIO))
+if (WIN32 AND ENABLE_LIBEVENT)
   message(
-    FATAL_ERROR
-    "Windows builds of Mesos currently do not support libev, the default event "
-    "loop used by Mesos.  To opt into using libevent, pass "
-    "`-DENABLE_LIBEVENT=1` as an argument when you run CMake."
-    "To opt into using the native Windows IOCP implementation instead, "
-    "pass `-DENABLE_LIBWINIO=1` as an argument.")
-endif ()
-
-if (ENABLE_LIBWINIO AND (NOT WIN32))
-  message(
-    FATAL_ERROR
-    "Libwinio, which is the Windows IOCP event loop, only works on Windows. "
-    "Please use libev or libevent instead on non-Windows platforms.")
+    WARNING
+    "The Windows imlementation of libevent is BUGGY. Use it at your own risk. "
+    "It does NOT support async I/O. You WILL have problems. Tests WILL fail. "
+    "This is NOT supported, and WILL eventually be removed. "
+    "When not explicitly enabled, the build will default to the native Windows "
+    "IOCP implementation, `libwinio`, built on the Windows Thread Pool API. "
+    "See MESOS-8668 for context.")
 endif ()
 
 if (ENABLE_SSL AND (NOT ENABLE_LIBEVENT))
diff --git a/docs/windows.md b/docs/windows.md
index f0f12fc..2edab6d 100644
--- a/docs/windows.md
+++ b/docs/windows.md
@@ -40,7 +40,7 @@ Following are the instructions for Windows 10.
     # Configure using CMake for an out-of-tree build.
     mkdir build
     cd build
-    cmake .. -G "Visual Studio 15 2017 Win64" -T "host=x64" -DENABLE_LIBWINIO=ON
+    cmake .. -G "Visual Studio 15 2017 Win64" -T "host=x64"
 
     # Build Mesos.
     # To build just the Mesos agent, add `--target mesos-agent`.
@@ -49,7 +49,7 @@ Following are the instructions for Windows 10.
     # The Windows agent exposes new isolators that must be used as with
     # the `--isolation` flag. To get started point the agent to a working
     # master, using eiher an IP address or zookeeper information.
-    src\mesos-agent.exe --master=<master> --work_dir=<work folder> --launcher_dir=<repository>\build\src
+    .\src\mesos-agent.exe --master=<master> --work_dir=<work folder> --launcher_dir=<repository>\build\src
 
 ## Running Mesos
 
@@ -93,8 +93,7 @@ ensure `ninja.exe` is in your `PATH`.
 * Open an "x64 Native Tools Command Prompt for VS 2017" to set your
   environment.
 * In that command prompt, type `powershell` to use a better shell.
-* Similar to above, configure CMake with
-  `cmake .. -G Ninja -DENABLE_LIBWINIO=ON`.
+* Similar to above, configure CMake with `cmake .. -G Ninja`.
 * Now you can use `ninja` to build the various targets.
 * You may want to use `ninja -v` to make it verbose, as it's otherwise
   very quiet.
@@ -163,11 +162,11 @@ of OpenSSL for Windows. A commonly chosen distribution is
 As of this writing, OpenSSL 1.1.x is not yet supported, but 1.0.2M has been
 tested.
 
-Use `-DENABLE_SSL=ON` when running CMake to build with OpenSSL.
+Use `-DENABLE_SSL=ON -DENABLE_LIBEVENT=ON` to build with OpenSSL.
 
-> Warning: This currently requires the use of `-DENABLE_LIBEVENT=ON`
-> instead of `-DENABLE_LIBWINIO=ON`; however, the use of libevent on
-> Windows is not recommended, as it is buggy and will be unsupported
+> Warning: This currently requires the use of libevent instead of the
+> native Windows Thread Pool API. However, the use of libevent on
+> Windows is NOT recommended, as it is buggy and will be unsupported
 > in the future.
 
 Note that it will link to OpenSSL dynamically, so if the built executables are
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index fed072a..fd01531 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -153,14 +153,10 @@ list(APPEND MESOS_TESTS_SRC
 list(APPEND MESOS_TESTS_SRC
   containerizer/containerizer_tests.cpp
   containerizer/cpu_isolator_tests.cpp
+  containerizer/docker_containerizer_tests.cpp
   containerizer/docker_tests.cpp
   containerizer/memory_isolator_tests.cpp)
 
-if (NOT WIN32 OR ENABLE_LIBWINIO)
-  list(APPEND MESOS_TESTS_SRC
-    containerizer/docker_containerizer_tests.cpp)
-endif ()
-
 if (NOT WIN32)
   list(APPEND MESOS_TESTS_SRC
     container_logger_tests.cpp


[mesos] 01/02: Windows: Made `libwinio` the default option for libprocess.

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andschwa pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit db6a22b481d32d1b83edf5fba6c021ebded9f9b1
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
AuthorDate: Mon Aug 13 14:59:29 2018 -0700

    Windows: Made `libwinio` the default option for libprocess.
    
    Note that we now add `io_tests.cpp` unconditionally, which will
    fail/hang with libevent. However, this is because libevent is buggy,
    and should not be used. We would prefer the tests not pass with
    libevent enabled, rather than appear to pass because the failing tests
    are excluded, giving the false impression that it works correctly.
    
    Review: https://reviews.apache.org/r/68329/
---
 3rdparty/libprocess/src/CMakeLists.txt       | 13 +++++--------
 3rdparty/libprocess/src/tests/CMakeLists.txt | 16 +++++++---------
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index 19fa980..40c8ef9 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -61,7 +61,7 @@ if (ENABLE_LIBEVENT)
   list(APPEND PROCESS_SRC
     posix/libevent/libevent.cpp
     posix/libevent/libevent_poll.cpp)
-elseif (ENABLE_LIBWINIO)
+elseif (WIN32)
   list(APPEND PROCESS_SRC
     windows/event_loop.cpp
     windows/libwinio.cpp)
@@ -71,7 +71,7 @@ else ()
     posix/libev/libev_poll.cpp)
 endif ()
 
-if (ENABLE_LIBWINIO)
+if (WIN32 AND NOT ENABLE_LIBEVENT)
   list(APPEND PROCESS_SRC
     windows/io.cpp
     windows/poll_socket.cpp)
@@ -111,14 +111,11 @@ target_link_libraries(
 
 target_compile_definitions(
   process PRIVATE
-  $<$<BOOL:${ENABLE_LIBWINIO}>:ENABLE_LIBWINIO>
+  $<$<AND:$<PLATFORM_ID:Windows>,$<NOT:$<BOOL:${ENABLE_LIBEVENT}>>>:ENABLE_LIBWINIO>
   $<$<BOOL:${ENABLE_LOCK_FREE_RUN_QUEUE}>:LOCK_FREE_RUN_QUEUE>
   $<$<BOOL:${ENABLE_LOCK_FREE_EVENT_QUEUE}>:LOCK_FREE_EVENT_QUEUE>
-  $<$<BOOL:${ENABLE_LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE}>:LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE>)
-
-if (LINUX)
-  target_compile_definitions(process PRIVATE LIBPROCESS_ALLOW_JEMALLOC)
-endif ()
+  $<$<BOOL:${ENABLE_LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE}>:LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE>
+  $<$<PLATFORM_ID:LINUX>:LIBPROCESS_ALLOW_JEMALLOC>)
 
 target_include_directories(process PUBLIC ../include)
 target_include_directories(process PRIVATE .)
diff --git a/3rdparty/libprocess/src/tests/CMakeLists.txt b/3rdparty/libprocess/src/tests/CMakeLists.txt
index a03a77e..2bea6cf 100644
--- a/3rdparty/libprocess/src/tests/CMakeLists.txt
+++ b/3rdparty/libprocess/src/tests/CMakeLists.txt
@@ -26,6 +26,7 @@ set(PROCESS_TESTS_SRC
   future_tests.cpp
   grpc_tests.cpp
   http_tests.cpp
+  io_tests.cpp
   limiter_tests.cpp
   loop_tests.cpp
   metrics_tests.cpp
@@ -46,6 +47,12 @@ set(PROCESS_TESTS_SRC
   time_tests.cpp
   timeseries_tests.cpp)
 
+if (NOT WIN32)
+  # TODO(andschwa): See MESOS-5818.
+  list(APPEND PROCESS_TESTS_SRC
+    reap_tests.cpp)
+endif ()
+
 set(GRPC_TESTS_PROTOS
   grpc_tests.grpc.pb.cc
   grpc_tests.grpc.pb.h
@@ -65,15 +72,6 @@ add_custom_command(
     ${CMAKE_CURRENT_SOURCE_DIR}/grpc_tests.proto
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/grpc_tests.proto)
 
-if (NOT WIN32)
-  list(APPEND PROCESS_TESTS_SRC
-    io_tests.cpp
-    reap_tests.cpp)
-elseif (ENABLE_LIBWINIO)
-  list(APPEND PROCESS_TESTS_SRC
-    io_tests.cpp)
-endif ()
-
 if (ENABLE_SSL)
   list(APPEND PROCESS_TESTS_SRC
     jwt_tests.cpp