Skip to content

Commit

Permalink
Install cmake in linux-apt-lint.dockerfile and update install_cmake.s…
Browse files Browse the repository at this point in the history
…h to not require platform argument
  • Loading branch information
raulcd committed Dec 10, 2024
1 parent 81b112a commit 44831f5
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install CMake 3.25.0
shell: bash
run: |
ci/scripts/install_cmake.sh x86_64 linux 3.25.0 /tmp/local/
ci/scripts/install_cmake.sh $(arch) 3.25.0 /tmp/local/
echo "/tmp/local/bin" >> $GITHUB_PATH
- name: Install pre-commit
run: |
Expand Down
5 changes: 5 additions & 0 deletions ci/docker/linux-apt-lint.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ COPY --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY ci/scripts/install_iwyu.sh /arrow/ci/scripts/
RUN arrow/ci/scripts/install_iwyu.sh /tmp/iwyu /usr/local ${clang_tools}

# Update CMake
ARG cmake=3.25.0
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_cmake.sh $(arch) ${cmake} /usr/local/

# Use python3 by default in scripts
RUN ln -s /usr/bin/python3 /usr/local/bin/python

Expand Down
2 changes: 1 addition & 1 deletion ci/docker/python-wheel-manylinux.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ENV PATH=/opt/python/${CPYTHON_VERSION}-${CPYTHON_VERSION}/bin:${PATH}
# Install CMake
ARG cmake=3.29.2
COPY ci/scripts/install_cmake.sh arrow/ci/scripts/
RUN /arrow/ci/scripts/install_cmake.sh ${arch} linux ${cmake} /usr/local
RUN /arrow/ci/scripts/install_cmake.sh ${arch} ${cmake} /usr/local

# Install Ninja
ARG ninja=1.10.2
Expand Down
26 changes: 21 additions & 5 deletions ci/scripts/install_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,31 @@ platforms=([linux]=linux
[macos]=macos
[windows]=windows)

if [ "$#" -ne 4 ]; then
echo "Usage: $0 <architecture> <platform> <version> <prefix>"
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <architecture> <version> <prefix>"
exit 1
fi

arch=${archs[$1]}
platform=${platforms[$2]}
version=$3
prefix=$4
version=$2
prefix=$3

platform=$(uname)
case ${platform} in
Linux)
platform=linux
;;
Darwin)
platform=macos
;;
MSYS_NT*|MINGW64_NT*)
platform=windows
;;
*)
echo "Unsupported platform: ${platform}"
exit 0
;;
esac

mkdir -p ${prefix}
url="https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-${platform}-"
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/python-wheels/github.osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Install CMake 3.29.0
shell: bash
run: |
arrow/ci/scripts/install_cmake.sh $(arch) macos 3.29.0 ${PWD}/local
arrow/ci/scripts/install_cmake.sh $(arch) 3.29.0 ${PWD}/local
echo "${PWD}/local/bin" >> $GITHUB_PATH
- name: Retrieve VCPKG version from arrow/.env
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/vcpkg-tests/github.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install CMake 3.29.0
shell: bash
run: |
arrow/ci/scripts/install_cmake.sh amd64 windows 3.29.0 /c/cmake
arrow/ci/scripts/install_cmake.sh amd64 3.29.0 /c/cmake
echo "c:\\cmake\\bin" >> $GITHUB_PATH
- name: Download Timezone Database
shell: bash
Expand Down

0 comments on commit 44831f5

Please sign in to comment.