From 8f95015543f53945a6cb270b5049f77f8989d525 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 19 Jun 2016 14:15:41 +0300 Subject: [PATCH 01/16] appveyor: support cmake & autotools using build matrix (like travis-ci has) This will allow us to avoid possible compilation regressions, and also some failures in different environments (for example because of different sizeof(size_t)). For example we can avoid next issues: - #361 - #314 - #311 (And I'm pretty sure that this is not complete list) And of course it reduce job for maintainers. But it also have one downside, appveyor doesn't have such concurrency like travis-ci, so it can take a while to finish the whole build, but we can resolve this later, or reduce build matrix to only one for autotools and one for cmake. Fixes: #364 --- appveyor.yml | 82 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f9af62d2..b4781a34 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,45 +1,61 @@ version: 2.1.5.{build} shallow_clone: true -os: Visual Studio 2015 RC +os: Visual Studio 2015 build: - verbosity: detailed + verbosity: detailed environment: - global: - CYG_ROOT: C:/MinGW/msys/1.0 - + global: + CYG_ROOT: C:/MinGW/msys/1.0 + matrix: + - EVENT_BUILD_METHOD: "autotools" + EVENT_CONFIGURE_OPTIONS: "" + - EVENT_BUILD_METHOD: "autotools" + EVENT_CONFIGURE_OPTIONS: "--disable-openssl" + - EVENT_BUILD_METHOD: "autotools" + EVENT_CONFIGURE_OPTIONS: "--disable-thread-support" + - EVENT_BUILD_METHOD: "autotools" + EVENT_CONFIGURE_OPTIONS: "--disable-debug-mode" + - EVENT_BUILD_METHOD: "autotools" + EVENT_CONFIGURE_OPTIONS: "--disable-malloc-replacement" + - EVENT_BUILD_METHOD: "cmake" + EVENT_CMAKE_OPTIONS: "" + - EVENT_BUILD_METHOD: "cmake" + EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_OPENSSL=ON" + - EVENT_BUILD_METHOD: "cmake" + EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_THREAD_SUPPORT=ON" + - EVENT_BUILD_METHOD: "cmake" + EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_DEBUG_MODE=ON" + - EVENT_BUILD_METHOD: "cmake" + EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_MM_REPLACEMENT=ON" + - EVENT_BUILD_METHOD: "cmake" + EVENT_CMAKE_OPTIONS: "-DEVENT__ENABLE_VERBOSE_DEBUG=ON" init: - - 'echo Building libevent %version% for Windows' - - 'echo System architecture: %PLATFORM%' - - 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%' - - 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%' - + - 'echo Building libevent %version% for Windows' + - 'echo System architecture: %PLATFORM%' + - 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%' + - 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%' + - 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%' + - 'echo Cygwin root is: %CYG_ROOT%' install: - - set PATH=%PATH%;C:\MinGW\msys\1.0\bin;C:\MinGW\bin - - appveyor DownloadFile https://strcpy.net/packages/Win32OpenSSL-1_0_2a.exe - - Win32OpenSSL-1_0_2a.exe /silent /verysilent /sp- /suppressmsgboxes - + - appveyor DownloadFile https://strcpy.net/packages/Win32OpenSSL-1_0_2a.exe + - Win32OpenSSL-1_0_2a.exe /silent /verysilent /sp- /suppressmsgboxes build_script: - - cmd: 'echo Cygwin root is: %CYG_ROOT%' - - cmd: 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%' - - cmd: 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%' - - cmd: 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%' - - cmd: "echo installing stuff" - - cmd: 'echo "C:\MinGW /mingw" >%CYG_ROOT%/etc/fstab' - - cmd: 'C:\MinGW\bin\mingw-get install autotools autoconf automake python' - - cmd: 'echo Autogen running...' - - cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0 /etc/fstab" + $env:APPVEYOR_BUILD_FOLDER = $env:APPVEYOR_BUILD_FOLDER -replace "\\", "/" + bash -lc "exec 0 Date: Sun, 7 Aug 2016 20:52:41 +0300 Subject: [PATCH 02/16] appveyor: drop shallow_clone, since we use tags for detecting version in cmake --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b4781a34..4773ad29 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,4 @@ version: 2.1.5.{build} -shallow_clone: true os: Visual Studio 2015 From 18108574256f6a0e28a1d5b543774cd7089f7396 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 7 Aug 2016 21:30:04 +0300 Subject: [PATCH 03/16] appveyor: ignore failure of mingw-get Since according to doc [1], appveyour will fail the build on every powershell's exception: "PowerShell script is considered successful if it finishes without exception." [1]: https://www.appveyor.com/docs/build-configuration#powershell --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4773ad29..735625d5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,14 +41,14 @@ init: install: - appveyor DownloadFile https://strcpy.net/packages/Win32OpenSSL-1_0_2a.exe - Win32OpenSSL-1_0_2a.exe /silent /verysilent /sp- /suppressmsgboxes + - C:\MinGW\bin\mingw-get install autotools autoconf automake build_script: - ps: | if ($env:EVENT_BUILD_METHOD -eq 'autotools') { $env:PATH="$env:CYG_ROOT\bin;C:\MinGW\bin;$($env:PATH)" - mingw-get install autotools autoconf automake bash -lc "echo 'C:\MinGW /mingw' > /etc/fstab" $env:APPVEYOR_BUILD_FOLDER = $env:APPVEYOR_BUILD_FOLDER -replace "\\", "/" - bash -lc "exec 0&1; cd $env:APPVEYOR_BUILD_FOLDER; bash -x ./autogen.sh && ./configure $env:EVENT_CONFIGURE_OPTIONS && make && make verify" } else { md build cd build From bb09535bdad6a6398eee3123d0dd7857fa60c825 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 7 Aug 2016 22:19:39 +0300 Subject: [PATCH 04/16] autoconf: fix --disable-thread-support build under win32 Fixes: https://ci.appveyor.com/project/azat/libevent/build/job/gvud4tcqsd5bnarl Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.6.80/job/5frnb1c3n4quxxqy Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.6.80/job/3wdahbrew7setmoa --- Makefile.am | 6 +++++- configure.ac | 1 + test/include.am | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index f740bf3d..71fa834e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -142,10 +142,14 @@ include test/include.am if BUILD_WIN32 SYS_LIBS = -lws2_32 -lshell32 -ladvapi32 -SYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \ +SYS_SRC = win32select.c buffer_iocp.c event_iocp.c \ bufferevent_async.c SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake +if THREADS +SYS_SRC += evthread_win32.c +endif + else SYS_LIBS = diff --git a/configure.ac b/configure.ac index 904cd1aa..5df1b907 100644 --- a/configure.ac +++ b/configure.ac @@ -749,6 +749,7 @@ if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then #include ] ) fi +AM_CONDITIONAL(THREADS, [test "$enable_thread_support" != "no"]) AM_CONDITIONAL(PTHREADS, [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"]) # check if we should compile locking into the library diff --git a/test/include.am b/test/include.am index 4cd49ef6..308813cd 100644 --- a/test/include.am +++ b/test/include.am @@ -101,8 +101,10 @@ regress_thread_SOURCES = test/regress_thread.c PTHREAD_LIBS += libevent_pthreads.la endif if BUILD_WIN32 +if THREADS regress_thread_SOURCES = test/regress_thread.c endif +endif if ZLIB_REGRESS regress_zlib_SOURCES = test/regress_zlib.c endif From 38716c653d0c23a4a625c2e448bbf0a6db5f35ac Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 7 Aug 2016 23:07:44 +0300 Subject: [PATCH 05/16] cmake: do not use stderr for notifications/version-info For all except "STATUS" message() will write to stderr, and this also includes case when you does not have at all. Plus for every message in stderr powershell generates exception and make appveyor fails. Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.5.85/job/i10k7m0t80330mtr --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86ac97af..14826bde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1406,9 +1406,9 @@ set(LIBEVENT_LIBRARIES event_extra CACHE STRING "Libevent libraries") -message("") -message(" ---( Libevent " ${EVENT_VERSION} " )---") -message("") +message(STATUS "") +message(STATUS " ---( Libevent " ${EVENT_VERSION} " )---") +message(STATUS "") message(STATUS "Available event backends: ${BACKENDS}") message(STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR}) message(STATUS "CMAKE_CURRENT_BINARY_DIR: " ${CMAKE_CURRENT_BINARY_DIR}) @@ -1430,5 +1430,5 @@ message(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} ) message(STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} ) message(STATUS "CMAKE_AR: " ${CMAKE_AR} ) message(STATUS "CMAKE_RANLIB: " ${CMAKE_RANLIB} ) -message("") +message(STATUS "") From a487706e100aae9986354505fe233fb2a1e710d5 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 7 Aug 2016 23:14:01 +0300 Subject: [PATCH 06/16] test: fix building with --disable-thread-support under win32 --- test/bench_http.c | 2 ++ test/print-winsock-errors.c | 2 ++ test/test-ratelim.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/test/bench_http.c b/test/bench_http.c index 6d0d9717..0c46855f 100644 --- a/test/bench_http.c +++ b/test/bench_http.c @@ -138,7 +138,9 @@ main(int argc, char **argv) #ifdef _WIN32 case 'i': use_iocp = 1; +#ifdef EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED evthread_use_windows_threads(); +#endif event_config_set_flag(cfg,EVENT_BASE_FLAG_STARTUP_IOCP); break; #endif diff --git a/test/print-winsock-errors.c b/test/print-winsock-errors.c index ab6e610e..64d6b0e7 100644 --- a/test/print-winsock-errors.c +++ b/test/print-winsock-errors.c @@ -15,7 +15,9 @@ int main (int argc, char **argv) int i, j; const char *s1, *s2; +#ifdef EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED evthread_use_windows_threads (); +#endif s1 = evutil_socket_error_to_string (WSAEINTR); diff --git a/test/test-ratelim.c b/test/test-ratelim.c index 17babfdc..9ee989bd 100644 --- a/test/test-ratelim.c +++ b/test/test-ratelim.c @@ -279,7 +279,9 @@ test_ratelimiting(void) #ifdef _WIN32 if (cfg_enable_iocp) { +#ifdef EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED evthread_use_windows_threads(); +#endif event_config_set_flag(base_cfg, EVENT_BASE_FLAG_STARTUP_IOCP); } #endif From e35f22416a443712aa776fccae4279ae4a84251b Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 7 Aug 2016 23:46:26 +0300 Subject: [PATCH 07/16] cmake: fix -DEVENT__ENABLE_VERBOSE_DEBUG (typo on -DUSE_DEBUG) Fixes: 8b228e27f57300be61b57a41a2ec8666b726dc34 ("Lot's of cmake updates") --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14826bde..690615ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,7 +143,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) if (EVENT__ENABLE_VERBOSE_DEBUG) - add_definitions(-DUSE_DBUG=1) + add_definitions(-DUSE_DEBUG=1) endif() # Setup compiler flags for coverage. From e9acc441b75d60e884a2529218df9c5e22e79905 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 7 Aug 2016 23:51:21 +0300 Subject: [PATCH 08/16] appveyor: check -DUNICODE -D_UNICODE according to ReleaseChecklist (cmake only) Link: https://github.com/libevent/libevent/wiki/ReleaseChecklist --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 735625d5..6b04354b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,6 +31,8 @@ environment: EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_MM_REPLACEMENT=ON" - EVENT_BUILD_METHOD: "cmake" EVENT_CMAKE_OPTIONS: "-DEVENT__ENABLE_VERBOSE_DEBUG=ON" + - EVENT_BUILD_METHOD: "cmake" + EVENT_CMAKE_OPTIONS: "-DCMAKE_C_FLAGS='-DUNICODE -D_UNICODE'" init: - 'echo Building libevent %version% for Windows' - 'echo System architecture: %PLATFORM%' From ecb0ec821a70ac2227ed72f4e8f29d0ec9df9413 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 8 Aug 2016 15:45:29 +0300 Subject: [PATCH 09/16] cmake/win32: do not compile evthread_win32 on -DEVENT__DISABLE_THREAD_SUPPORT=ON There is duplicated "evthread_win32.c" appending to ${SRC_CORE} list, leave only one that under if EVENT__DISABLE_THREAD_SUPPORT Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.5.96/job/44q3rgifasny7gek --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 690615ef..22160b96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -730,7 +730,6 @@ if(WIN32) buffer_iocp.c bufferevent_async.c event_iocp.c - evthread_win32.c win32select.c) list(APPEND HDR_PRIVATE WIN32-Code/getopt.h) From de0c1965cad7469aee27209c3e396db4cab3cdb7 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 8 Aug 2016 15:50:46 +0300 Subject: [PATCH 10/16] cmake/win32: do not compile regress_thread on -DEVENT__DISABLE_THREAD_SUPPORT=ON --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22160b96..b857d377 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -973,7 +973,9 @@ if (NOT EVENT__DISABLE_TESTS) if (WIN32) list(APPEND SRC_REGRESS test/regress_iocp.c) - list(APPEND SRC_REGRESS test/regress_thread.c) + if (NOT EVENT__DISABLE_THREAD_SUPPORT) + list(APPEND SRC_REGRESS test/regress_thread.c) + endif() endif() if (CMAKE_USE_PTHREADS_INIT) From 4634b85bf29ced73fd814a4c0cd0f98e6f7334c2 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 8 Aug 2016 15:34:57 +0300 Subject: [PATCH 11/16] appveyor: image already had openssl installed Fixes messages like "Version mismatch for openssl: compiled with 1000201f but running with 1000208f" [1]. According to next link: http://help.appveyor.com/discussions/questions/1132-openssl-installation-issues Refs: appveyor/ci#576 [1]: https://ci.appveyor.com/project/azat/libevent/build/2.1.5.95/job/dcy9cfoj3rfo4gdh --- appveyor.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6b04354b..08330fcd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,8 +41,6 @@ init: - 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%' - 'echo Cygwin root is: %CYG_ROOT%' install: - - appveyor DownloadFile https://strcpy.net/packages/Win32OpenSSL-1_0_2a.exe - - Win32OpenSSL-1_0_2a.exe /silent /verysilent /sp- /suppressmsgboxes - C:\MinGW\bin\mingw-get install autotools autoconf automake build_script: - ps: | @@ -58,5 +56,3 @@ build_script: cmake --build . ctest --output-on-failure } -cache: - - C:\OpenSSL-Win32 From 6fcfa25d82443f9254c6c2da6b00d88873c41553 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 8 Aug 2016 17:25:11 +0300 Subject: [PATCH 12/16] appveyor/autotools: link with openssl by passing LDFLAGS/CFLAGS This never works, hence green tests in production. and now it works: https://ci.appveyor.com/project/azat/libevent/build/2.1.5.100/job/eib4xqfb7d3ruo16 (look by /"evthread_win32.c") --- appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 08330fcd..4c16ee31 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -46,9 +46,10 @@ build_script: - ps: | if ($env:EVENT_BUILD_METHOD -eq 'autotools') { $env:PATH="$env:CYG_ROOT\bin;C:\MinGW\bin;$($env:PATH)" - bash -lc "echo 'C:\MinGW /mingw' > /etc/fstab" + bash -lc "echo 'C:\MinGW /mingw' > /etc/fstab" + bash -lc "echo 'C:\OpenSSL-Win32 /ssl' >> /etc/fstab" $env:APPVEYOR_BUILD_FOLDER = $env:APPVEYOR_BUILD_FOLDER -replace "\\", "/" - bash -lc "exec 0&1; cd $env:APPVEYOR_BUILD_FOLDER; bash -x ./autogen.sh && ./configure $env:EVENT_CONFIGURE_OPTIONS && make && make verify" + bash -lc "exec 0&1; cd $env:APPVEYOR_BUILD_FOLDER; bash -x ./autogen.sh && ./configure LDFLAGS='-L/ssl -L/ssl/lib -L/ssl/lib/MinGW' CFLAGS=-I/ssl/include $env:EVENT_CONFIGURE_OPTIONS && make && make verify" } else { md build cd build From 671a24f29b9c305c17727e7bfc0d025c25fb5c01 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 8 Aug 2016 18:10:56 +0300 Subject: [PATCH 13/16] autotools/win32: fix searching ssl library --- configure.ac | 2 +- m4/libevent_openssl.m4 | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 5df1b907..315d97a5 100644 --- a/configure.ac +++ b/configure.ac @@ -778,7 +778,7 @@ fi # check if we have and should use openssl AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"]) if test "x$enable_openssl" = "xyes"; then - AC_SEARCH_LIBS([ERR_remove_thread_state], [crypto], + AC_SEARCH_LIBS([ERR_remove_thread_state], [crypto eay32], [AC_DEFINE(HAVE_ERR_REMOVE_THREAD_STATE, 1, [Define to 1 if you have ERR_remove_thread_stat().])]) fi diff --git a/m4/libevent_openssl.m4 b/m4/libevent_openssl.m4 index 3cb064a0..c2040595 100644 --- a/m4/libevent_openssl.m4 +++ b/m4/libevent_openssl.m4 @@ -26,12 +26,17 @@ case "$enable_openssl" in save_LIBS="$LIBS" LIBS="" OPENSSL_LIBS="" - AC_SEARCH_LIBS([SSL_new], [ssl], - [have_openssl=yes - OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"], - [have_openssl=no], - [-lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD]) - LIBS="$save_LIBS" + for lib in crypto eay32; do + # clear cache + unset ac_cv_search_SSL_new + AC_SEARCH_LIBS([SSL_new], [ssl ssl32], + [have_openssl=yes + OPENSSL_LIBS="$LIBS -l$lib $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"], + [have_openssl=no], + [-l$lib $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD]) + LIBS="$save_LIBS" + test "$have_openssl" = "yes" && break + done ;; esac AC_SUBST(OPENSSL_INCS) From c4dfb93ff2bfdd1b76f3e9f402c28528e5bc24bf Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 9 Aug 2016 10:56:34 +0300 Subject: [PATCH 14/16] cmake: check for ZLIB_INCLUDE_DIR, since we can have only library without headers --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b857d377..cad9d57b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -702,7 +702,7 @@ if (NOT EVENT__DISABLE_TESTS) # Zlib is only used for testing. find_package(ZLIB) - if (ZLIB_LIBRARY) + if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) include_directories(${ZLIB_INCLUDE_DIRS}) set(EVENT__HAVE_ZLIB 1) @@ -982,7 +982,7 @@ if (NOT EVENT__DISABLE_TESTS) list(APPEND SRC_REGRESS test/regress_thread.c) endif() - if (ZLIB_LIBRARY) + if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) list(APPEND SRC_REGRESS test/regress_zlib.c) endif() From d5a2f2f97f6005bd0846e6b6df199b1deb95e45c Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 9 Aug 2016 12:10:18 +0300 Subject: [PATCH 15/16] test/https_basic: increase timeout for complete write (fixes win32) Otherwise on win32 we got 2, but test is ok, some timings issue. Introduced-in: c968eb3 Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.5.107/job/k70our1xdp0ym4dm#L1906 --- test/regress_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/regress_http.c b/test/regress_http.c index 178f3958..741edf25 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -478,7 +478,7 @@ http_basic_test_impl(void *arg, int ssl) bufferevent_write(bev, http_request, strlen(http_request)); evutil_timerclear(&tv); - tv.tv_usec = 10000; + tv.tv_usec = 100000; event_base_once(data->base, -1, EV_TIMEOUT, http_complete_write, bev, &tv); From a9e8cd6738a781d27fa663d9706f64f948f2ced0 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 9 Aug 2016 12:25:11 +0300 Subject: [PATCH 16/16] test/ssl: use send()/recv()/EVUTIL_ERR_RW_RETRIABLE()/EVUTIL_SOCKET_ERROR() to fix win32 Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.5.107/job/k70our1xdp0ym4dm#L1906 Fixes: ssl/bufferevent_connect_sleep --- test/regress_ssl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/regress_ssl.c b/test/regress_ssl.c index a415952a..a476980b 100644 --- a/test/regress_ssl.c +++ b/test/regress_ssl.c @@ -46,6 +46,7 @@ #include "event2/bufferevent_struct.h" #include "event2/buffer.h" #include "event2/listener.h" +#include "util-internal.h" #include "regress.h" #include "tinytest.h" @@ -555,9 +556,9 @@ static int bio_rwcount_read(BIO *b, char *out, int outlen) { struct rwcount *rw = b->ptr; - ev_ssize_t ret = read(rw->fd, out, outlen); + ev_ssize_t ret = recv(rw->fd, out, outlen, 0); ++rw->read; - if (ret == -1 && errno == EAGAIN) { + if (ret == -1 && EVUTIL_ERR_RW_RETRIABLE(EVUTIL_SOCKET_ERROR())) { BIO_set_retry_read(b); } return ret; @@ -567,9 +568,9 @@ bio_rwcount_write(BIO *b, const char *in, int inlen) { struct rwcount *rw = b->ptr; - ev_ssize_t ret = write(rw->fd, in, inlen); + ev_ssize_t ret = send(rw->fd, in, inlen, 0); ++rw->write; - if (ret == -1 && errno == EAGAIN) { + if (ret == -1 && EVUTIL_ERR_RW_RETRIABLE(EVUTIL_SOCKET_ERROR())) { BIO_set_retry_write(b); } return ret;