THRIFT-4508: change windows CI builds to use current MSVC, one cygwin and one 
mingw build


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

Branch: refs/heads/master
Commit: 860a5f1ff828d395397c643a1f694e7bdd9729b0
Parents: a37feaf
Author: James E. King III <jk...@apache.org>
Authored: Tue Mar 6 14:23:23 2018 -0500
Committer: James E. King III <jk...@apache.org>
Committed: Tue Mar 6 18:17:41 2018 -0500

----------------------------------------------------------------------
 appveyor.yml                             |  41 +++++----
 build/appveyor/CYGW-appveyor-build.bat   |  36 ++++++++
 build/appveyor/CYGW-appveyor-install.bat |  34 +++++++
 build/appveyor/CYGW-appveyor-test.bat    |  21 +++++
 build/appveyor/MING-appveyor-build.bat   |  11 ++-
 build/appveyor/MING-appveyor-install.bat |  42 ++++++++-
 build/appveyor/MING-appveyor-test.bat    |  10 ++-
 build/appveyor/MSVC-appveyor-install.bat |  46 ++++------
 build/appveyor/MSVC-appveyor-test.bat    |  13 ++-
 build/appveyor/MSYS-appveyor-build.bat   |   3 +-
 build/appveyor/MSYS-appveyor-install.bat |  21 +++--
 build/appveyor/build-libevent.bat        |  17 ++--
 build/appveyor/build-zlib.bat            |  15 +++-
 build/appveyor/cl_setcompiler.bat        |  10 +--
 build/appveyor/cl_setenv.bat             | 125 +++++++++++++++++---------
 build/appveyor/cl_setgenerator.bat       |  11 ++-
 build/appveyor/cl_showenv.bat            |  15 ++--
 build/appveyor/simulate-appveyor.bat     |   2 +-
 compiler/cpp/src/thrift/thrifty.yy       |   1 +
 19 files changed, 330 insertions(+), 144 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/appveyor.yml
----------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
index 4c2e364..2db28f6 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -24,40 +24,39 @@ version: '1.0.0-dev.{build}'
 shallow_clone: true
 
 os:
-  - Visual Studio 2015
+  - Visual Studio 2017
 
-cache:
-  - C:\projects\thrift\buildcache -> build\appveyor\MSVC-appveyor-install.bat
-  - C:\ProgramData\chocolatey\lib -> build\appveyor\MSVC-appveyor-install.bat
-  - C:\msys64\var\cache\pacman    -> build\appveyor\MSYS-appveyor-install.bat
+matrix:
+  allow_failures:
+      - PROFILE: CYGWIN
+  fast_finish: true
 
 environment:
   matrix:
-   - PROFILE: MSVC2010
-     PLATFORM: x86
-     CONFIGURATION: Debug
-     BOOST_VERSION: 1.54.0
-     LIBEVENT_VERSION: 2.0.22
-     QT_VERSION: 5.6
-     ZLIB_VERSION: 1.2.8
-     DISABLED_TESTS: StressTestNonBlocking
-
-   - PROFILE: MSVC2015
+   - PROFILE: MSVC2017
      PLATFORM: x64
      CONFIGURATION: Release
-     BOOST_VERSION: 1.64.0
-     LIBEVENT_VERSION: 2.0.22
+     BOOST_VERSION: 1.65.1
+     LIBEVENT_VERSION: 2.1.8
      PYTHON_VERSION: 3.6
-     QT_VERSION: 5.8
+     QT_VERSION: 5.10
      ZLIB_VERSION: 1.2.11
      DISABLED_TESTS: StressTestNonBlocking
 
    - PROFILE: MINGW
      PLATFORM: x64
-     CONFIGURATION: Release
+     CONFIGURATION: RelWithDebInfo
+     DISABLED_TESTS: StressTestNonBlocking
 
-matrix:
-  fast_finish: true
+   - PROFILE: CYGWIN
+     PLATFORM: x64
+     CONFIGURATION: RelWithDebInfo
+     DISABLED_TESTS: 
(ZlibTest|OpenSSLManualInitTest|TNonblockingServerTest|StressTestNonBlocking)
+
+   - PROFILE: CYGWIN
+     PLATFORM: x86
+     CONFIGURATION: RelWithDebInfo
+     DISABLED_TESTS: 
(ZlibTest|OpenSSLManualInitTest|TNonblockingServerTest|StressTestNonBlocking)
 
 install:
   - cd %APPVEYOR_BUILD_FOLDER%

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/CYGW-appveyor-build.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/CYGW-appveyor-build.bat 
b/build/appveyor/CYGW-appveyor-build.bat
new file mode 100644
index 0000000..c226222
--- /dev/null
+++ b/build/appveyor/CYGW-appveyor-build.bat
@@ -0,0 +1,36 @@
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+::     http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+::
+
+@ECHO OFF
+SETLOCAL EnableDelayedExpansion
+
+CD build\appveyor                           || EXIT /B
+CALL cl_banner_build.bat                    || EXIT /B
+CALL cl_setenv.bat                          || EXIT /B
+
+SET CMAKEARGS=^
+  -G'%GENERATOR%' ^
+  -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
+  -DCMAKE_INSTALL_PREFIX=%INSTDIR% ^
+  -DCMAKE_CXX_EXTENSIONS=ON ^
+  -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE" ^
+  -DCMAKE_CXX_STANDARD=11 ^
+  -DWITH_PYTHON=OFF ^
+  -DWITH_SHARED_LIB=OFF ^
+  -DWITH_STATIC_LIB=ON ^
+  -DWITH_STDTHREADS=ON
+
+@ECHO ON
+%BASH% -lc "mkdir -p %BUILDDIR% && cd %BUILDDIR% && cmake.exe %SRCDIR% 
%CMAKEARGS% && cmake --build . --config %CONFIGURATION% --target install" || 
EXIT /B
+@ECHO OFF

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/CYGW-appveyor-install.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/CYGW-appveyor-install.bat 
b/build/appveyor/CYGW-appveyor-install.bat
new file mode 100644
index 0000000..77db7d4
--- /dev/null
+++ b/build/appveyor/CYGW-appveyor-install.bat
@@ -0,0 +1,34 @@
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+::     http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+::
+
+::
+:: Appveyor install script for CYGWIN
+:: Installs third party packages we need for a cmake build
+::
+
+@ECHO OFF
+SETLOCAL EnableDelayedExpansion
+
+CD build\appveyor                          || EXIT /B
+CALL cl_banner_install.bat                 || EXIT /B
+CALL cl_setenv.bat                         || EXIT /B
+CALL cl_showenv.bat                        || EXIT /B
+
+::
+:: Install apt-cyg for package management
+::
+
+%BASH% -lc "wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg && install 
apt-cyg /bin && rm -f apt-cyg" || EXIT /B
+%BASH% -lc "apt-cyg update" || EXIT /B
+%BASH% -lc "apt-cyg install bison cmake flex gcc-g++ libboost-devel 
libevent-devel make openssl-devel zlib-devel"

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/CYGW-appveyor-test.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/CYGW-appveyor-test.bat 
b/build/appveyor/CYGW-appveyor-test.bat
new file mode 100644
index 0000000..b667f9b
--- /dev/null
+++ b/build/appveyor/CYGW-appveyor-test.bat
@@ -0,0 +1,21 @@
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+::     http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+::
+
+@ECHO OFF
+SETLOCAL EnableDelayedExpansion
+CD build\appveyor              || EXIT /B
+CALL cl_banner_test.bat        || EXIT /B
+CALL cl_setenv.bat             || EXIT /B
+
+%BASH% -lc "cd %BUILDDIR% && ctest.exe -C %CONFIGURATION% --timeout 300 -VV -E 
'%DISABLED_TESTS%'" || EXIT /B

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/MING-appveyor-build.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/MING-appveyor-build.bat 
b/build/appveyor/MING-appveyor-build.bat
index 838e428..6ebdb90 100644
--- a/build/appveyor/MING-appveyor-build.bat
+++ b/build/appveyor/MING-appveyor-build.bat
@@ -22,15 +22,14 @@ CALL cl_setenv.bat                          || EXIT /B
 SET CMAKEARGS=^
   -G'%GENERATOR%' ^
   -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
-  -DCMAKE_INSTALL_PREFIX=%INSTDIR_MSYS% ^
-  -DCMAKE_MAKE_PROGRAM=/mingw64/bin/mingw32-make ^
-  -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe ^
-  -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe ^
-  -DWITH_LIBEVENT=OFF ^
+  -DCMAKE_INSTALL_PREFIX=%INSTDIR% ^
+  -DCMAKE_MAKE_PROGRAM=/mingw%NORM_PLATFORM%/bin/mingw32-make ^
+  -DCMAKE_C_COMPILER=/mingw%NORM_PLATFORM%/bin/gcc.exe ^
+  -DCMAKE_CXX_COMPILER=/mingw%NORM_PLATFORM%/bin/g++.exe ^
   -DWITH_PYTHON=OFF ^
   -DWITH_SHARED_LIB=OFF ^
   -DWITH_STATIC_LIB=ON
 
 @ECHO ON
-%BASH% -lc "mkdir -p %BUILDDIR_MSYS% && cd %BUILDDIR_MSYS% && cmake.exe 
%SRCDIR_MSYS% %CMAKEARGS% && cmake --build . --config %CONFIGURATION% --target 
install" || EXIT /B
+%BASH% -lc "mkdir -p %BUILDDIR% && cd %BUILDDIR% && cmake.exe %SRCDIR% 
%CMAKEARGS% && cmake --build . --config %CONFIGURATION% --target install" || 
EXIT /B
 @ECHO OFF

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/MING-appveyor-install.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/MING-appveyor-install.bat 
b/build/appveyor/MING-appveyor-install.bat
index 0d5f99e..ce8fc7d 100644
--- a/build/appveyor/MING-appveyor-install.bat
+++ b/build/appveyor/MING-appveyor-install.bat
@@ -13,9 +13,43 @@
 ::
 
 ::
-:: Appveyor install script for MinGW
-:: Installs (or builds) third party packages we need
+:: Appveyor install script for MINGW on MSYS2
+:: Installs third party packages we need for a cmake build
 ::
 
-:: Same as the MSYS installation requirements
-CALL build\appveyor\MSYS-appveyor-install.bat
+@ECHO OFF
+SETLOCAL EnableDelayedExpansion
+
+CD build\appveyor                          || EXIT /B
+CALL cl_banner_install.bat                 || EXIT /B
+CALL cl_setenv.bat                         || EXIT /B
+CALL cl_showenv.bat                        || EXIT /B
+
+:: We're going to keep boost at a version cmake understands
+SET BOOSTVER=1.64.0-3
+SET BOOSTPKG=mingw-w64-%MINGWPLAT%-boost-%BOOSTVER%-any.pkg.tar.xz
+SET IGNORE=--ignore mingw-w64-x86_64-boost --ignore mingw-w64-i686-boost
+
+SET PACKAGES=^
+  --needed -S bison flex make ^
+  mingw-w64-%MINGWPLAT%-cmake ^
+  mingw-w64-%MINGWPLAT%-libevent ^
+  mingw-w64-%MINGWPLAT%-openssl ^
+  mingw-w64-%MINGWPLAT%-toolchain ^
+  mingw-w64-%MINGWPLAT%-zlib
+
+::mingw-w64-%MINGWPLAT%-qt5 : WAY too large (1GB download!) - tested in cygwin 
builds anyway
+
+:: Remove old packages that no longer exist to avoid an error
+%BASH% -lc "pacman --noconfirm --remove libcatgets catgets || true" || EXIT /B
+
+:: Upgrade things
+%BASH% -lc "pacman --noconfirm -Syu %IGNORE%"                       || EXIT /B
+%BASH% -lc "pacman --noconfirm -Su %IGNORE%"                        || EXIT /B
+%BASH% -lc "pacman --noconfirm %PACKAGES%"                          || EXIT /B
+
+:: Install a slightly older boost (BOOSTVER) as cmake in mingw
+:: does not have built-in dependencies for boost 1.66.0 yet
+:: -- this cuts down on build warning output --
+
+%BASH% -lc "if [[ $(pacman --query | grep '%MINGWPLAT%-boost') ^!= 
*"%BOOSTVER%"* ]]; then wget http://repo.msys2.org/mingw/%MINGWPLAT%/%BOOSTPKG% 
&& pacman --noconfirm --needed -U %BOOSTPKG% && rm %BOOSTPKG%; fi" || EXIT /B

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/MING-appveyor-test.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/MING-appveyor-test.bat 
b/build/appveyor/MING-appveyor-test.bat
index c37c72a..499c1ff 100644
--- a/build/appveyor/MING-appveyor-test.bat
+++ b/build/appveyor/MING-appveyor-test.bat
@@ -12,5 +12,11 @@
 :: limitations under the License.
 ::
 
-:: Same as MSYS2
-CALL build\appveyor\MSYS-appveyor-test.bat
+@ECHO OFF
+SETLOCAL EnableDelayedExpansion
+
+CD build\appveyor              || EXIT /B
+CALL cl_banner_test.bat        || EXIT /B
+CALL cl_setenv.bat             || EXIT /B
+
+%BASH% -lc "cd %BUILDDIR% && ctest.exe -C %CONFIGURATION% --timeout 300 -VV -E 
'%DISABLED_TESTS%'" || EXIT /B

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/MSVC-appveyor-install.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/MSVC-appveyor-install.bat 
b/build/appveyor/MSVC-appveyor-install.bat
index 573700e..95008bd 100644
--- a/build/appveyor/MSVC-appveyor-install.bat
+++ b/build/appveyor/MSVC-appveyor-install.bat
@@ -26,47 +26,35 @@ CALL cl_setenv.bat                        || EXIT /B
 CALL cl_showenv.bat                       || EXIT /B
 MKDIR "%WIN3P%"                           || EXIT /B
 
-:: Install ant - this also installs the latest JDK as a dependency
-:: The installation of JDK requires us to pick up PATH and JAVE_HOME from the 
registry
-cinst -c "%BUILDCACHE%" -y ant            || EXIT /B
+choco feature enable -n allowGlobalConfirmation || EXIT /B
+
+:: Things to install when NOT running in appveyor:
+IF "%APPVEYOR_BUILD_ID%" == "" (
+    cup -y chocolatey                     || EXIT /B
+    cinst -c "%BUILDCACHE%" -y curl       || EXIT /B
+    cinst -c "%BUILDCACHE%" -y 7zip       || EXIT /B
+    cinst -c "%BUILDCACHE%" -y python3    || EXIT /B
+    cinst -c "%BUILDCACHE%" -y openssl.light || EXIT /B
+)
 
-:: Install bison and flex
+cinst -c "%BUILDCACHE%" -y jdk8           || EXIT /B
 cinst -c "%BUILDCACHE%" -y winflexbison3  || EXIT /B
 
-:: zlib
+:: zlib - not available through chocolatey
 CD "%APPVEYOR_SCRIPTS%"                   || EXIT /B
 call build-zlib.bat                       || EXIT /B
 
-:: libevent
+:: libevent - not available through chocolatey
 CD "%APPVEYOR_SCRIPTS%"                   || EXIT /B
 call build-libevent.bat                   || EXIT /B
 
-:: python packages
-pip install backports.ssl_match_hostname ^
+:: python packages (correct path to pip set in cl_setenv.bat)
+pip.exe ^
+    install backports.ssl_match_hostname ^
             ipaddress ^
+            six ^
             tornado ^
             twisted                       || EXIT /B
 
-:: msinttypes - for MSVC2010 only
-SET 
MSINTTYPESURL=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/msinttypes/msinttypes-r26.zip
-IF "%COMPILER%" == "vc100" (
-  MKDIR "%WIN3P%\msinttypes"              || EXIT /B
-  CD "%WIN3P%\msinttypes"                 || EXIT /B
-  appveyor DownloadFile "%MSINTTYPESURL%" || EXIT /B
-  7z x "msinttypes-r26.zip"               || EXIT /B
-)
-
-:: appveyor build slaves do not have MSVC2010 Boost installed
-IF "%COMPILER%" == "vc100" (
-  SET BITS=64
-  IF "%PLATFORM%" == "x86" (
-    SET BITS=32
-  )
-  SET 
BOOSTEXEURL=https://downloads.sourceforge.net/project/boost/boost-binaries/%BOOST_VERSION%/boost_%BOOST_VERSION:.=_%-msvc-10.0-!BITS!.exe
-  SET 
BOOSTEXE=C:\projects\thrift\buildcache\boost_%BOOST_VERSION:.=_%-msvc-10.0-!BITS!.exe
-  appveyor DownloadFile "!BOOSTEXEURL!" -FileName "!BOOSTEXE!" || EXIT /B
-  "!BOOSTEXE!" /dir=C:\Libraries\boost_%BOOST_VERSION:.=_% /silent || EXIT /B
-)
-
 :: Haskell (GHC) and cabal
 cinst -c "%BUILDCACHE%" -y ghc            || EXIT /B

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/MSVC-appveyor-test.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/MSVC-appveyor-test.bat 
b/build/appveyor/MSVC-appveyor-test.bat
index 16ee207..3594579 100644
--- a/build/appveyor/MSVC-appveyor-test.bat
+++ b/build/appveyor/MSVC-appveyor-test.bat
@@ -12,14 +12,21 @@
 :: limitations under the License.
 ::
 
-@ECHO OFF
+@ECHO ON
 SETLOCAL EnableDelayedExpansion
 CD build\appveyor              || EXIT /B
 CALL cl_banner_test.bat        || EXIT /B
 CALL cl_setenv.bat             || EXIT /B
 CD "%BUILDDIR%"                || EXIT /B
 
-:: Add directories to the path to find DLLs of third party libraries so tests 
run
-SET PATH=%BOOST_LIBRARYDIR%;%OPENSSL_ROOT%\bin;%WIN3P%\zlib-inst\bin;%PATH%
+DIR C:\libraries
+DIR C:\libraries\boost_1_59_0
+DIR C:\libraries\boost_1_60_0
+DIR C:\libraries\boost_1_62_0
+DIR C:\libraries\boost_1_63_0
+DIR C:\libraries\boost_1_64_0
+
+:: Add directories to the path to find DLLs of third party libraries so tests 
run properly!
+SET PATH=%BOOST_LIBRARYDIR:/=\%;%OPENSSL_ROOT%\bin;%WIN3P%\zlib-inst\bin;%PATH%
 
 ctest -C %CONFIGURATION% --timeout 300 -VV -E "(%DISABLED_TESTS%)" || EXIT /B

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/MSYS-appveyor-build.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/MSYS-appveyor-build.bat 
b/build/appveyor/MSYS-appveyor-build.bat
index b9d8955..4401729 100644
--- a/build/appveyor/MSYS-appveyor-build.bat
+++ b/build/appveyor/MSYS-appveyor-build.bat
@@ -33,12 +33,13 @@ SET CMAKEARGS=-G\"%GENERATOR%\" ^
   -DCMAKE_CXX_COMPILER=g++.exe ^
   -DCMAKE_MAKE_PROGRAM=make.exe ^
   -DCMAKE_INSTALL_PREFIX=%INSTDIR_MSYS% ^
+  -DLIBEVENT_ROOT=%LIBEVENT_ROOT% ^
   -DOPENSSL_LIBRARIES=%OPENSSL_LIBRARIES% ^
   -DOPENSSL_ROOT_DIR=%OPENSSL_ROOT% ^
   -DOPENSSL_USE_STATIC_LIBS=ON ^
   -DWITH_BOOST_STATIC=ON ^
   -DWITH_JAVA=OFF ^
-  -DWITH_LIBEVENT=OFF ^
+  -DWITH_LIBEVENT=ON ^
   -DWITH_PYTHON=%WITH_PYTHON% ^
   -DWITH_SHARED_LIB=OFF ^
   -DWITH_STATIC_LIB=ON

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/MSYS-appveyor-install.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/MSYS-appveyor-install.bat 
b/build/appveyor/MSYS-appveyor-install.bat
index ff43cd3..a818df3 100644
--- a/build/appveyor/MSYS-appveyor-install.bat
+++ b/build/appveyor/MSYS-appveyor-install.bat
@@ -25,17 +25,24 @@ CALL cl_banner_install.bat                 || EXIT /B
 CALL cl_setenv.bat                         || EXIT /B
 CALL cl_showenv.bat                        || EXIT /B
 
+:: We're going to keep boost at a version cmake understands
+SET BOOSTPKG=mingw-w64-x86_64-boost-1.64.0-3-any.pkg.tar.xz
+SET IGNORE=--ignore mingw-w64-x86_64-boost
+
 SET PACKAGES=^
-  --needed -S bison flex ^
-  make ^
-  mingw-w64-x86_64-boost ^
+  --needed -S bison flex make ^
   mingw-w64-x86_64-cmake ^
+  mingw-w64-x86_64-libevent ^
   mingw-w64-x86_64-openssl ^
   mingw-w64-x86_64-toolchain ^
   mingw-w64-x86_64-zlib
 
-:: omitting libevent-devel for now it is version 2.1.4 and doesn't play nice 
with MinGW
+%BASH% -lc "pacman --noconfirm -Syu %IGNORE%" || EXIT /B
+%BASH% -lc "pacman --noconfirm -Su %IGNORE%"  || EXIT /B
+%BASH% -lc "pacman --noconfirm %PACKAGES%"    || EXIT /B
+
+:: Install a slightly older boost (1.64.0) as cmake 3.10
+:: does not have built-in dependencies for boost 1.66.0 yet
+:: -- this cuts down on build warning output --
+%BASH% -lc "wget http://repo.msys2.org/mingw/x86_64/%BOOSTPKG% && pacman 
--noconfirm --needed -U %BOOSTPKG% && rm %BOOSTPKG%" || EXIT /B
 
-%BASH% -lc "pacman --noconfirm -Syu"       || EXIT /B
-%BASH% -lc "pacman --noconfirm -Su"        || EXIT /B
-%BASH% -lc "pacman --noconfirm %PACKAGES%" || EXIT /B

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/build-libevent.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/build-libevent.bat 
b/build/appveyor/build-libevent.bat
index 13c74ee..64b635b 100644
--- a/build/appveyor/build-libevent.bat
+++ b/build/appveyor/build-libevent.bat
@@ -17,14 +17,21 @@ SETLOCAL EnableDelayedExpansion
 SET URLFILE=libevent-%LIBEVENT_VERSION%-stable.tar.gz
 SET 
URL=https://github.com/libevent/libevent/releases/download/release-%LIBEVENT_VERSION%-stable/%URLFILE%
 
-CD %WIN3P%                                       || EXIT /B
-appveyor DownloadFile %URL%                      || EXIT /B
-7z x %URLFILE% -so | 7z x -si -ttar > nul        || EXIT /B
+:: Download - support running a local build or a build in appveyor
+CD "%WIN3P%"                                     || EXIT /B
+IF "%APPVEYOR_BUILD_ID%" == "" (
+    curl -L -f -o "%URLFILE%" "%URL%"
+) ELSE (
+    appveyor DownloadFile "%URL%"
+)
+7z x "%URLFILE%" -so | 7z x -si -ttar > nul      || EXIT /B
 CD "libevent-%LIBEVENT_VERSION%-stable"          || EXIT /B
-nmake -f Makefile.nmake                          || EXIT /B
+nmake -f Makefile.nmake static_libs              || EXIT /B
+
+:: in libevent 2.0 there is no nmake subdirectory in WIN32-Code, but in 2.1 
there is
 mkdir lib                                        || EXIT /B
 move *.lib lib\                                  || EXIT /B
-move WIN32-Code\event2\* include\event2\         || EXIT /B
+move WIN32-Code\event2\* include\event2\         || move 
WIN32-Code\nmake\event2\* include\event2\ || EXIT /B
 move *.h include\                                || EXIT /B
 
 ENDLOCAL

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/build-zlib.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/build-zlib.bat b/build/appveyor/build-zlib.bat
index d8811a1..9195726 100644
--- a/build/appveyor/build-zlib.bat
+++ b/build/appveyor/build-zlib.bat
@@ -24,11 +24,18 @@ SET URLFILE=%PACKAGE%.tar.gz
 SET URL=http://zlib.net/%URLFILE%
 SET FURL=http://zlib.net/fossils/%URLFILE%
 
-:: Download
+:: Download - support running a local build or a build in appveyor
 CD "%WIN3P%"                                                     || EXIT /B
-appveyor DownloadFile "%URL%"
-IF ERRORLEVEL 1 (
-    appveyor DownloadFile "%FURL%"                               || EXIT /B
+IF "%APPVEYOR_BUILD_ID%" == "" (
+    curl -L -f -o "%URLFILE%" "%URL%"
+    IF ERRORLEVEL 1 (
+        curl -L -f -o "%URLFILE%" "%FURL%"
+    )
+) ELSE (
+    appveyor DownloadFile "%URL%"
+    IF ERRORLEVEL 1 (
+        appveyor DownloadFile "%FURL%"                           || EXIT /B
+    )
 )
 7z x "%URLFILE%" -so | 7z x -si -ttar > nul                      || EXIT /B
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/cl_setcompiler.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/cl_setcompiler.bat 
b/build/appveyor/cl_setcompiler.bat
index b97da73..733ffc5 100644
--- a/build/appveyor/cl_setcompiler.bat
+++ b/build/appveyor/cl_setcompiler.bat
@@ -20,7 +20,7 @@
 ::   vc110 = Visual Studio 2012
 ::   vc120 = Visual Studio 2013
 ::   vc140 = Visual Studio 2015
-::   vc150 = Visual Studio 2017
+::   vc141 = Visual Studio 2017
 ::
 :: Honors any existing COMPILER environment variable
 ::   setting instead of overwriting it, to allow it
@@ -44,10 +44,10 @@ IF NOT "%PROFILE:~0,4%" == "MSVC" (
   IF !ERRORLEVEL! == 0 (SET COMPILER=vc110)
   CALL :CHECK 18
   IF !ERRORLEVEL! == 0 (SET COMPILER=vc120)
-  CALL :CHECK 19.00
+  CALL :CHECK 19.0
   IF !ERRORLEVEL! == 0 (SET COMPILER=vc140)
-  CALL :CHECK 19.10
-  IF !ERRORLEVEL! == 0 (SET COMPILER=vc150)
+  CALL :CHECK 19.1
+  IF !ERRORLEVEL! == 0 (SET COMPILER=vc141)
 )
 
 IF NOT DEFINED COMPILER (
@@ -59,5 +59,5 @@ ECHO [info ] detected compiler edition    %COMPILER%
 EXIT /B 0
 
 :CHECK
-cl /? 2>&1 | findstr /C:"Version %1%." > nul
+cl /? 2>&1 | findstr /C:"Version %1%" > nul
 EXIT /B

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/cl_setenv.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/cl_setenv.bat b/build/appveyor/cl_setenv.bat
index e80d6b5..10af2d3 100644
--- a/build/appveyor/cl_setenv.bat
+++ b/build/appveyor/cl_setenv.bat
@@ -12,6 +12,8 @@
 :: limitations under the License.
 ::
 
+@ECHO OFF
+
        IF "%PROFILE%" == "MSVC2010" (
   CALL "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" 
%PLATFORM%
 ) ELSE IF "%PROFILE%" == "MSVC2012" (
@@ -21,11 +23,11 @@
 ) ELSE IF "%PROFILE%" == "MSVC2015" (
   CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" 
%PLATFORM%
 ) ELSE IF "%PROFILE%" == "MSVC2017" (
-  CALL "C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat" %PLATFORM%
+  CALL :SETUPNEWERMSVC    || EXIT /B
 ) ELSE IF "%PROFILE%" == "MINGW" (
-  SET MSYS2_PATH_TYPE=stock
-) ELSE IF "%PROFILE%" == "MSYS" (
-  SET MSYS2_PATH_TYPE=stock
+  REM Supported, nothing special to do here.
+) ELSE IF "%PROFILE%" == "CYGWIN" (
+  REM Supported, nothing special to do here.
 ) ELSE (
   ECHO Unsupported PROFILE=%PROFILE% or PLATFORM=%PLATFORM%
   EXIT /B 1
@@ -35,58 +37,93 @@ CALL cl_setcompiler.bat   || EXIT /B
 CALL cl_setgenerator.bat  || EXIT /B
 
 SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor
-SET BUILDCACHE=%APPVEYOR_BUILD_FOLDER%\buildcache
-SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\local-thrift-build
-SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\local-thrift-inst
+SET BUILDCACHE=%APPVEYOR_BUILD_FOLDER%\..\build\cache
+SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM%
+SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM%
 SET SRCDIR=%APPVEYOR_BUILD_FOLDER%
 
-: PLATFORM is x64 or x86, but we want x86 to become "32" when we strip it down 
for paths:
+:: PLATFORM is x64 or x86
+:: NORM_PLATFORM is 64 or 32
 SET NORM_PLATFORM=%PLATFORM:~-2,2%
 IF "%NORM_PLATFORM%" == "86" (SET NORM_PLATFORM=32)
 
-:: FindBoost needs forward slashes so cmake doesn't see something as an 
escaped character
-SET BOOST_ROOT=C:/Libraries/boost_%BOOST_VERSION:.=_%
-SET BOOST_LIBRARYDIR=%BOOST_ROOT%/lib%NORM_PLATFORM%-msvc-%COMPILER:~-3,2%.0
-SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM%
-SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty
+IF "%PROFILE:~0,4%" == "MSVC" (
 
-:: MSVC2010 doesn't "do" std::thread
-IF "%COMPILER%" == "vc100" (
-  SET THREADMODEL=BOOST
-) ELSE (
-  SET THREADMODEL=STD
-)
+  :: FindBoost needs forward slashes so cmake doesn't see something as an 
escaped character
+  SET BOOST_ROOT=C:/Libraries/boost_%BOOST_VERSION:.=_%
+  SET 
BOOST_LIBRARYDIR=!BOOST_ROOT!/lib%NORM_PLATFORM%-msvc-%COMPILER:~-3,2%.%COMPILER:~-1,1%
+  SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM%
+  SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty
 
-IF "%PYTHON_VERSION%" == "" (
-  SET WITH_PYTHON=OFF
-) ELSE (
-  SET WITH_PYTHON=ON
-  SET 
PATH=C:\Python%PYTHON_VERSION:.=%\scripts;C:\Python%PYTHON_VERSION:.=%;!PATH!
-)
-IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d)
+  :: MSVC2010 doesn't "do" std::thread
+  IF "%COMPILER%" == "vc100" (
+    SET THREADMODEL=BOOST
+  ) ELSE (
+    SET THREADMODEL=STD
+  )
 
-IF NOT "%QT_VERSION%" == "" (
-  IF /i "%PLATFORM%" == "x64" SET QTEXT=_64
-  SET PATH=C:\Qt\%QT_VERSION%\%PROFILE%!QTEXT!\bin;!PATH!
-)
+  IF "%PYTHON_VERSION%" == "" (
+    SET WITH_PYTHON=OFF
+  ) ELSE (
+    SET WITH_PYTHON=ON
+    IF /i "%PLATFORM%" == "x64" SET PTEXT=-x64
+    SET 
PATH=C:\Python%PYTHON_VERSION:.=%!PTEXT!\scripts;C:\Python%PYTHON_VERSION:.=%!PTEXT!;!PATH!
+  )
+  IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d)
+
+  IF NOT "%QT_VERSION%" == "" (
+    IF /i "%PLATFORM%" == "x64" SET QTEXT=_64
+    SET PATH=C:\Qt\%QT_VERSION%\%PROFILE%!QTEXT!\bin;!PATH!
+  )
+
+) ELSE IF "%PROFILE:~0,4%" == "MING" (
 
-IF NOT "%PROFILE:~0,4%" == "MSVC" (
+  :: PLATFORM = x86 means MINGWPLAT i686
+  :: PLATFORM = x64 means MINGWPLAT x86_64
+  SET MINGWPLAT=x86_64
+  IF "%PLATFORM%" == "x86" (SET MINGWPLAT=i686)
 
   SET BASH=C:\msys64\usr\bin\bash.exe
-  SET BOOST_ROOT=
-  SET BOOST_INCLUDEDIR=/mingw64/include
-  SET BOOST_LIBRARYDIR=/mingw64/lib
-  SET OPENSSL_LIBRARIES=/mingw64/lib
-  SET OPENSSL_ROOT=/mingw64
-  SET WIN3P=
+  !BASH! -lc "sed -i '/export PATH=\/mingw32\/bin/d' ~/.bash_profile && sed -i 
'/export PATH=\/mingw64\/bin/d' ~/.bash_profile && echo 'export 
PATH=/mingw%NORM_PLATFORM%/bin:$PATH' >> ~/.bash_profile" || EXIT /B
 
-  !BASH! -lc "sed -i '/export PATH=\/mingw64\/bin/d' ~/.bash_profile && echo 
'export PATH=/mingw64/bin:$PATH' >> ~/.bash_profile" || EXIT /B
+  SET BUILDDIR=%BUILDDIR:\=/%
+  SET BUILDDIR=/c!BUILDDIR:~2!
+  SET INSTDIR=%INSTDIR:\=/%
+  SET INSTDIR=/c!INSTDIR:~2!
+  SET SRCDIR=%SRCDIR:\=/%
+  SET SRCDIR=/c!SRCDIR:~2!
+
+) ELSE IF "%PROFILE:~0,4%" == "CYGW" (
+
+  SET CYGWINROOT=C:\cygwin
+  IF "%PLATFORM%" == "x64" (SET CYGWINROOT=!CYGWINROOT!64)
+
+  SET BASH=!CYGWINROOT!\bin\bash.exe
+  SET SETUP=!CYGWINROOT!\setup-x86
+  IF "%PLATFORM%" == "x64" (SET SETUP=!SETUP!_64)
+  SET SETUP=!SETUP!.exe
+
+  SET BUILDDIR=%BUILDDIR:\=/%
+  SET BUILDDIR=/cygdrive/c!BUILDDIR:~2!
+  SET INSTDIR=%INSTDIR:\=/%
+  SET INSTDIR_CYG=/cygdrive/c!INSTDIR:~2!
+  SET SRCDIR=%SRCDIR:\=/%
+  SET SRCDIR=/cygdrive/c!SRCDIR:~2!
 
 )
 
-SET BUILDDIR_MSYS=%BUILDDIR:\=/%
-SET BUILDDIR_MSYS=/c%BUILDDIR_MSYS:~2%
-SET INSTDIR_MSYS=%INSTDIR:\=/%
-SET INSTDIR_MSYS=/c%INSTDIR_MSYS:~2%
-SET SRCDIR_MSYS=%SRCDIR:\=/%
-SET SRCDIR_MSYS=/c%SRCDIR_MSYS:~2%
+GOTO :EOF
+
+:SETUPNEWERMSVC
+  FOR /F "USEBACKQ TOKENS=*" %%i IN (`call "%ProgramFiles(x86)%\Microsoft 
Visual Studio\Installer\vswhere.exe" -version "[15.0,16.0)" -property 
installationPath`) DO (
+    IF "%MSVCROOT%" == "" (SET MSVCROOT=%%i)
+  )
+  SET MSVCPLAT=x86
+  IF "%PLATFORM%" == "x64" (SET MSVCPLAT=amd64)
+
+  SET CURRENTDIR=%CD%
+  CALL "!MSVCROOT!\Common7\Tools\VsDevCmd.bat" -arch=!MSVCPLAT! || EXIT /B
+  CD %CURRENTDIR%
+  EXIT /B
+
+:EOF

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/cl_setgenerator.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/cl_setgenerator.bat 
b/build/appveyor/cl_setgenerator.bat
index 7ca9853..5eb6ff3 100644
--- a/build/appveyor/cl_setgenerator.bat
+++ b/build/appveyor/cl_setgenerator.bat
@@ -28,6 +28,7 @@
 ::                                 Optional [arch] can be "Win64" or "IA64".
 ::  MinGW Makefiles              = Generates makefiles for MinGW
 ::  MSYS Makefiles               = Generates makefiles for MSYS
+::  Unix Makefiles               = Generates makefiles for CYGWIN
 ::
 :: Honors any existing GENERATOR environment variable
 ::   setting instead of overwriting it, to allow it
@@ -45,6 +46,10 @@ IF DEFINED GENERATOR (
 
 IF "%PROFILE:~0,4%" == "MING" (
   SET GENERATOR=MinGW Makefiles
+
+) ELSE IF "%PROFILE:~0,4%" == "CYGW" (
+  SET GENERATOR=Unix Makefiles
+
 ) ELSE IF "%PROFILE:~0,4%" == "MSYS" (
   SET GENERATOR=MSYS Makefiles
 ) ELSE (
@@ -55,9 +60,9 @@ IF "%PROFILE:~0,4%" == "MING" (
   IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 11 2012!GENARCH!
   CALL :CHECK 18
   IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 12 2013!GENARCH!
-  CALL :CHECK 19.00
+  CALL :CHECK 19.0
   IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 14 2015!GENARCH!
-  CALL :CHECK 19.10
+  CALL :CHECK 19.1
   IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 15 2017!GENARCH!
 )
 
@@ -70,5 +75,5 @@ ECHO [info ] using CMake generator        %GENERATOR%
 EXIT /B 0
 
 :CHECK
-cl /? 2>&1 | findstr /C:"Version %1%." > nul
+cl /? 2>&1 | findstr /C:"Version %1%" > nul
 EXIT /B

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/cl_showenv.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/cl_showenv.bat b/build/appveyor/cl_showenv.bat
index 33dd660..3dda546 100644
--- a/build/appveyor/cl_showenv.bat
+++ b/build/appveyor/cl_showenv.bat
@@ -34,6 +34,7 @@ ECHO/
 ECHO Our Variables
 ECHO 
-------------------------------------------------------------------------------
 ECHO APPVEYOR_SCRIPTS      = %APPVEYOR_SCRIPTS%
+ECHO BASH                  = %BASH%
 ECHO BOOST_ROOT            = %BOOST_ROOT%
 ECHO BOOST_INCLUDEDIR      = %BOOST_INCLUDEDIR%
 ECHO BOOST_LIBRARYDIR      = %BOOST_LIBRARYDIR%
@@ -44,20 +45,16 @@ ECHO GENERATOR             = %GENERATOR%
 ECHO INSTDIR               = %INSTDIR%
 ECHO JAVA_HOME             = %JAVA_HOME%
 ECHO OPENSSL_ROOT          = %OPENSSL_ROOT%
+ECHO SETUP                 = %SETUP%
 ECHO SRCDIR                = %SRCDIR%
 ECHO WIN3P                 = %WIN3P%
 ECHO WITH_PYTHON           = %WITH_PYTHON%
 ECHO ZLIB_STATIC_SUFFIX    = %ZLIB_STATIC_SUFFIX%
 IF NOT "%PROFILE:~0,4%" == "MSVC" (
-ECHO/
-ECHO MSYS2/MinGW
-ECHO 
-------------------------------------------------------------------------------
-ECHO BUILDDIR_MSYS         = %BUILDDIR_MSYS%
-ECHO INSTDIR_MSYS          = %INSTDIR_MSYS%
-ECHO MSYS2_PATH_TYPE       = %MSYS2_PATH_TYPE%
-ECHO SRCDIR_MSYS           = %SRCDIR_MSYS%
-ECHO PATH                  =
-C:\msys64\usr\bin\bash -lc "echo $PATH"
+  ECHO/
+  ECHO UNIXy PATH
+  ECHO 
-------------------------------------------------------------------------------
+  %BASH% -lc "echo $PATH"
 )
 ECHO/
 ECHO Windows PATH

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/build/appveyor/simulate-appveyor.bat
----------------------------------------------------------------------
diff --git a/build/appveyor/simulate-appveyor.bat 
b/build/appveyor/simulate-appveyor.bat
index b32c0da..8674f40 100644
--- a/build/appveyor/simulate-appveyor.bat
+++ b/build/appveyor/simulate-appveyor.bat
@@ -16,7 +16,7 @@
 :: Helps build thrift by pretending to be appveyor
 :: Usage:
 ::   cd build\appveyor
-::   simulate-appveyor.bat [Debug|Release] [x86|x64] [MINGW|MSVC2015]
+::   simulate-appveyor.bat [Debug|Release] [x86|x64] [CYGWIN|MINGW|MSVC201?]
 ::
 
 @ECHO OFF

http://git-wip-us.apache.org/repos/asf/thrift/blob/860a5f1f/compiler/cpp/src/thrift/thrifty.yy
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/thrift/thrifty.yy 
b/compiler/cpp/src/thrift/thrifty.yy
index e4cae0c..df34adf 100644
--- a/compiler/cpp/src/thrift/thrifty.yy
+++ b/compiler/cpp/src/thrift/thrifty.yy
@@ -35,6 +35,7 @@
 #define __STDC_FORMAT_MACROS
 #endif
 #include <stdio.h>
+#include <string.h>
 #ifndef _MSC_VER
 #include <inttypes.h>
 #else

Reply via email to