]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
do_cmake: use Python 3.12 on ubuntu >= 24 squid-pyyaml 66691/head
authorKefu Chai <tchaikov@gmail.com>
Fri, 14 Feb 2025 10:53:58 +0000 (18:53 +0800)
committerDavid Galloway <david.galloway@ibm.com>
Fri, 19 Dec 2025 03:59:13 +0000 (22:59 -0500)
the "official" Python shipped along with Ubuntu 24.04 (Noble Numbat) is
Python 3.12. And some of our building have been upgraded to Ubuntu
24.04. But we are still using Python 3.10 on Ubuntu >= 22, this breaks
the build. And CMake fails like:

```
CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3 (missing: Python3_EXECUTABLE Python3_INCLUDE_DIRS
  Python3_LIBRARIES Interpreter Development Development.Module
  Development.Embed) (Required is exact version "3.10")

      Reason given by package:
          Interpreter: Wrong version for the interpreter "/bin/python3"

Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindPython/Support.cmake:3863 (find_package_handle_standard_args)
  cmake/modules/FindPython3.cmake:545 (include)
  CMakeLists.txt:597 (find_package)
```

This build failure should also happen on developers who build Ceph on
Ubuntu >= 24.

In this change, we use Python 3.12 on Ubuntu >= 24

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit 4df368381d3a7c09cdc4859eb52b5d29d206aa5a)

do_cmake.sh

index e7a0cd0fc56a75551e639b7dd5cb946638a9f9c9..a87d0f3764a4ae3bb32281c9d8ba7e3393c3ca56 100755 (executable)
@@ -41,7 +41,9 @@ if [ -r /etc/os-release ]; then
           ;;
       ubuntu)
           MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
-          if [ "$MAJOR_VER" -ge "22" ] ; then
+          if [ "$MAJOR_VER" -ge "24" ] ; then
+              PYBUILD="3.12"
+          elif [ "$MAJOR_VER" -ge "22" ] ; then
               PYBUILD="3.10"
           fi
           ;;