]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
scripts/build_utils: setup_pbuilder_for_old_gcc() installs requested version 2405/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 18 Jul 2025 16:20:55 +0000 (12:20 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 18 Jul 2025 16:21:59 +0000 (12:21 -0400)
ubuntu noble is special in that we gcc-14 is available but gcc-13 is the
default. before using update-alternatives to prefer gcc-14, we need to
make sure it's installed

copy the relevant bit from setup_pbuilder_for_new_gcc()'s hook
D05install-new-gcc to make sure the requested version is installed
before running the D10update-gcc-alternatives hook

Signed-off-by: Casey Bodley <cbodley@redhat.com>
scripts/build_utils.sh

index 2179f2999603ce3cec239103e91c92e6aa975067..598b1bf301d4ec6a118ef3ac529c8d616a9398f3 100755 (executable)
@@ -806,6 +806,13 @@ setup_pbuilder_for_old_gcc() {
         noble)
             old=14;;
     esac
+
+    # make sure the requested version is installed. this isn't the case by default on noble
+    cat > $hookdir/D05install-old-gcc <<EOF
+env DEBIAN_FRONTEND=noninteractive apt-get install -y g++-$old
+EOF
+    chmod +x $hookdir/D05install-old-gcc
+
     setup_gcc_hook $old > $hookdir/D10update-gcc-alternatives
     chmod +x $hookdir/D10update-gcc-alternatives
 }