Skip to content

Commit 897c186

Browse files
koupitrou
andauthored
ARROW-17433: [CI][C++] Use Visual Studio 2019 on AppVeyor (apache#13903)
We can use /external:I for Boost to suppress warnings from Boost with Visual Studio 2019 or later. Lead-authored-by: Sutou Kouhei <[email protected]> Co-authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 04d2403 commit 897c186

6 files changed

+47
-105
lines changed

appveyor.yml

+11-22
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717

1818
# Operating system (build VM template)
19-
os: Visual Studio 2017
19+
os: Visual Studio 2019
2020

2121
only_commits:
2222
# Skip commits not related to Python or C++
@@ -36,35 +36,24 @@ matrix:
3636

3737
environment:
3838
global:
39-
# Make these variables visible in all jobs and build steps
40-
MSVC_DEFAULT_OPTIONS: ON
4139
APPVEYOR_SAVE_CACHE_ON_ERROR: true
40+
MSVC_DEFAULT_OPTIONS: ON
41+
4242
# Change the clcache dir to reset caches everywhere when a setting
4343
# is changed incompatibly (e.g. CLCACHE_COMPRESS).
4444
CLCACHE_DIR: C:\Users\Appveyor\clcache1
4545
CLCACHE_SERVER: 1
4646
CLCACHE_COMPRESS: 1
4747
CLCACHE_COMPRESSLEVEL: 6
48-
ARROW_BUILD_FLIGHT: "OFF"
49-
ARROW_BUILD_FLIGHT_SQL: "OFF"
50-
ARROW_BUILD_GANDIVA: "OFF"
51-
ARROW_LLVM_VERSION: "7.0.*"
52-
ARROW_S3: "OFF"
53-
PYTHON: "3.8"
54-
ARCH: "64"
5548

56-
matrix:
57-
# NOTE: clcache seems to work best with Ninja and worst with msbuild
58-
# (as generated by cmake)
59-
- JOB: "Toolchain"
60-
GENERATOR: Ninja
61-
ARROW_GCS: "ON"
62-
ARROW_S3: "ON"
63-
ARROW_BUILD_FLIGHT: "ON"
64-
ARROW_BUILD_FLIGHT_SQL: "ON"
65-
ARROW_BUILD_GANDIVA: "ON"
66-
- JOB: "Build_Debug"
67-
GENERATOR: Ninja
49+
ARCH: "64"
50+
ARROW_BUILD_FLIGHT: "ON"
51+
ARROW_BUILD_FLIGHT_SQL: "ON"
52+
ARROW_BUILD_GANDIVA: "ON"
53+
ARROW_GCS: "ON"
54+
ARROW_S3: "ON"
55+
GENERATOR: Ninja
56+
PYTHON: "3.8"
6857

6958
before_build:
7059
- call ci\appveyor-cpp-setup.bat

ci/appveyor-cpp-build.bat

+2-39
Original file line numberDiff line numberDiff line change
@@ -31,51 +31,13 @@ set ARROW_DEBUG_MEMORY_POOL=trap
3131
set CMAKE_BUILD_PARALLEL_LEVEL=%NUMBER_OF_PROCESSORS%
3232
set CTEST_PARALLEL_LEVEL=%NUMBER_OF_PROCESSORS%
3333

34-
@rem
35-
@rem In the configurations below we disable building the Arrow static library
36-
@rem to save some time. Unfortunately this will still build the Parquet static
37-
@rem library because of PARQUET-1420 (Thrift-generated symbols not exported in DLL).
38-
@rem
39-
if "%JOB%" == "Build_Debug" (
40-
mkdir cpp\build-debug
41-
pushd cpp\build-debug
42-
43-
cmake -G "%GENERATOR%" ^
44-
-DARROW_BOOST_USE_SHARED=OFF ^
45-
-DARROW_BUILD_EXAMPLES=ON ^
46-
-DARROW_BUILD_STATIC=OFF ^
47-
-DARROW_BUILD_TESTS=ON ^
48-
-DARROW_CXXFLAGS="/MP" ^
49-
-DARROW_ENABLE_TIMING_TESTS=OFF ^
50-
-DARROW_USE_PRECOMPILED_HEADERS=OFF ^
51-
-DARROW_VERBOSE_THIRDPARTY_BUILD=OFF ^
52-
-DCMAKE_BUILD_TYPE="Debug" ^
53-
-DCMAKE_UNITY_BUILD=ON ^
54-
.. || exit /B
55-
56-
cmake --build . --config Debug || exit /B
57-
ctest --output-on-failure || exit /B
58-
popd
59-
60-
@rem Finish Debug build successfully
61-
exit /B 0
62-
)
6334

6435
call activate arrow
6536

66-
@rem Use Boost from Anaconda
67-
set BOOST_ROOT=%CONDA_PREFIX%\Library
68-
set BOOST_LIBRARYDIR=%CONDA_PREFIX%\Library\lib
69-
7037
@rem The "main" C++ build script for Windows CI
7138
@rem (i.e. for usual configurations)
7239

73-
if "%JOB%" == "Toolchain" (
74-
set CMAKE_ARGS=-DARROW_DEPENDENCY_SOURCE=CONDA -DARROW_WITH_BZ2=ON
75-
) else (
76-
@rem We're in a conda environment but don't want to use it for the dependencies
77-
set CMAKE_ARGS=-DARROW_DEPENDENCY_SOURCE=AUTO
78-
)
40+
set CMAKE_ARGS=-DARROW_DEPENDENCY_SOURCE=CONDA -DARROW_WITH_BZ2=ON
7941

8042
@rem Enable warnings-as-errors
8143
set ARROW_CXXFLAGS=/WX /MP
@@ -119,6 +81,7 @@ cmake -G "%GENERATOR%" %CMAKE_ARGS% ^
11981
-DCMAKE_BUILD_TYPE="Release" ^
12082
-DCMAKE_CXX_COMPILER=clcache ^
12183
-DCMAKE_CXX_FLAGS_RELEASE="/MD /Od /UNDEBUG" ^
84+
-DCMAKE_CXX_STANDARD=17 ^
12285
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
12386
-DCMAKE_UNITY_BUILD=ON ^
12487
-DCMAKE_VERBOSE_MAKEFILE=OFF ^

ci/appveyor-cpp-setup.bat

+21-33
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
@echo on
1919

20-
set "PATH=C:\Miniconda37-x64;C:\Miniconda37-x64\Scripts;C:\Miniconda37-x64\Library\bin;%PATH%"
21-
set BOOST_ROOT=C:\Libraries\boost_1_67_0
22-
set BOOST_LIBRARYDIR=C:\Libraries\boost_1_67_0\lib64-msvc-14.0
20+
set "PATH=C:\Miniconda38-x64;C:\Miniconda38-x64\Scripts;C:\Miniconda38-x64\Library\bin;%PATH%"
2321

2422
@rem
2523
@rem Avoid picking up AppVeyor-installed OpenSSL (linker errors with gRPC)
@@ -31,6 +29,8 @@ rd /s /q C:\OpenSSL-v11-Win32
3129
rd /s /q C:\OpenSSL-v11-Win64
3230
rd /s /q C:\OpenSSL-v111-Win32
3331
rd /s /q C:\OpenSSL-v111-Win64
32+
rd /s /q C:\OpenSSL-v30-Win32
33+
rd /s /q C:\OpenSSL-v30-Win64
3434

3535
@rem
3636
@rem Configure miniconda
@@ -52,47 +52,35 @@ conda install -q -y -c conda-forge mamba python=3.9 || exit /B
5252
mamba update -q -y -c conda-forge --all || exit /B
5353

5454
@rem
55-
@rem Create conda environment for Build and Toolchain jobs
55+
@rem Create conda environment
5656
@rem
57-
@rem Avoid Boost 1.70 because of https://github.com/boostorg/process/issues/85
5857

5958
set CONDA_PACKAGES=
6059

6160
if "%ARROW_BUILD_GANDIVA%" == "ON" (
6261
@rem Install llvmdev in the toolchain if building gandiva.dll
6362
set CONDA_PACKAGES=%CONDA_PACKAGES% --file=ci\conda_env_gandiva_win.txt
6463
)
65-
if "%JOB%" == "Toolchain" (
66-
@rem Install pre-built "toolchain" packages for faster builds
67-
set CONDA_PACKAGES=%CONDA_PACKAGES% --file=ci\conda_env_cpp.txt
68-
)
69-
if "%JOB%" NEQ "Build_Debug" (
70-
@rem Arrow conda environment is only required for the Build and Toolchain jobs
71-
mamba create -n arrow -q -y -c conda-forge ^
72-
--file=ci\conda_env_python.txt ^
73-
%CONDA_PACKAGES% ^
74-
"cmake" ^
75-
"ninja" ^
76-
"nomkl" ^
77-
"pandas" ^
78-
"fsspec" ^
79-
"python=%PYTHON%" ^
80-
|| exit /B
81-
)
64+
@rem Install pre-built "toolchain" packages for faster builds
65+
set CONDA_PACKAGES=%CONDA_PACKAGES% --file=ci\conda_env_cpp.txt
66+
@rem Arrow conda environment
67+
mamba create -n arrow -q -y -c conda-forge ^
68+
--file=ci\conda_env_python.txt ^
69+
%CONDA_PACKAGES% ^
70+
"cmake" ^
71+
"ninja" ^
72+
"nomkl" ^
73+
"pandas" ^
74+
"fsspec" ^
75+
"python=%PYTHON%" ^
76+
|| exit /B
8277

8378
@rem
8479
@rem Configure compiler
8580
@rem
86-
if "%GENERATOR%"=="Ninja" set need_vcvarsall=1
87-
if defined need_vcvarsall (
88-
if "%APPVEYOR_BUILD_WORKER_IMAGE%" NEQ "Visual Studio 2017" (
89-
@rem ARROW-14070 Visual Studio 2015 no longer supported
90-
exit /B
91-
)
92-
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
93-
set CC=cl.exe
94-
set CXX=cl.exe
95-
)
81+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
82+
set CC=cl.exe
83+
set CXX=cl.exe
9684

9785
@rem
9886
@rem Use clcache for faster builds
@@ -109,7 +97,7 @@ powershell.exe -Command "Start-Process clcache-server" || exit /B
10997
@rem Download Minio somewhere on PATH, for unit tests
11098
@rem
11199
if "%ARROW_S3%" == "ON" (
112-
appveyor DownloadFile https://dl.min.io/server/minio/release/windows-amd64/archive/minio.RELEASE.2022-05-26T05-48-41Z -FileName C:\Windows\Minio.exe || exit /B
100+
appveyor DownloadFile https://dl.min.io/server/minio/release/windows-amd64/archive/minio.RELEASE.2022-05-26T05-48-41Z -FileName C:\Windows\Minio.exe || exit /B
113101
)
114102

115103

ci/conda_env_gandiva_win.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
# llvmdev=9 or later require Visual Studio 2017
19-
clangdev=8
20-
llvmdev=8
18+
clangdev
19+
llvmdev

cpp/src/gandiva/gdv_function_stubs.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -754,14 +754,13 @@ GANDIVA_EXPORT
754754
gdv_timestamp from_utc_timezone_timestamp(gdv_int64 context,
755755
gdv_timestamp time_miliseconds,
756756
const char* timezone, gdv_int32 length) {
757-
using arrow_vendored::date::make_zoned;
758757
using arrow_vendored::date::sys_time;
758+
using arrow_vendored::date::zoned_time;
759759
using std::chrono::milliseconds;
760760

761-
sys_time<milliseconds> tp{milliseconds{time_miliseconds}};
762-
const auto utc_tz = make_zoned(std::string("Etc/UTC"), tp);
761+
const sys_time<milliseconds> tp{milliseconds{time_miliseconds}};
763762
try {
764-
const auto local_tz = make_zoned(std::string(timezone, length), utc_tz);
763+
const zoned_time<milliseconds> local_tz{std::string(timezone, length), tp};
765764
gdv_timestamp offset = local_tz.get_time_zone()->get_info(tp).offset.count() * 1000;
766765
return time_miliseconds + static_cast<gdv_timestamp>(offset);
767766
} catch (...) {

cpp/src/gandiva/precompiled/CMakeLists.txt

+8-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ set(PRECOMPILED_SRCS
3131
../../arrow/util/basic_decimal.cc)
3232

3333
if(MSVC)
34-
# clang pretends to be a particular version of MSVC. 191[0-9] is
35-
# Visual Studio 2017, and the standard library uses C++14 features,
36-
# so we have to use that -std version to get the IR compilation to work
37-
if(MSVC_VERSION MATCHES "^191[0-9]$")
34+
# clang pretends to be a particular version of MSVC. Thestandard
35+
# library uses C++14 features, so we have to use that -std version
36+
# to get the IR compilation to work.
37+
# See https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
38+
# for MSVC_VERSION and Visual Studio version.
39+
if(MSVC_VERSION LESS 1930)
40+
set(FMS_COMPATIBILITY 19.20)
41+
elseif(MSVC_VERSION LESS 1920)
3842
set(FMS_COMPATIBILITY 19.10)
3943
else()
4044
message(FATAL_ERROR "Unsupported MSVC_VERSION=${MSVC_VERSION}")

0 commit comments

Comments
 (0)