Skip to content

Commit

Permalink
apacheGH-41124: [CI][C++] Don't use CMake 3.29.1 with vcpkg (apache#4…
Browse files Browse the repository at this point in the history
…1151)

### 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: apache#41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
3 people authored and vibhatha committed May 25, 2024
1 parent 8e4b847 commit 0f8f182
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 19 deletions.
29 changes: 26 additions & 3 deletions ci/scripts/install_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ set -e

declare -A archs
archs=([amd64]=x86_64
[arm64v8]=aarch64)
[arch64]=aarch64
[arm64]=aarch64
[arm64v8]=aarch64
[x86_64]=x86_64)

declare -A platforms
platforms=([linux]=linux
Expand All @@ -38,5 +41,25 @@ platform=${platforms[$2]}
version=$3
prefix=$4

url="https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-${platform}-${arch}.tar.gz"
wget -q ${url} -O - | tar -xzf - --directory ${prefix} --strip-components=1
mkdir -p ${prefix}
url="https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-${platform}-"
case ${platform} in
macos)
url+="universal.tar.gz"
curl -L ${url} | tar -xzf - --directory ${prefix} --strip-components=1
ln -s CMake.app/Contents/bin ${prefix}/bin
;;
windows)
url+="${arch}.zip"
archive_name=$(basename ${url})
curl -L -o ${archive_name} ${url}
unzip ${archive_name}
base_name=$(basename ${archive_name} .zip)
mv ${base_name}/* ${prefix}
rm -rf ${base_name} ${archive_name}
;;
*)
url+="${arch}.tar.gz"
curl -L ${url} | tar -xzf - --directory ${prefix} --strip-components=1
;;
esac
6 changes: 4 additions & 2 deletions dev/tasks/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ env:

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

{%- macro github_upload_releases(pattern) -%}
- name: Set up Python by actions/setup-python
if: runner.arch == 'X64'
if: |
!(runner.os == 'Linux' && runner.arch != 'X64')
uses: actions/setup-python@v4
with:
python-version: 3.12
Expand Down
8 changes: 8 additions & 0 deletions dev/tasks/python-wheels/github.osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ jobs:
run: |
brew list
# CMake 3.29.1 that is pre-installed on the macOS image has a problem.
# See also: https://github.com/microsoft/vcpkg/issues/37968
- name: Install CMake 3.29.0
shell: bash
run: |
arrow/ci/scripts/install_cmake.sh $(arch) macos 3.29.0 ${PWD}/local
echo "${PWD}/local/bin" >> $GITHUB_PATH
- name: Retrieve VCPKG version from arrow/.env
run: |
vcpkg_version=$(cat "arrow/.env" | grep "VCPKG" | cut -d "=" -f2 | tr -d '"')
Expand Down
3 changes: 2 additions & 1 deletion dev/tasks/vcpkg-tests/cpp-build-vcpkg.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ cmake --build . --target INSTALL --config Release || exit /B 1

@rem Test Arrow C++ library

ctest --output-on-failure ^
ctest --build-config Release ^
--output-on-failure ^
--parallel %NUMBER_OF_PROCESSORS% ^
--timeout 300 || exit /B 1

Expand Down
23 changes: 10 additions & 13 deletions dev/tasks/vcpkg-tests/github.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@
# specific language governing permissions and limitations
# under the License.

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

on:
push:
branches:
- "*-github-*"
{{ macros.github_header() }}

jobs:
test-vcpkg-win:
Expand All @@ -31,12 +26,14 @@ jobs:
env:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
steps:
- name: Checkout Arrow
{{ macros.github_checkout_arrow()|indent }}
# CMake 3.29.1 that is pre-installed on the Windows image has a problem.
# See also: https://github.com/microsoft/vcpkg/issues/37968
- name: Install CMake 3.29.0
shell: bash
run: |
git clone --no-checkout {{ arrow.remote }} arrow
git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
git -C arrow checkout FETCH_HEAD
git -C arrow submodule update --init --recursive
arrow/ci/scripts/install_cmake.sh amd64 windows 3.29.0 /c/cmake
echo "c:\\cmake\\bin" >> $GITHUB_PATH
- name: Download Timezone Database
shell: bash
run: arrow/ci/scripts/download_tz_database.sh
Expand All @@ -59,7 +56,7 @@ jobs:
CALL setx PATH "%PATH%;C:\vcpkg"
- name: Setup NuGet Credentials
shell: bash
env:
env:
GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }}
run: |
`vcpkg fetch nuget | tail -n 1` \
Expand Down

0 comments on commit 0f8f182

Please sign in to comment.