]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
run-make: work around package conflicts from llvm.sh 63409/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 21 May 2025 17:24:26 +0000 (13:24 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 4 Jun 2025 13:18:19 +0000 (09:18 -0400)
packages installed by llvm.sh sometimes conflict with existing packages
from earlier versions, leading to errors like:

> The following packages have unmet dependencies:
> python3-lldb-13 : Conflicts: python3-lldb-x.y
> python3-lldb-19 : Conflicts: python3-lldb-x.y

remove packages from any earlier versions before running llvm.sh

Fixes: https://tracker.ceph.com/issues/70792
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/script/run-make.sh

index e9a07ac2121631803d7c908a910924b74c2557e6..b2ef3422476df1732a79aed7390b24bdf43e7bfe 100755 (executable)
@@ -54,12 +54,21 @@ function prepare() {
         which_pkg="debianutils"
 
         if in_jenkins; then
-            if ! type clang-19 > /dev/null 2>&1 ; then
-                ci_debug "Getting clang-19"
+            wrap_sudo
+            # require clang-19. uninstall previous versions to work around package conflicts
+            local v=19
+            local remove_from=13
+            local remove_to=$(($v-1))
+            ci_debug "Removing clang package versions from $remove_from-$remove_to"
+            for i in $(seq $remove_from $remove_to); do
+                $DRY_RUN $SUDO apt-get purge --auto-remove clang-$i lldb-$i lld-$i clangd-$i python3-lldb-$i -y || true
+            done
+
+            if ! type clang-$v > /dev/null 2>&1 ; then
+                ci_debug "Getting clang-$v"
                 wget https://download.ceph.com/qa/llvm.sh
                 chmod +x llvm.sh
-                wrap_sudo
-                $DRY_RUN $SUDO ./llvm.sh 19
+                $DRY_RUN $SUDO ./llvm.sh $v
                 rm llvm.sh
             fi
         fi
@@ -67,7 +76,7 @@ function prepare() {
 
     if test -f ./install-deps.sh ; then
         ci_debug "Running install-deps.sh"
-        INSTALL_EXTRA_PACKAGES="ccache git $which_pkg clang lvm2"
+        INSTALL_EXTRA_PACKAGES="ccache git $which_pkg lvm2"
         $DRY_RUN source ./install-deps.sh || return 1
         trap clean_up_after_myself EXIT
     fi