From: Pete Zaitcev Date: Wed, 15 Dec 2021 05:04:34 +0000 (-0600) Subject: mgr: Define PY_SSIZE_T_CLEAN ahead of every Python.h X-Git-Tag: v17.2.4~103^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88bd7377006f8d7c8164a941ceb303629335294c;p=ceph.git mgr: Define PY_SSIZE_T_CLEAN ahead of every Python.h Building on Fedora 35 with Python 3.10 makes vstart to loop forever, throwing the following message: Error EINVAL: SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats I followed the hint in the following document: https://docs.python.org/3/c-api/intro.html It says "recommended" to always define PY_SSIZE_T_CLEAN, but as you can see it is actually required in our case. Fixes: https://tracker.ceph.com/issues/53441 Signed-off-by: Pete Zaitcev (cherry picked from commit 389054888f2aa782f73564125ec7a1ef0212d536) --- diff --git a/src/mgr/CMakeLists.txt b/src/mgr/CMakeLists.txt index a53d1d8c2a0a..b11c40c42bc9 100644 --- a/src/mgr/CMakeLists.txt +++ b/src/mgr/CMakeLists.txt @@ -34,6 +34,7 @@ if(WITH_MGR) mgr_commands.cc $) add_executable(ceph-mgr ${mgr_srcs}) + target_compile_definitions(ceph-mgr PRIVATE PY_SSIZE_T_CLEAN) if(WITH_LIBCEPHSQLITE) target_link_libraries(ceph-mgr cephsqlite SQLite3::SQLite3) endif()