Skip to content

Commit 92c4948

Browse files
kouassignUser
andauthored
GH-41124: [CI][C++] Don't use CMake 3.29.1 with vcpkg (#41151)
### Rationale for this change vcpkg doesn't work with CMake 3.29.1. See also: microsoft/vcpkg#37968 ### What changes are included in this PR? Use CMake 3.29.0 temporary. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #41124 Lead-authored-by: Sutou Kouhei <kou@clear-code.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Co-authored-by: Jacob Wujciak-Jens <jacob@wujciak.de> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 0affccc commit 92c4948

File tree

5 files changed

+50
-19
lines changed

5 files changed

+50
-19
lines changed

ci/scripts/install_cmake.sh

+26-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ set -e
2121

2222
declare -A archs
2323
archs=([amd64]=x86_64
24-
[arm64v8]=aarch64)
24+
[arch64]=aarch64
25+
[arm64]=aarch64
26+
[arm64v8]=aarch64
27+
[x86_64]=x86_64)
2528

2629
declare -A platforms
2730
platforms=([linux]=linux
@@ -38,5 +41,25 @@ platform=${platforms[$2]}
3841
version=$3
3942
prefix=$4
4043

41-
url="https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-${platform}-${arch}.tar.gz"
42-
wget -q ${url} -O - | tar -xzf - --directory ${prefix} --strip-components=1
44+
mkdir -p ${prefix}
45+
url="https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-${platform}-"
46+
case ${platform} in
47+
macos)
48+
url+="universal.tar.gz"
49+
curl -L ${url} | tar -xzf - --directory ${prefix} --strip-components=1
50+
ln -s CMake.app/Contents/bin ${prefix}/bin
51+
;;
52+
windows)
53+
url+="${arch}.zip"
54+
archive_name=$(basename ${url})
55+
curl -L -o ${archive_name} ${url}
56+
unzip ${archive_name}
57+
base_name=$(basename ${archive_name} .zip)
58+
mv ${base_name}/* ${prefix}
59+
rm -rf ${base_name} ${archive_name}
60+
;;
61+
*)
62+
url+="${arch}.tar.gz"
63+
curl -L ${url} | tar -xzf - --directory ${prefix} --strip-components=1
64+
;;
65+
esac

dev/tasks/macros.jinja

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ env:
5959

6060
{%- macro github_install_archery() -%}
6161
- name: Set up Python by actions/setup-python
62-
if: runner.arch == 'X64'
62+
if: |
63+
!(runner.os == 'Linux' && runner.arch != 'X64')
6364
uses: actions/setup-python@v4
6465
with:
6566
cache: 'pip'
@@ -86,7 +87,8 @@ env:
8687

8788
{%- macro github_upload_releases(pattern) -%}
8889
- name: Set up Python by actions/setup-python
89-
if: runner.arch == 'X64'
90+
if: |
91+
!(runner.os == 'Linux' && runner.arch != 'X64')
9092
uses: actions/setup-python@v4
9193
with:
9294
python-version: 3.12

dev/tasks/python-wheels/github.osx.yml

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ jobs:
5050
run: |
5151
brew list
5252
53+
# CMake 3.29.1 that is pre-installed on the macOS image has a problem.
54+
# See also: https://github.com/microsoft/vcpkg/issues/37968
55+
- name: Install CMake 3.29.0
56+
shell: bash
57+
run: |
58+
arrow/ci/scripts/install_cmake.sh $(arch) macos 3.29.0 ${PWD}/local
59+
echo "${PWD}/local/bin" >> $GITHUB_PATH
60+
5361
- name: Retrieve VCPKG version from arrow/.env
5462
run: |
5563
vcpkg_version=$(cat "arrow/.env" | grep "VCPKG" | cut -d "=" -f2 | tr -d '"')

dev/tasks/vcpkg-tests/cpp-build-vcpkg.bat

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ cmake --build . --target INSTALL --config Release || exit /B 1
7878

7979
@rem Test Arrow C++ library
8080

81-
ctest --output-on-failure ^
81+
ctest --build-config Release ^
82+
--output-on-failure ^
8283
--parallel %NUMBER_OF_PROCESSORS% ^
8384
--timeout 300 || exit /B 1
8485

dev/tasks/vcpkg-tests/github.windows.yml

+10-13
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
# NOTE: must set "Crossbow" as name to have the badge links working in the
19-
# github comment reports!
20-
name: Crossbow
18+
{% import 'macros.jinja' as macros with context %}
2119

22-
on:
23-
push:
24-
branches:
25-
- "*-github-*"
20+
{{ macros.github_header() }}
2621

2722
jobs:
2823
test-vcpkg-win:
@@ -31,12 +26,14 @@ jobs:
3126
env:
3227
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
3328
steps:
34-
- name: Checkout Arrow
29+
{{ macros.github_checkout_arrow()|indent }}
30+
# CMake 3.29.1 that is pre-installed on the Windows image has a problem.
31+
# See also: https://github.com/microsoft/vcpkg/issues/37968
32+
- name: Install CMake 3.29.0
33+
shell: bash
3534
run: |
36-
git clone --no-checkout {{ arrow.remote }} arrow
37-
git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
38-
git -C arrow checkout FETCH_HEAD
39-
git -C arrow submodule update --init --recursive
35+
arrow/ci/scripts/install_cmake.sh amd64 windows 3.29.0 /c/cmake
36+
echo "c:\\cmake\\bin" >> $GITHUB_PATH
4037
- name: Download Timezone Database
4138
shell: bash
4239
run: arrow/ci/scripts/download_tz_database.sh
@@ -59,7 +56,7 @@ jobs:
5956
CALL setx PATH "%PATH%;C:\vcpkg"
6057
- name: Setup NuGet Credentials
6158
shell: bash
62-
env:
59+
env:
6360
GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }}
6461
run: |
6562
`vcpkg fetch nuget | tail -n 1` \

0 commit comments

Comments
 (0)