Skip to content

Commit 965e761

Browse files
authored
1 parent f93ba4d commit 965e761

3 files changed

Lines changed: 73 additions & 21 deletions

File tree

‎.github/workflows/cpp.yml‎

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
name: AMD64 ${{ matrix.name }} C++17
194194
runs-on: ${{ matrix.os }}
195195
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
196-
timeout-minutes: 45
196+
timeout-minutes: 60
197197
strategy:
198198
fail-fast: false
199199
matrix:
@@ -202,14 +202,12 @@ jobs:
202202
include:
203203
- os: windows-2019
204204
name: Windows 2019
205-
generator: Visual Studio 16 2019
206205
env:
207206
ARROW_BOOST_USE_SHARED: OFF
208207
ARROW_BUILD_BENCHMARKS: ON
209208
ARROW_BUILD_SHARED: ON
210209
ARROW_BUILD_STATIC: OFF
211210
ARROW_BUILD_TESTS: ON
212-
ARROW_CXXFLAGS: "/std:c++17"
213211
ARROW_DATASET: ON
214212
ARROW_FLIGHT: OFF
215213
ARROW_HDFS: ON
@@ -227,11 +225,13 @@ jobs:
227225
ARROW_WITH_ZLIB: ON
228226
ARROW_WITH_ZSTD: ON
229227
BOOST_SOURCE: BUNDLED
230-
CMAKE_ARGS: '-A x64 -DOPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64'
231-
CMAKE_GENERATOR: ${{ matrix.generator }}
228+
CMAKE_CXX_STANDARD: "17"
229+
CMAKE_GENERATOR: Ninja
232230
CMAKE_INSTALL_LIBDIR: bin
233231
CMAKE_INSTALL_PREFIX: /usr
234232
CMAKE_UNITY_BUILD: ON
233+
OPENSSL_ROOT_DIR: >-
234+
C:\Program Files\OpenSSL-Win64
235235
NPROC: 3
236236
steps:
237237
- name: Disable Crash Dialogs
@@ -254,9 +254,30 @@ jobs:
254254
- name: Download Timezone Database
255255
shell: bash
256256
run: ci/scripts/download_tz_database.sh
257-
- name: Build
257+
- name: Install ccache
258258
shell: bash
259-
run: ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
259+
run: |
260+
ci/scripts/install_ccache.sh 4.6.2 /usr
261+
- name: Setup ccache
262+
shell: bash
263+
run: |
264+
ci/scripts/ccache_setup.sh
265+
- name: ccache info
266+
id: ccache-info
267+
shell: bash
268+
run: |
269+
echo "::set-output name=cache-dir::$(ccache --get-config cache_dir)"
270+
- name: Cache ccache
271+
uses: actions/cache@v2
272+
with:
273+
path: ${{ steps.ccache-info.outputs.cache-dir }}
274+
key: cpp-ccache-windows-${{ hashFiles('cpp/**') }}
275+
restore-keys: cpp-ccache-windows-
276+
- name: Build
277+
shell: cmd
278+
run: |
279+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
280+
bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
260281
- name: Test
261282
shell: bash
262283
run: ci/scripts/cpp_test.sh $(pwd) $(pwd)/build

‎ci/scripts/install_ccache.sh‎

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,33 @@ fi
2626

2727
version=$1
2828
prefix=$2
29-
url="https://github.com/ccache/ccache/archive/v${version}.tar.gz"
3029

31-
mkdir /tmp/ccache
32-
wget -q ${url} -O - | tar -xzf - --directory /tmp/ccache --strip-components=1
30+
mkdir -p /tmp/ccache
31+
case $(uname) in
32+
MINGW64*)
33+
url="https://github.com/ccache/ccache/releases/download/v${version}/ccache-${version}-windows-x86_64.zip"
34+
pushd /tmp/ccache
35+
curl --fail --location --remote-name ${url}
36+
unzip -j ccache-${version}-windows-x86_64.zip
37+
chmod +x ccache.exe
38+
mv ccache.exe ${prefix}/bin/
39+
popd
40+
;;
41+
*)
42+
url="https://github.com/ccache/ccache/archive/v${version}.tar.gz"
3343

34-
mkdir /tmp/ccache/build
35-
pushd /tmp/ccache/build
36-
cmake \
37-
-GNinja \
38-
-DCMAKE_BUILD_TYPE=Release \
39-
-DCMAKE_INSTALL_PREFIX=${prefix} \
40-
-DZSTD_FROM_INTERNET=ON \
41-
..
42-
ninja install
43-
popd
44+
wget -q ${url} -O - | tar -xzf - --directory /tmp/ccache --strip-components=1
4445

46+
mkdir /tmp/ccache/build
47+
pushd /tmp/ccache/build
48+
cmake \
49+
-GNinja \
50+
-DCMAKE_BUILD_TYPE=Release \
51+
-DCMAKE_INSTALL_PREFIX=${prefix} \
52+
-DZSTD_FROM_INTERNET=ON \
53+
..
54+
ninja install
55+
popd
56+
;;
57+
esac
4558
rm -rf /tmp/ccache

‎cpp/cmake_modules/SetupCxxFlags.cmake‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,24 @@ if(WIN32)
205205
# * https://developercommunity.visualstudio.com/content/problem/1249671/stdc17-generates-warning-compiling-windowsh.html
206206
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /wd5105")
207207

208+
if(ARROW_USE_CCACHE)
209+
foreach(c_flag
210+
CMAKE_CXX_FLAGS
211+
CMAKE_CXX_FLAGS_RELEASE
212+
CMAKE_CXX_FLAGS_DEBUG
213+
CMAKE_CXX_FLAGS_MINSIZEREL
214+
CMAKE_CXX_FLAGS_RELWITHDEBINFO
215+
CMAKE_C_FLAGS
216+
CMAKE_C_FLAGS_RELEASE
217+
CMAKE_C_FLAGS_DEBUG
218+
CMAKE_C_FLAGS_MINSIZEREL
219+
CMAKE_C_FLAGS_RELWITHDEBINFO)
220+
# ccache doesn't work with /Zi.
221+
# See also: https://github.com/ccache/ccache/issues/1040
222+
string(REPLACE "/Zi" "/Z7" ${c_flag} "${${c_flag}}")
223+
endforeach()
224+
endif()
225+
208226
if(ARROW_USE_STATIC_CRT)
209227
foreach(c_flag
210228
CMAKE_CXX_FLAGS
@@ -217,7 +235,7 @@ if(WIN32)
217235
CMAKE_C_FLAGS_DEBUG
218236
CMAKE_C_FLAGS_MINSIZEREL
219237
CMAKE_C_FLAGS_RELWITHDEBINFO)
220-
string(REPLACE "/MD" "-MT" ${c_flag} "${${c_flag}}")
238+
string(REPLACE "/MD" "/MT" ${c_flag} "${${c_flag}}")
221239
endforeach()
222240
endif()
223241

0 commit comments

Comments
 (0)