From: Casey Bodley Date: Thu, 24 Feb 2022 18:23:12 +0000 (-0500) Subject: Revert "install-deps.sh: drop devtoolset(DTS) check for centos" X-Git-Tag: v18.0.0~366^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65b1a13139873c1525456e05cd00aeb64da4e881;p=ceph.git Revert "install-deps.sh: drop devtoolset(DTS) check for centos" This reverts commit 66e81b8b08b1a48a48c16b5b89450aeced9de5f9. Signed-off-by: Casey Bodley Conflicts: install-deps.sh for centos/rhel 8 instead of 7 --- diff --git a/install-deps.sh b/install-deps.sh index e0e8ae4c3c5c..a10844d8c887 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -224,6 +224,31 @@ function version_lt { test $1 != $(echo -e "$1\n$2" | sort -rV | head -n 1) } +function ensure_decent_gcc_on_rh { + local old=$(gcc -dumpversion) + local expected=5.1 + local dts_ver=$1 + if version_lt $old $expected; then + if test -t 1; then + # interactive shell + cat </dev/null|gawk 'tolower($0) ~ /^powertools\s/{print $1}') + case "$ARCH" in + x86_64) + $SUDO dnf -y install centos-release-scl + dts_ver=8 + ;; + aarch64) + $SUDO dnf -y install centos-release-scl-rh + $SUDO dnf config-manager --disable centos-sclo-rh + $SUDO dnf config-manager --enable centos-sclo-rh-testing + dts_ver=8 + ;; + esac # before EPEL8 and PowerTools provide all dependencies, we use sepia for the dependencies $SUDO dnf config-manager --add-repo http://apt-mirror.front.sepia.ceph.com/lab-extras/8/ $SUDO dnf config-manager --setopt=apt-mirror.front.sepia.ceph.com_lab-extras_8_.gpgcheck=0 --save $SUDO dnf -y module enable javapackages-tools elif test $ID = rhel -a $MAJOR_VERSION = 8 ; then + $SUDO dnf config-manager \ + --enable rhel-server-rhscl-8-rpms \ + --enable rhel-8-server-optional-rpms \ + --enable rhel-8-server-devtools-rpms + dts_ver=8 $SUDO dnf config-manager --set-enabled "codeready-builder-for-rhel-8-${ARCH}-rpms" $SUDO dnf config-manager --add-repo http://apt-mirror.front.sepia.ceph.com/lab-extras/8/ $SUDO dnf config-manager --setopt=apt-mirror.front.sepia.ceph.com_lab-extras_8_.gpgcheck=0 --save @@ -418,6 +460,9 @@ EOF $SUDO dnf install -y python3-devel $SUDO $builddepcmd $DIR/ceph.spec 2>&1 | tee $DIR/yum-builddep.out [ ${PIPESTATUS[0]} -ne 0 ] && exit 1 + if [ -n "$dts_ver" ]; then + ensure_decent_gcc_on_rh $dts_ver + fi IGNORE_YUM_BUILDEP_ERRORS="ValueError: SELinux policy is not managed or store cannot be accessed." sed "/$IGNORE_YUM_BUILDEP_ERRORS/d" $DIR/yum-builddep.out | grep -qi "error:" && exit 1 # for rgw motr backend build checks