From c5d422c02b1e4cec3bb27268409d48c56cfba3b6 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Thu, 24 May 2018 14:05:22 +0200 Subject: [PATCH 1/3] Problem: no CI for cygwin Solution: add cygwin build --- appveyor.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 88ce9fd0..7e9ad033 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -65,6 +65,10 @@ environment: CMAKE_GENERATOR: "Visual Studio 15 2017" MSVCVERSION: "v141" MSVCYEAR: "vs2017" + - platform: cygwin64 + WITH_LIBSODIUM: OFF + ENABLE_CURVE: ON + CMAKE_GENERATOR: "Unix Makefiles" matrix: fast_finish: false @@ -83,8 +87,11 @@ init: cache: - C:\projects\libsodium + - C:\cygwin64\var\cache\setup install: + - cmd: if "%Platform%"=="cygwin64" C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages cmake,cygwin-devel,gcc-g++,libncurses-devel,make,pkg-config + - cmd: if "%Platform%"=="cygwin64" set PATH=C:\cygwin64\bin;%PATH% - cmd: if "%Platform%"=="x64" set "CMAKE_GENERATOR=%CMAKE_GENERATOR% Win64" - cmd: echo "Generator='%CMAKE_GENERATOR%'" - cmd: echo "Platform='%Platform%'" @@ -113,15 +120,26 @@ before_build: # - cmd: set BUILDLOG="%LIBZMQ_SRCDIR%\build.log" - cmd: md "%LIBZMQ_BUILDDIR%" - cd "%LIBZMQ_BUILDDIR%" - - cmd: cmake -D CMAKE_INCLUDE_PATH="%SODIUM_INCLUDE_DIR%" -D CMAKE_LIBRARY_PATH="%SODIUM_LIBRARY_DIR%" -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D ENABLE_DRAFTS="%ENABLE_DRAFTS%" -D ENABLE_ANALYSIS="%ENABLE_ANALYSIS%" -D ENABLE_CURVE="%ENABLE_CURVE%" -D API_POLLER="%API_POLLER%" -D POLLER="%POLLER%" -D CMAKE_C_FLAGS_RELEASE="/MT" -D CMAKE_C_FLAGS_DEBUG="/MTd" -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -G "%CMAKE_GENERATOR%" "%APPVEYOR_BUILD_FOLDER%" + - cmd: if "%PLATFORM%" == "cygwin64" set APPVEYOR_BUILD_FOLDER=/cygdrive/C/projects/libzmq + - cmd: if "%PLATFORM%" NEQ "cygwin64" set EXTRA_FLAGS='-D CMAKE_C_FLAGS_RELEASE="/MT" -D CMAKE_C_FLAGS_DEBUG="/MTd"' + - cmd: cmake -D CMAKE_INCLUDE_PATH="%SODIUM_INCLUDE_DIR%" -D CMAKE_LIBRARY_PATH="%SODIUM_LIBRARY_DIR%" -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D ENABLE_DRAFTS="%ENABLE_DRAFTS%" -D ENABLE_ANALYSIS="%ENABLE_ANALYSIS%" -D ENABLE_CURVE="%ENABLE_CURVE%" -D API_POLLER="%API_POLLER%" -D POLLER="%POLLER%" %EXTRA_FLAGS% -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D LIBZMQ_WERROR="ON" -G "%CMAKE_GENERATOR%" "%APPVEYOR_BUILD_FOLDER%" - cmd: cd "%LIBZMQ_SRCDIR%" build_script: - - cmd: if "%MSVCYEAR%"=="vs2008" ( - cmake --build %LIBZMQ_BUILDDIR% --config %configuration% --target install - ) else ( - cmake --build %LIBZMQ_BUILDDIR% --config %configuration% --target install -- -verbosity:Minimal -maxcpucount -logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + - cmd: set verbosity=Minimal + - cmd: if "%MSVCYEAR%"=="vs2008" set verbosity=Normal + - cmd: if "%MSVCYEAR%"=="vs2008" set path=C:\Windows\Microsoft.NET\Framework\v3.5;%path% + - cmd: cd "%LIBZMQ_BUILDDIR%" + - cmd: if "%PLATFORM%" NEQ "cygwin64" ( + if "%MSVCYEAR%"=="vs2008" ( + cmake --build %LIBZMQ_BUILDDIR% --config %configuration% --target install + ) else ( + cmake --build %LIBZMQ_BUILDDIR% --config %configuration% --target install -- -verbosity:Minimal -maxcpucount -logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + ) ) + - cmd: if "%PLATFORM%" == "cygwin64" cmake --build . -- -j5 + # TODO this is definitely not the optimal place&way to do this + - cmd: if "%PLATFORM%" == "cygwin64" cp lib/libzmq-5.dll bin # TODO this does not work with sonarcloud.io, as it misses the sonar-cxx plugin # build_script: From eccf2e53bca8dde720bd10936ce69fa77bde8d7d Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Thu, 24 May 2018 15:12:57 +0200 Subject: [PATCH 2/3] Problem: cygwin build defines ZMQ_HAVE_WINDOWS Solution: do not check for windows.h on cygwin --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01936b89..99e75c3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,7 +227,11 @@ include (CMakeDependentOption) include (CheckCXXSymbolExists) include (CheckSymbolExists) -check_include_files (windows.h ZMQ_HAVE_WINDOWS) +if (NOT CYGWIN) + # TODO cannot we simply do 'if (WIN32) set(ZMQ_HAVE_WINDOWS ON)' or similar? + check_include_files (windows.h ZMQ_HAVE_WINDOWS) +endif() + if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_SYSTEM_VERSION STREQUAL "10.0") SET(ZMQ_HAVE_WINDOWS_UWP ON) ADD_DEFINITIONS(-D_WIN32_WINNT=_WIN32_WINNT_WIN10) From 4a18ed6778f104261e84175178b2efa5deec7c0a Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Fri, 25 May 2018 08:51:21 +0200 Subject: [PATCH 3/3] Problem: build fails due to broken cygwin64 tests Solution: allow failure of cygwin64 build --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 7e9ad033..6777ac20 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -72,6 +72,8 @@ environment: matrix: fast_finish: false + allow_failures: + - platform: cygwin64 # TODO allow failures until tests are fixed init: - cmd: if "%NO_PR%"=="TRUE" (