From 014edc2a2b87fb7854fa7f9c0b5a4c464609802c Mon Sep 17 00:00:00 2001 From: wangzengliang Date: Mon, 13 Mar 2023 19:59:34 +0800 Subject: [PATCH 1/2] fix PY_SSIZE_T_CLEAN error --- ...SIZE_T_CLEAN_ahead-of-every-Python.h.patch | 28 +++++++++++++++++++ ceph.spec | 6 +++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0015-define-PY_SSIZE_T_CLEAN_ahead-of-every-Python.h.patch diff --git a/0015-define-PY_SSIZE_T_CLEAN_ahead-of-every-Python.h.patch b/0015-define-PY_SSIZE_T_CLEAN_ahead-of-every-Python.h.patch new file mode 100644 index 0000000..10395ab --- /dev/null +++ b/0015-define-PY_SSIZE_T_CLEAN_ahead-of-every-Python.h.patch @@ -0,0 +1,28 @@ +From 8f1a333cb1c7e8b8f54c5cfa5b806f47f63a99a6 Mon Sep 17 00:00:00 2001 +From: wangzengliang2 +Date: Mon, 13 Mar 2023 19:44:36 +0800 +Subject: [PATCH] define PY_SSIZE_T_CLEAN_ahead of every Python.h +Building on Python 3.10 makes vstart throwing thr following message: + Error : PY_SSIZE_T_CLEAN macro must be definied for '#' formats + +Fixes: https://tracker.ceph.com/issues/53441 +Signed-off-by: Pere Zaitcev +--- + src/mgr/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/mgr/CMakeLists.txt b/src/mgr/CMakeLists.txt +index f2187407a..e9978232c 100644 +--- a/src/mgr/CMakeLists.txt ++++ b/src/mgr/CMakeLists.txt +@@ -33,6 +33,7 @@ if(WITH_MGR) + mgr_commands.cc + $) + add_executable(ceph-mgr ${mgr_srcs}) ++ target_compile_definitions(ceph-mgr PRIVATE PY_SSIZE_T_CLEAN) + target_link_libraries(ceph-mgr + osdc client heap_profiler + global-static ceph-common +-- +2.27.0 + diff --git a/ceph.spec b/ceph.spec index 24bb0e2..8df1975 100644 --- a/ceph.spec +++ b/ceph.spec @@ -125,7 +125,7 @@ ################################################################################# Name: ceph Version: 16.2.7 -Release: 17 +Release: 18 %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} Epoch: 2 %endif @@ -157,6 +157,7 @@ Patch11: 0011-fix-no-module-named-v1_event-for-mgr-k8sevent.patch Patch12: 0012-add-missing-includes-when-compiling-with-boost-1.75.patch Patch13: 0013-add-atomic-library-for-loongarch64.patch Patch14: 0014-fix-CVE-2022-3854.patch +Patch15: 0015-define-PY_SSIZE_T_CLEAN_ahead-of-every-Python.h.patch %if 0%{?suse_version} # _insert_obs_source_lines_here ExclusiveArch: x86_64 aarch64 ppc64le s390x @@ -2504,6 +2505,9 @@ exit 0 %config %{_sysconfdir}/prometheus/ceph/ceph_default_alerts.yml %changelog +* Mon Mar 13 2023 wangzengliang - 2:16.2.7-18 +- fix build mgr with python 3.10 error + * Wed Mar 1 2023 wangzengliang - 2:16.2.7-17 - fix error for uninstall cephadm -- Gitee From aca387aad1213dec858aaf0b96ebae0ad6553828 Mon Sep 17 00:00:00 2001 From: wangzengliang Date: Fri, 24 Mar 2023 06:59:16 +0000 Subject: [PATCH 2/2] format userdel Signed-off-by: wangzengliang --- ceph.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceph.spec b/ceph.spec index 8df1975..fa48ca6 100644 --- a/ceph.spec +++ b/ceph.spec @@ -1560,7 +1560,7 @@ exit 0 %if ! 0%{?suse_version} %postun -n cephadm -[$1 -ne 0] || userdel cephadm || : +[ $1 -ne 0 ] || userdel cephadm || : %endif %files -n cephadm -- Gitee