From fd9b430e8b443f71b5ef0d608e936e9745ceceee Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Thu, 17 Oct 2024 20:50:24 +0800 Subject: [PATCH] Fix --- .github/workflows/velox_weekly.yml | 10 +++++++--- dev/ci-velox-buildshared-centos-8.sh | 2 ++ dev/ci-velox-buildstatic-centos-7.sh | 2 ++ dev/docker/Dockerfile.centos7-static-build | 2 +- ep/build-velox/src/get_velox.sh | 11 +++++++++++ 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/velox_weekly.yml b/.github/workflows/velox_weekly.yml index d0d1b27ebcd14..8cd74723f0ae4 100644 --- a/.github/workflows/velox_weekly.yml +++ b/.github/workflows/velox_weekly.yml @@ -49,13 +49,14 @@ jobs: yum install -y epel-release sudo dnf if [ "${{ matrix.os }}" = "centos:7" ]; then yum install -y centos-release-scl - source /opt/rh/devtoolset-11/enable rm /etc/yum.repos.d/CentOS-SCLo-scl.repo -f sed -i \ -e 's/^mirrorlist/#mirrorlist/' \ -e 's/^#baseurl/baseurl/' \ -e 's/mirror\.centos\.org/vault.centos.org/' \ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo + yum install -y devtoolset-11 + source /opt/rh/devtoolset-11/enable elif [ "${{ matrix.os }}" = "quay.io/centos/centos:stream9" ]; then dnf install -y --setopt=install_weak_deps=False gcc-toolset-12 source /opt/rh/gcc-toolset-12/enable || exit 1 @@ -88,9 +89,12 @@ jobs: # To avoid the prompt for region selection during installing tzdata. export DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y sudo maven wget git - if [ "${{ matrix.os }}" = "centos:7" ]; then - sudo apt-get install software-properties-common + if [ "${{ matrix.os }}" = "ubuntu:20.04" ]; then + sudo apt install -y software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update && sudo apt install -y gcc-11 g++-11 + sudo ln -sf /usr/bin/gcc-11 /usr/bin/gcc + sudo ln -sf /usr/bin/g++-11 /usr/bin/g++ fi sudo apt-get install -y openjdk-8-jdk export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 diff --git a/dev/ci-velox-buildshared-centos-8.sh b/dev/ci-velox-buildshared-centos-8.sh index ff9a62b798b5a..f295632ffe35c 100755 --- a/dev/ci-velox-buildshared-centos-8.sh +++ b/dev/ci-velox-buildshared-centos-8.sh @@ -2,6 +2,8 @@ set -e +# TODO: will be removed after docker is updated. +dnf install -y --setopt=install_weak_deps=False gcc-toolset-11 source /opt/rh/gcc-toolset-11/enable ./dev/builddeps-veloxbe.sh --run_setup_script=OFF --build_arrow=OFF --enable_ep_cache=OFF --build_tests=ON \ --build_examples=ON --build_benchmarks=ON diff --git a/dev/ci-velox-buildstatic-centos-7.sh b/dev/ci-velox-buildstatic-centos-7.sh index 6895891a98e98..76bd33d7ffa77 100755 --- a/dev/ci-velox-buildstatic-centos-7.sh +++ b/dev/ci-velox-buildstatic-centos-7.sh @@ -2,6 +2,8 @@ set -e +# TODO: will be removed after docker is updated. +sudo yum install -y devtoolset-11 source /opt/rh/devtoolset-11/enable export NUM_THREADS=4 ./dev/builddeps-veloxbe.sh --enable_vcpkg=ON --build_arrow=OFF --build_tests=OFF --build_benchmarks=OFF \ diff --git a/dev/docker/Dockerfile.centos7-static-build b/dev/docker/Dockerfile.centos7-static-build index a0da8bda5b472..e6bce5d8f4757 100644 --- a/dev/docker/Dockerfile.centos7-static-build +++ b/dev/docker/Dockerfile.centos7-static-build @@ -11,7 +11,7 @@ RUN sed -i \ -e 's/mirror\.centos\.org/vault.centos.org/' \ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo -RUN yum install -y git patch wget sudo java-1.8.0-openjdk-devel ccache +RUN yum install -y git patch wget sudo java-1.8.0-openjdk-devel ccache devtoolset-11 RUN git clone --depth=1 https://github.com/apache/incubator-gluten /opt/gluten diff --git a/ep/build-velox/src/get_velox.sh b/ep/build-velox/src/get_velox.sh index 5455f01fd9f44..9c3db5414db70 100755 --- a/ep/build-velox/src/get_velox.sh +++ b/ep/build-velox/src/get_velox.sh @@ -69,6 +69,17 @@ function process_setup_ubuntu { # Do not install libunwind which can cause interruption when catching native exception. ensure_pattern_matched '\${SUDO} apt install -y libunwind-dev' scripts/setup-ubuntu.sh sed -i 's/${SUDO} apt install -y libunwind-dev//' scripts/setup-ubuntu.sh + # Overwrite gcc installed by build-essential. + ensure_pattern_matched '\${SUDO} pip3 install cmake==3.28.3' scripts/setup-ubuntu.sh + sed -i '/^ ${SUDO} pip3 install cmake==3.28.3/a\ + \VERSION=`cat /etc/os-release | grep VERSION_ID`\ + if [[ $VERSION =~ "20.04" ]]; then\ + sudo apt install -y software-properties-common\ + sudo add-apt-repository ppa:ubuntu-toolchain-r/test\ + sudo apt update && sudo apt install -y gcc-11 g++-11\ + sudo ln -sf /usr/bin/gcc-11 /usr/bin/gcc\ + sudo ln -sf /usr/bin/g++-11 /usr/bin/g++\ + fi' scripts/setup-ubuntu.sh ensure_pattern_matched 'ccache' scripts/setup-ubuntu.sh sed -i '/ccache/a\ *thrift* \\' scripts/setup-ubuntu.sh sed -i '/ccache/a\ libiberty-dev \\' scripts/setup-ubuntu.sh