Skip to content

Commit 9ce6253

Browse files
committed
[CI][C++] Add Windows ARM64 build
- Use GitHub hosted runner `windows-11-arm` to build with MSVC ARM64 - `simd-level` is set `NONE` for now as xsimd does not yet support MSVC ARM64 - `msys2` is installed and used for the timezone data, as it is not guaranteed to exist on windows-11-arm images - A recent version of `cmake` is installed as support for finding Windows OpenSSL ARM64 builds was only added in 4.1.0 (see Kitware/CMake@bf52219) - The Boost context implementation is set to `winfib` when building with MSVC ARM64 as it's the only supported implementation for that platform (see boostorg/context#296 (comment) and boostorg/context#315)
1 parent d6c980c commit 9ce6253

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

.github/workflows/cpp.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,15 @@ jobs:
287287
strategy:
288288
fail-fast: false
289289
matrix:
290-
os:
291-
- windows-2022
292290
include:
293-
- os: windows-2022
291+
- arch: x64
292+
os: windows-2022
294293
simd-level: AVX2
295-
title: AMD64 Windows 2022 AVX2
294+
title: AMD64 Windows 2022 AVX2 C++
295+
- arch: arm64
296+
os: windows-11-arm
297+
simd-level: NONE
298+
title: ARM64 Windows 11 C++
296299
env:
297300
ARROW_BOOST_USE_SHARED: OFF
298301
ARROW_BUILD_BENCHMARKS: ON
@@ -340,6 +343,13 @@ jobs:
340343
- name: Download Timezone Database
341344
shell: bash
342345
run: ci/scripts/download_tz_database.sh
346+
- name: Install msys2 (for tzdata for ORC tests)
347+
uses: msys2/setup-msys2@v2
348+
id: setup-msys2
349+
- name: Install cmake
350+
shell: bash
351+
run: |
352+
ci/scripts/install_cmake.sh 4.1.2 /usr
343353
- name: Install ccache
344354
shell: bash
345355
run: |
@@ -365,14 +375,14 @@ jobs:
365375
- name: Build
366376
shell: cmd
367377
run: |
368-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
378+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }}
369379
bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
370380
- name: Test
371381
shell: cmd
372382
run: |
373-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
383+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }}
374384
# For ORC
375-
set TZDIR=C:\msys64\usr\share\zoneinfo
385+
set TZDIR=${{ steps.setup-msys2.outputs.msys2-location }}\usr\share\zoneinfo
376386
bash -c "ci/scripts/cpp_test.sh $(pwd) $(pwd)/build"
377387
378388
windows-mingw:

ci/scripts/install_cmake.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ case ${platform} in
4949
;;
5050
MSYS_NT*|MINGW64_NT*)
5151
platform=windows
52+
if [[ "$(uname)" == *-ARM64 ]]; then
53+
arch=arm64
54+
fi
5255
;;
5356
*)
5457
echo "Unsupported platform: ${platform}"
@@ -70,7 +73,7 @@ case ${platform} in
7073
curl -L -o "${archive_name}" "${url}"
7174
unzip "${archive_name}"
7275
base_name=$(basename "${archive_name}" .zip)
73-
mv "${base_name}"/* "${prefix}"
76+
cp -a "${base_name}"/* "${prefix}"
7477
rm -rf "${base_name}" "${archive_name}"
7578
;;
7679
*)

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,11 @@ function(build_boost)
11181118
# This is for https://github.com/boostorg/container/issues/305
11191119
string(APPEND CMAKE_C_FLAGS " -Wno-strict-prototypes")
11201120
endif()
1121+
if(MSVC AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
1122+
set(BOOST_CONTEXT_IMPLEMENTATION
1123+
winfib
1124+
CACHE STRING "" FORCE)
1125+
endif()
11211126
set(CMAKE_UNITY_BUILD OFF)
11221127

11231128
fetchcontent_makeavailable(boost)

0 commit comments

Comments
 (0)