]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "install-deps.sh: drop devtoolset(DTS) check for centos"
authorCasey Bodley <cbodley@redhat.com>
Thu, 24 Feb 2022 18:23:12 +0000 (13:23 -0500)
committerKefu Chai <tchaikov@gmail.com>
Sat, 30 Jul 2022 02:05:04 +0000 (10:05 +0800)
This reverts commit 66e81b8b08b1a48a48c16b5b89450aeced9de5f9.

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Conflicts:
install-deps.sh for centos/rhel 8 instead of 7

install-deps.sh

index e0e8ae4c3c5c5a65d7514a06dced75856171e98f..a10844d8c88778b6646d6e0d2fb41e75ae7f31d6 100755 (executable)
@@ -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 <<EOF
+Your GCC is too old. Please run following command to add DTS to your environment:
+
+scl enable devtoolset-8 bash
+
+Or add following line to the end of ~/.bashrc to add it permanently:
+
+source scl_source enable devtoolset-8
+
+see https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ for more details.
+EOF
+       else
+           # non-interactive shell
+           source /opt/rh/devtoolset-$dts_ver/enable
+       fi
+    fi
+}
+
 for_make_check=false
 if tty -s; then
     # interactive
@@ -401,11 +426,28 @@ EOF
                if test $ID = centos -a $MAJOR_VERSION = 8 ; then
                     # Enable 'powertools' or 'PowerTools' repo
                     $SUDO dnf config-manager --set-enabled $(dnf repolist --all 2>/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