From 1cb4f5708737156656d815745bb0e43ebcbda16c Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 21 May 2025 13:24:26 -0400 Subject: [PATCH] run-make: work around package conflicts from llvm.sh 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 (cherry picked from commit 54f0fe19447308f2127ad4bacecfa0aab4e44c4d) --- src/script/run-make.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/script/run-make.sh b/src/script/run-make.sh index e9a07ac212163..b2ef3422476df 100755 --- a/src/script/run-make.sh +++ b/src/script/run-make.sh @@ -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 -- 2.39.5