]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: Define PY_SSIZE_T_CLEAN ahead of every Python.h 44112/head
authorPete Zaitcev <zaitcev@redhat.com>
Wed, 15 Dec 2021 05:04:34 +0000 (23:04 -0600)
committerPete Zaitcev <zaitcev@redhat.com>
Thu, 16 Dec 2021 00:52:17 +0000 (18:52 -0600)
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 <zaitcev@redhat.com>
src/mgr/CMakeLists.txt

index 55147af4fc6ba6db6efa668633bdae5757f81c32..8f39e41ac06942417b70dbd0b136ab652552ea25 100644 (file)
@@ -33,6 +33,7 @@ if(WITH_MGR)
     mgr_commands.cc
     $<TARGET_OBJECTS:mgr_cap_obj>)
   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()