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

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

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