summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. King, III <jking@apache.org>2017-04-06 08:45:17 -0400
committerJames E. King, III <jking@apache.org>2017-04-06 08:45:17 -0400
commit33df4eb77a70a25a37060efd5e5aad049ed39062 (patch)
treea867164f688accbc0c6ec216579a3b820fb4f095
parent4eb23472b76759843b802bb222d308d408475ab0 (diff)
downloadthrift-33df4eb77a70a25a37060efd5e5aad049ed39062.tar.gz
THRIFT-4166: fix recent VC2010 build regression and prevent it in the future
Client: cpp This closes #1237
-rwxr-xr-xappveyor.yml54
-rw-r--r--build/appveyor/MSVC-appveyor-build.bat1
-rw-r--r--build/appveyor/MSVC-appveyor-install.bat12
-rw-r--r--build/appveyor/MSVC-appveyor-test.bat6
-rw-r--r--build/appveyor/cl_setenv.bat18
-rw-r--r--lib/cpp/src/thrift/TToString.h6
6 files changed, 60 insertions, 37 deletions
diff --git a/appveyor.yml b/appveyor.yml
index b25e7d2fc..42c291124 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -31,44 +31,33 @@ cache:
- C:\ProgramData\chocolatey\lib -> build\appveyor\MSVC-appveyor-install.bat
- C:\msys64\var\cache\pacman -> build\appveyor\MSYS-appveyor-install.bat
-configuration:
-# - Debug
- - Release
-
-platform:
-# - x86
- - x64
-
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|concurrency_test
+
- PROFILE: MSVC2015
+ PLATFORM: x64
+ CONFIGURATION: Release
BOOST_VERSION: 1.63.0
LIBEVENT_VERSION: 2.0.22
PYTHON_VERSION: 3.6
QT_VERSION: 5.8
ZLIB_VERSION: 1.2.11
+ DISABLED_TESTS: StressTestNonBlocking
- PROFILE: MINGW
-
-# - PROFILE: MSVC2010
-# BOOST_VERSION: 1.59.0
-# LIBEVENT_VERSION: 2.0.22
-# PYTHON_VERSION: 3.3
-# ZLIB_VERSION: 1.2.8
-
-# - PROFILE: MSYS
+ PLATFORM: x64
+ CONFIGURATION: Release
matrix:
- allow_failures:
- # MSVC2010 appears to be 32-bit only in appveyor
- - platform: x64
- PROFILE: MSVC2010
-
- # Only have 64-bit MinGW working so far (inside MSYS2)
- - platform: x86
- PROFILE: MINGW
- - platform: x86
- PROFILE: MSYS
+ fast_finish: true
install:
- cd %APPVEYOR_BUILD_FOLDER%
@@ -83,6 +72,7 @@ test_script:
- cd %APPVEYOR_BUILD_FOLDER%
- call build\appveyor\%PROFILE:~0,4%-appveyor-test.bat
+
# artifact capture disabled as it might increase service cost for little gain:
#
# artifacts:
@@ -93,3 +83,15 @@ test_script:
# - path: local-thrift-build\Testing
# name: ctest output
# type: zip
+
+# RDP support: use one or the other...
+#
+# enables RDP for each build job so you can inspect the environment at the beginning of the job:
+# init:
+# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+#
+# enables RDP at the end of the build job so you can login and re-run
+# commands to see why something failed...
+# on_finish:
+# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+
diff --git a/build/appveyor/MSVC-appveyor-build.bat b/build/appveyor/MSVC-appveyor-build.bat
index ee022cbb4..054a8b414 100644
--- a/build/appveyor/MSVC-appveyor-build.bat
+++ b/build/appveyor/MSVC-appveyor-build.bat
@@ -35,6 +35,7 @@ CD "%BUILDDIR%" || EXIT /B
-DZLIB_LIBRARY="%WIN3P%\zlib-inst\lib\zlib%ZLIB_LIB_SUFFIX%.lib" ^
-DZLIB_ROOT="%WIN3P%\zlib-inst" ^
-DWITH_PYTHON=%WITH_PYTHON% ^
+ -DWITH_%THREADMODEL%THREADS=ON ^
-DWITH_SHARED_LIB=OFF ^
-DWITH_STATIC_LIB=ON || EXIT /B
@ECHO OFF
diff --git a/build/appveyor/MSVC-appveyor-install.bat b/build/appveyor/MSVC-appveyor-install.bat
index 5343d8547..573700e0c 100644
--- a/build/appveyor/MSVC-appveyor-install.bat
+++ b/build/appveyor/MSVC-appveyor-install.bat
@@ -56,5 +56,17 @@ IF "%COMPILER%" == "vc100" (
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
diff --git a/build/appveyor/MSVC-appveyor-test.bat b/build/appveyor/MSVC-appveyor-test.bat
index 173708552..16ee2078e 100644
--- a/build/appveyor/MSVC-appveyor-test.bat
+++ b/build/appveyor/MSVC-appveyor-test.bat
@@ -22,8 +22,4 @@ 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%
-:: The stress test is long running on appveyor (2+ minutes)
-:: and not terribly useful with one core, so we disable it
-SET DISABLED_TESTS=StressTestNonBlocking
-
-ctest -C %CONFIGURATION% --timeout 600 -VV -E "(%DISABLED_TESTS%)" || EXIT /B
+ctest -C %CONFIGURATION% --timeout 300 -VV -E "(%DISABLED_TESTS%)" || EXIT /B
diff --git a/build/appveyor/cl_setenv.bat b/build/appveyor/cl_setenv.bat
index d907d5ebd..c1b956c5c 100644
--- a/build/appveyor/cl_setenv.bat
+++ b/build/appveyor/cl_setenv.bat
@@ -40,17 +40,29 @@ SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\local-thrift-build
SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\local-thrift-inst
SET SRCDIR=%APPVEYOR_BUILD_FOLDER%
+: PLATFORM is x64 or x86, but we want x86 to become "32" when we strip it down for paths:
+SET NORM_PLATFORM=%PLATFORM:~-2,2%
+IF "%NORM_PLATFORM%" == "86" (SET NORM_PLATFORM=32)
+
SET BOOST_ROOT=C:\Libraries\boost_%BOOST_VERSION:.=_%
-SET BOOST_LIBRARYDIR=%BOOST_ROOT%\lib%PLATFORM:~-2,2%-msvc-%COMPILER:~-3,2%.0
-SET OPENSSL_ROOT=C:\OpenSSL-Win%PLATFORM:~-2,2%
+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
+
+:: MSVC2010 doesn't "do" std::thread
+IF "%COMPILER%" == "vc100" (
+ SET THREADMODEL=BOOST
+) ELSE (
+ SET THREADMODEL=STD
+)
+
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_STATIC_SUFFIX=d)
+IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d)
IF NOT "%QT_VERSION%" == "" (
IF /i "%PLATFORM%" == "x64" SET QTEXT=_64
diff --git a/lib/cpp/src/thrift/TToString.h b/lib/cpp/src/thrift/TToString.h
index fdf191eb9..25780f9d2 100644
--- a/lib/cpp/src/thrift/TToString.h
+++ b/lib/cpp/src/thrift/TToString.h
@@ -42,21 +42,21 @@ std::string to_string(const T& t) {
// is enabled.
inline std::string to_string(const float& t) {
std::ostringstream o;
- o.precision(std::ceil(std::numeric_limits<float>::digits * std::log10(2) + 1));
+ o.precision(static_cast<std::streamsize>(std::ceil(static_cast<double>(std::numeric_limits<float>::digits * std::log10(2.0f) + 1))));
o << t;
return o.str();
}
inline std::string to_string(const double& t) {
std::ostringstream o;
- o.precision(std::ceil(std::numeric_limits<double>::digits * std::log10(2) + 1));
+ o.precision(static_cast<std::streamsize>(std::ceil(static_cast<double>(std::numeric_limits<double>::digits * std::log10(2.0f) + 1))));
o << t;
return o.str();
}
inline std::string to_string(const long double& t) {
std::ostringstream o;
- o.precision(std::ceil(std::numeric_limits<long double>::digits * std::log10(2) + 1));
+ o.precision(static_cast<std::streamsize>(std::ceil(static_cast<double>(std::numeric_limits<long double>::digits * std::log10(2.0f) + 1))));
o << t;
return o.str();
}