Skip to content

Commit 4df3683

Browse files
committed
do_cmake: use Python 3.12 on ubuntu >= 24
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 <[email protected]>
1 parent e24bb7e commit 4df3683

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

do_cmake.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ if [ -r /etc/os-release ]; then
4343
;;
4444
ubuntu)
4545
MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
46-
if [ "$MAJOR_VER" -ge "22" ] ; then
46+
if [ "$MAJOR_VER" -ge "24" ] ; then
47+
PYBUILD="3.12"
48+
elif [ "$MAJOR_VER" -ge "22" ] ; then
4749
PYBUILD="3.10"
4850
fi
4951
;;

0 commit comments

Comments
 (0)