Skip to content

Commit

Permalink
Several fixes to install_cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd committed Dec 10, 2024
1 parent 7cf1802 commit d283042
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 37 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ UBUNTU=22.04

# Default versions for various dependencies
CLANG_TOOLS=14
CMAKE=3.25.0
CUDA=11.2.2
DASK=latest
DOTNET=8.0
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ jobs:
sudo apt update
sudo apt install -y --no-install-recommends python3 python3-dev python3-pip
python3 -m pip install -U pip
- name: Install CMake 3.25.0
shell: bash
run: |
ci/scripts/install_cmake.sh $(arch) 3.25.0 /tmp/local/
echo "/tmp/local/bin" >> $GITHUB_PATH
- name: Setup Archery
run: python3 -m pip install -e dev/archery[docker]
- name: Execute Docker Build
Expand Down Expand Up @@ -201,7 +196,7 @@ jobs:
- name: Install CMake 3.25.0
shell: bash
run: |
ci/scripts/install_cmake.sh $(arch) 3.25.0 /tmp/local/
ci/scripts/install_cmake.sh 3.25.0 /tmp/local/
echo "/tmp/local/bin" >> $GITHUB_PATH
- name: Check CMake presets
run: |
Expand Down Expand Up @@ -365,7 +360,7 @@ jobs:
- name: Install CMake 3.25.0
shell: bash
run: |
ci/scripts/install_cmake.sh amd64 3.25.0 /c/cmake
ci/scripts/install_cmake.sh 3.25.0 /c/cmake
echo "c:\\cmake\\bin" >> $GITHUB_PATH
- name: Download Timezone Database
shell: bash
Expand Down
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 $(arch) 3.25.0 /tmp/local/
ci/scripts/install_cmake.sh 3.25.0 /tmp/local/
echo "/tmp/local/bin" >> $GITHUB_PATH
- name: Install pre-commit
run: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ jobs:
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.12
- name: Install CMake 3.25.0
shell: bash
run: |
ci/scripts/install_cmake.sh $(arch) 3.25.0 /tmp/local/
echo "/tmp/local/bin" >> $GITHUB_PATH
- name: Setup Archery
run: pip install -e dev/archery[docker]
- name: Execute Docker Build
Expand Down
5 changes: 0 additions & 5 deletions ci/docker/linux-apt-lint.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ 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} ${cmake} /usr/local
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local

# Install Ninja
ARG ninja=1.10.2
Expand Down
5 changes: 4 additions & 1 deletion ci/docker/ubuntu-20.04-cpp-minimal.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN apt-get update -y -q && \
apt-get install -y -q \
build-essential \
ccache \
cmake \
curl \
gdb \
git \
Expand Down Expand Up @@ -68,6 +67,10 @@ RUN latest_system_llvm=10 && \
apt-get clean && \
rm -rf /var/lib/apt/lists*

ARG cmake
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/

COPY ci/scripts/install_minio.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_minio.sh latest /usr/local

Expand Down
5 changes: 4 additions & 1 deletion ci/docker/ubuntu-20.04-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ RUN apt-get update -y -q && \
autoconf \
ca-certificates \
ccache \
cmake \
curl \
g++ \
gcc \
Expand Down Expand Up @@ -120,6 +119,10 @@ RUN apt-get update -y -q && \
apt-get clean && \
rm -rf /var/lib/apt/lists*

ARG cmake
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/

COPY ci/scripts/install_minio.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_minio.sh latest /usr/local

Expand Down
4 changes: 4 additions & 0 deletions ci/docker/ubuntu-22.04-cpp-minimal.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ RUN latest_system_llvm=14 && \
apt-get clean && \
rm -rf /var/lib/apt/lists*

ARG cmake
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/

COPY ci/scripts/install_minio.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_minio.sh latest /usr/local

Expand Down
5 changes: 4 additions & 1 deletion ci/docker/ubuntu-22.04-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ RUN apt-get update -y -q && \
ceph \
ceph-fuse \
ceph-mds \
cmake \
curl \
gdb \
git \
Expand Down Expand Up @@ -172,6 +171,10 @@ RUN if [ "${gcc_version}" = "" ]; then \
# make sure zlib is cached in the EMSDK folder
RUN source ~/emsdk/emsdk_env.sh && embuilder --pic build zlib

ARG cmake
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/

COPY ci/scripts/install_minio.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_minio.sh latest /usr/local

Expand Down
30 changes: 17 additions & 13 deletions ci/scripts/install_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,32 @@
# specific language governing permissions and limitations
# under the License.

set -e
set -ex

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

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

arch=$(uname -m)
if [ -z ${archs[$arch]} ]; then
echo "Unsupported architecture: ${arch}"
exit 0
fi
arch=${archs[$arch]}

declare -A platforms
platforms=([linux]=linux
[macos]=macos
[windows]=windows)

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

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

platform=$(uname)
case ${platform} in
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) 3.29.0 ${PWD}/local
arrow/ci/scripts/install_cmake.sh 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 3.29.0 /c/cmake
arrow/ci/scripts/install_cmake.sh 3.29.0 /c/cmake
echo "c:\\cmake\\bin" >> $GITHUB_PATH
- name: Download Timezone Database
shell: bash
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ services:
arch: ${ARCH}
base: "${ARCH}/ubuntu:${UBUNTU}"
clang_tools: ${CLANG_TOOLS}
cmake: ${CMAKE}
llvm: ${LLVM}
gcc_version: ${GCC_VERSION}
shm_size: *shm-size
Expand Down

0 comments on commit d283042

Please sign in to comment.