From 06df85558987216855aad8eea9472b3a070f10f6 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 20 Jul 2023 09:16:09 +0200 Subject: [PATCH] drop patches applied upstream Signed-off-by: Thomas Lamprecht --- ...-python-dependencies-over-to-python3.patch | 137 ----------------- patches/0017-python3.10-pep-620.patch | 116 --------------- patches/0018-fix-lib-fmt-v9-compat.patch | 140 ------------------ ...efine-iterators-without-std-iterator.patch | 123 --------------- patches/series | 4 - 5 files changed, 520 deletions(-) delete mode 100644 patches/0013-d-control-move-python-dependencies-over-to-python3.patch delete mode 100644 patches/0017-python3.10-pep-620.patch delete mode 100644 patches/0018-fix-lib-fmt-v9-compat.patch delete mode 100644 patches/0019-define-iterators-without-std-iterator.patch diff --git a/patches/0013-d-control-move-python-dependencies-over-to-python3.patch b/patches/0013-d-control-move-python-dependencies-over-to-python3.patch deleted file mode 100644 index abf3f8324..000000000 --- a/patches/0013-d-control-move-python-dependencies-over-to-python3.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Thomas Lamprecht -Date: Tue, 2 Jun 2020 17:20:44 +0200 -Subject: [PATCH] d/control: move python dependencies over to python3 - -Signed-off-by: Thomas Lamprecht ---- - debian/control | 24 ++++++++++++------------ - debian/rules | 10 ------------ - 2 files changed, 12 insertions(+), 22 deletions(-) - -diff --git a/debian/control b/debian/control -index c93aa3c21..aa8edb3d2 100644 ---- a/debian/control -+++ b/debian/control -@@ -137,7 +137,7 @@ Depends: binutils, - parted, - psmisc, - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - ${shlibs:Depends}, - Recommends: btrfs-tools, - ceph-mds (= ${binary:Version}), -@@ -185,7 +185,7 @@ Package: cephadm - Architecture: linux-any - Recommends: podman (>= 2.0.2) | docker.io - Depends: lvm2, -- ${python:Depends}, -+ ${python3:Depends}, - Description: cephadm utility to bootstrap ceph daemons with systemd and containers - Ceph is a massively scalable, open-source, distributed - storage system that runs on commodity hardware and delivers object, -@@ -239,8 +239,9 @@ Depends: ceph-base (= ${binary:Version}), - python3-werkzeug, - libsqlite3-mod-ceph (= ${binary:Version}), - librados2 (= ${binary:Version}), -+ python3-yaml, - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - ${shlibs:Depends}, - Suggests: ceph-mgr-dashboard, - ceph-mgr-diskprediction-local, -@@ -267,7 +267,7 @@ Depends: ceph-mgr (= ${binary:Version}), - python3-werkzeug, - python3-routes, - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - ${shlibs:Depends}, - Description: dashboard module for ceph-mgr - Ceph is a massively scalable, open-source, distributed -@@ -288,7 +288,7 @@ Depends: ceph-mgr (= ${binary:Version}), - python3-scipy, - python3-sklearn, - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - ${shlibs:Depends}, - Description: diskprediction-local module for ceph-mgr - Ceph is a massively scalable, open-source, distributed -@@ -301,7 +301,7 @@ Description: diskprediction-local module for ceph-mgr - Package: ceph-mgr-modules-core - Architecture: all - Depends: ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - ${shlibs:Depends}, - python3-dateutil, - python3-openssl, -@@ -320,7 +320,7 @@ Depends: ceph-mgr (= ${binary:Version}), - Depends: ceph-mgr (= ${binary:Version}), - python3-jsonpatch - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - ${shlibs:Depends}, - Description: rook module for ceph-mgr - Ceph is a massively scalable, open-source, distributed -@@ -336,7 +336,7 @@ Architecture: all - Depends: ceph-mgr (= ${binary:Version}), - python3-kubernetes, - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - Description: kubernetes events module for ceph-mgr - Ceph is a massively scalable, open-source, distributed - storage system that runs on commodity hardware and delivers object, -@@ -351,7 +351,7 @@ Depends: ceph-mgr (= ${binary:Version}), - Depends: ceph-mgr (= ${binary:Version}), - cephadm, - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - openssh-client, - python3-jinja2, - python3-cherrypy3, -@@ -413,7 +413,7 @@ Depends: ceph-base (= ${binary:Version}), - Depends: ceph-base (= ${binary:Version}), - sudo, - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - ${shlibs:Depends}, - Replaces: ceph (<< 10), - ceph-test (<< 12.2.2-14), -@@ -646,7 +646,7 @@ Depends: librbd1 (= ${binary:Version}), - python3-rbd (= ${binary:Version}), - python3-rgw (= ${binary:Version}), - ${misc:Depends}, -- ${python:Depends}, -+ ${python3:Depends}, - ${shlibs:Depends}, - Conflicts: ceph-client-tools, - Replaces: ceph (<< 10), -diff --git a/debian/rules b/debian/rules -index c93aa3c21..aa8edb3d2 100755 ---- a/debian/rules -+++ b/debian/rules -@@ -141,16 +141,6 @@ - override_dh_shlibdeps: - dh_shlibdeps -a --exclude=erasure-code --exclude=rados-classes --exclude=compressor --exclude=ceph_crypto - --override_dh_python3: -- for binding in rados cephfs rbd rgw; do \ -- dh_python3 -p python3-$$binding; \ -- done -- dh_python3 -p python3-ceph-argparse -- dh_python3 -p python3-ceph-common -- dh_python3 -p cephfs-shell -- dh_python3 -p cephfs-top -- dh_python3 -p cephadm -- - # do not run tests - override_dh_auto_test: - diff --git a/patches/0017-python3.10-pep-620.patch b/patches/0017-python3.10-pep-620.patch deleted file mode 100644 index bfb2eabae..000000000 --- a/patches/0017-python3.10-pep-620.patch +++ /dev/null @@ -1,116 +0,0 @@ -Description: Fix Python 3.10 (PEP-620) incompatibility -Origin: upstream, https://github.com/boostorg/python/commit/500194edb7833d0627ce7a2595fec49d0aae2484 -Author: Stefan Seefeld -Last-Update: 2020-11-13 - ---- a/src/boost/boost/python/detail/wrap_python.hpp -+++ b/src/boost/boost/python/detail/wrap_python.hpp -@@ -227,7 +227,11 @@ - - # define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, -+#endif - -+#if PY_VERSION_HEX < 0x030900A4 -+# define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0) -+# define Py_SET_SIZE(obj, size) ((Py_SIZE(obj) = (size)), (void)0) - #endif - - ---- a/src/boost/boost/python/object/make_instance.hpp -+++ b/src/boost/boost/python/object/make_instance.hpp -@@ -47,7 +47,7 @@ - - // Note the position of the internally-stored Holder, - // for the sake of destruction -- Py_SIZE(instance) = offsetof(instance_t, storage); -+ Py_SET_SIZE(instance, offsetof(instance_t, storage)); - - // Release ownership of the python object - protect.cancel(); ---- a/src/boost/libs/python/src/object/class.cpp -+++ b/src/boost/libs/python/src/object/class.cpp -@@ -208,7 +208,7 @@ - { - if (static_data_object.tp_dict == 0) - { -- Py_TYPE(&static_data_object) = &PyType_Type; -+ Py_SET_TYPE(&static_data_object, &PyType_Type); - static_data_object.tp_base = &PyProperty_Type; - if (PyType_Ready(&static_data_object)) - return 0; -@@ -316,7 +316,7 @@ - { - if (class_metatype_object.tp_dict == 0) - { -- Py_TYPE(&class_metatype_object) = &PyType_Type; -+ Py_SET_TYPE(&class_metatype_object, &PyType_Type); - class_metatype_object.tp_base = &PyType_Type; - if (PyType_Ready(&class_metatype_object)) - return type_handle(); -@@ -374,12 +374,7 @@ - // like, so we'll store the total size of the object - // there. A negative number indicates that the extra - // instance memory is not yet allocated to any holders. --#if PY_VERSION_HEX >= 0x02060000 -- Py_SIZE(result) = --#else -- result->ob_size = --#endif -- -(static_cast(offsetof(instance<>,storage) + instance_size)); -+ Py_SET_SIZE(result,-static_cast(offsetof(instance<>,storage) + instance_size)); - } - return (PyObject*)result; - } -@@ -470,7 +465,7 @@ - { - if (class_type_object.tp_dict == 0) - { -- Py_TYPE(&class_type_object) = incref(class_metatype().get()); -+ Py_SET_TYPE(&class_type_object, incref(class_metatype().get())); - class_type_object.tp_base = &PyBaseObject_Type; - if (PyType_Ready(&class_type_object)) - return type_handle(); -@@ -739,7 +734,7 @@ - assert(holder_offset >= offsetof(objects::instance<>,storage)); - - // Record the fact that the storage is occupied, noting where it starts -- Py_SIZE(self) = holder_offset; -+ Py_SET_SIZE(self, holder_offset); - return (char*)self + holder_offset; - } - else ---- a/src/boost/libs/python/src/object/enum.cpp -+++ b/src/boost/libs/python/src/object/enum.cpp -@@ -153,7 +153,7 @@ - { - if (enum_type_object.tp_dict == 0) - { -- Py_TYPE(&enum_type_object) = incref(&PyType_Type); -+ Py_SET_TYPE(&enum_type_object, incref(&PyType_Type)); - #if PY_VERSION_HEX >= 0x03000000 - enum_type_object.tp_base = &PyLong_Type; - #else ---- a/src/boost/libs/python/src/object/function.cpp -+++ b/src/boost/libs/python/src/object/function.cpp -@@ -107,7 +107,7 @@ - PyObject* p = this; - if (Py_TYPE(&function_type) == 0) - { -- Py_TYPE(&function_type) = &PyType_Type; -+ Py_SET_TYPE(&function_type, &PyType_Type); - ::PyType_Ready(&function_type); - } - ---- a/src/boost/libs/python/src/object/life_support.cpp -+++ b/src/boost/libs/python/src/object/life_support.cpp -@@ -93,7 +93,7 @@ - - if (Py_TYPE(&life_support_type) == 0) - { -- Py_TYPE(&life_support_type) = &PyType_Type; -+ Py_SET_TYPE(&life_support_type, &PyType_Type); - PyType_Ready(&life_support_type); - } - - diff --git a/patches/0018-fix-lib-fmt-v9-compat.patch b/patches/0018-fix-lib-fmt-v9-compat.patch deleted file mode 100644 index f6ad365ba..000000000 --- a/patches/0018-fix-lib-fmt-v9-compat.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Thomas Lamprecht -Date: Wed, 3 May 2023 10:36:10 +0200 -Subject: [PATCH] try to fix lib fmt v9 compat - -Signed-off-by: Thomas Lamprecht ---- - ceph/debian/rules | 2 ++ - src/common/Journald.cc | 1 + - src/common/LogEntry.h | 18 ++++++++++++++++++ - src/osd/osd_types_fmt.h | 14 +++++++------- - 4 files changed, 28 insertions(+), 7 deletions(-) - -diff --git a/debian/rules b/debian/rules -index 9f49deabb..c4eeebaee 100755 ---- a/debian/rules -+++ b/debian/rules -@@ -52,6 +52,8 @@ ifneq (,$(filter with_system_libs,$(DEB_BUILD_OPTIONS))) - extraopts += -DWITH_SYSTEM_PMDK=ON - endif - -+export DEB_CXXFLAGS_MAINT_APPEND += -DFMT_DEPRECATED_OSTREAM -+ - %: - dh $@ --buildsystem=cmake --with javahelper,python3,systemd --parallel - -diff --git a/src/common/Journald.cc b/src/common/Journald.cc -index e3ae2d358..a1321c7ee 100644 ---- a/src/common/Journald.cc -+++ b/src/common/Journald.cc -@@ -21,6 +21,7 @@ - #include "common/LogEntry.h" - #include "log/Entry.h" - #include "log/SubsystemMap.h" -+#include "msg/msg_fmt.h" - - - namespace ceph::logging { -diff --git a/src/common/LogEntry.h b/src/common/LogEntry.h -index 124a20799..3ddebbd30 100644 ---- a/src/common/LogEntry.h -+++ b/src/common/LogEntry.h -@@ -15,7 +15,10 @@ - #ifndef CEPH_LOGENTRY_H - #define CEPH_LOGENTRY_H - -+#include -+ - #include "include/utime.h" -+#include "msg/msg_fmt.h" - #include "msg/msg_types.h" - #include "common/entity_name.h" - #include "ostream_temp.h" -@@ -191,4 +194,19 @@ inline std::ostream& operator<<(std::ostream& out, const LogEntry& e) - << e.channel << " " << e.prio << " " << e.msg; - } - -+template <> struct fmt::formatter : fmt::formatter { -+ template -+ auto format(const EntityName& e, FormatContext& ctx) { -+ return formatter::format(e.to_str(), ctx); -+ } -+}; -+ -+template <> struct fmt::formatter : fmt::formatter { -+ template -+ auto format(const LogEntry& e, FormatContext& ctx) { -+ return fmt::format_to(ctx.out(), "{} {} ({}) {} : {} {} {}", -+ e.stamp, e.name, e.rank, e.seq, e.channel, e.prio, e.msg); -+ } -+}; -+ - #endif -diff --git a/src/osd/osd_types_fmt.h b/src/osd/osd_types_fmt.h -index 23c0e8a3b..a3c9eb61c 100644 ---- a/src/osd/osd_types_fmt.h -+++ b/src/osd/osd_types_fmt.h -@@ -13,7 +13,7 @@ struct fmt::formatter { - constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } - - template -- auto format(const osd_reqid_t& req_id, FormatContext& ctx) -+ auto format(const osd_reqid_t& req_id, FormatContext& ctx) const - { - return fmt::format_to(ctx.out(), "{}.{}:{}", req_id.name, req_id.inc, - req_id.tid); -@@ -25,7 +25,7 @@ struct fmt::formatter { - constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } - - template -- auto format(const pg_shard_t& shrd, FormatContext& ctx) -+ auto format(const pg_shard_t& shrd, FormatContext& ctx) const - { - if (shrd.is_undefined()) { - return fmt::format_to(ctx.out(), "?"); -@@ -42,7 +42,7 @@ struct fmt::formatter { - constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } - - template -- auto format(const eversion_t& ev, FormatContext& ctx) -+ auto format(const eversion_t& ev, FormatContext& ctx) const - { - return fmt::format_to(ctx.out(), "{}'{}", ev.epoch, ev.version); - } -@@ -53,7 +53,7 @@ struct fmt::formatter { - constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } - - template -- auto format(const chunk_info_t& ci, FormatContext& ctx) -+ auto format(const chunk_info_t& ci, FormatContext& ctx) const - { - return fmt::format_to(ctx.out(), "(len: {} oid: {} offset: {} flags: {})", - ci.length, ci.oid, ci.offset, -@@ -66,7 +66,7 @@ struct fmt::formatter { - constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } - - template -- auto format(const object_manifest_t& om, FormatContext& ctx) -+ auto format(const object_manifest_t& om, FormatContext& ctx) const - { - fmt::format_to(ctx.out(), "manifest({}", om.get_type_name()); - if (om.is_redirect()) { -@@ -83,7 +83,7 @@ struct fmt::formatter { - constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } - - template -- auto format(const object_info_t& oi, FormatContext& ctx) -+ auto format(const object_info_t& oi, FormatContext& ctx) const - { - fmt::format_to(ctx.out(), "{}({} {} {} s {} uv {}", oi.soid, oi.version, - oi.last_reqid, (oi.flags ? oi.get_flag_string() : ""), oi.size, -@@ -110,7 +110,7 @@ struct fmt::formatter { - constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } - - template -- auto format(const pg_t& pg, FormatContext& ctx) -+ auto format(const pg_t& pg, FormatContext& ctx) const - { - return fmt::format_to(ctx.out(), "{}.{:x}", pg.pool(), pg.m_seed); - } diff --git a/patches/0019-define-iterators-without-std-iterator.patch b/patches/0019-define-iterators-without-std-iterator.patch deleted file mode 100644 index 1a8b2cc9f..000000000 --- a/patches/0019-define-iterators-without-std-iterator.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Thomas Lamprecht -Date: Wed, 3 May 2023 13:25:08 +0200 -Subject: [PATCH] define iterators without std::iterator<> - -> std::iterator<> is deprecated in C++17, so let's just -> define the required traits directly. - -cherry-picked/backported from upstream PRs: -https://github.com/ceph/ceph/pull/45419/commits -https://github.com/ceph/ceph/pull/45198/commits - -Signed-off-by: Thomas Lamprecht ---- - .../btree/string_kv_node_layout.h | 27 +++++++++++-------- - src/include/rados/librados.hpp | 7 ++++- - src/include/xlist.h | 15 +++++++++-- - 3 files changed, 35 insertions(+), 14 deletions(-) - -diff --git a/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h b/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h -index 9948a4292..1bd95415a 100644 ---- a/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h -+++ b/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h -@@ -294,7 +294,7 @@ class StringKVInnerNodeLayout { - friend class delta_inner_t; - public: - template -- class iter_t : public std::iterator { -+ class iter_t { - friend class StringKVInnerNodeLayout; - - template -@@ -312,17 +312,22 @@ public: - uint16_t index) : node(parent), index(index) {} - - public: -- iter_t(const iter_t &) = default; -- iter_t(iter_t &&) = default; -- iter_t &operator=(const iter_t &) = default; -- iter_t &operator=(iter_t &&) = default; -- -- operator iter_t() const { -- static_assert(!is_const); -- return iter_t(node, index); -- } -- -+ using iterator_category = std::input_iterator_tag; -+ using value_type = StringKVInnerNodeLayout; -+ using difference_type = std::ptrdiff_t; -+ using pointer = StringKVInnerNodeLayout*; - using reference = iter_t&; -+ -+ iter_t(const iter_t &) = default; -+ iter_t(iter_t &&) = default; -+ iter_t &operator=(const iter_t &) = default; -+ iter_t &operator=(iter_t &&) = default; -+ -+ operator iter_t() const { -+ static_assert(!is_const); -+ return iter_t(node, index); -+ } -+ - iter_t &operator*() { return *this; } - iter_t *operator->() { return this; } - -diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp -index b40d7bf9a..712a5da82 100644 ---- a/src/include/rados/librados.hpp -+++ b/src/include/rados/librados.hpp -@@ -104,8 +104,13 @@ inline namespace v14_2_0 { - }; - CEPH_RADOS_API std::ostream& operator<<(std::ostream& os, const librados::ObjectCursor& oc); - -- class CEPH_RADOS_API NObjectIterator : public std::iterator { -+ class CEPH_RADOS_API NObjectIterator { - public: -+ using iterator_category = std::forward_iterator_tag; -+ using value_type = ListObject; -+ using difference_type = std::ptrdiff_t; -+ using pointer = ListObject*; -+ using reference = ListObject&; - static const NObjectIterator __EndObjectIterator; - NObjectIterator(): impl(NULL) {} - ~NObjectIterator(); -diff --git a/src/include/xlist.h b/src/include/xlist.h -index 733a318a9..73e6d8d53 100644 ---- a/src/include/xlist.h -+++ b/src/include/xlist.h -@@ -159,10 +159,15 @@ public: - remove(_back); - } - -- class iterator: std::iterator { -+ class iterator { - private: - item *cur; - public: -+ using iterator_category = std::forward_iterator_tag; -+ using value_type = T; -+ using difference_type = std::ptrdiff_t; -+ using pointer = T*; -+ using reference = T&; - iterator(item *i = 0) : cur(i) {} - T operator*() { return static_cast(cur->_item); } - iterator& operator++() { -@@ -183,10 +188,16 @@ public: - iterator begin() { return iterator(_front); } - iterator end() { return iterator(NULL); } - -- class const_iterator: std::iterator { -+ class const_iterator { - private: - item *cur; - public: -+ using iterator_category = std::forward_iterator_tag; -+ using value_type = T; -+ using difference_type = std::ptrdiff_t; -+ using pointer = const T*; -+ using reference = const T&; -+ - const_iterator(item *i = 0) : cur(i) {} - const T operator*() { return static_cast(cur->_item); } - const_iterator& operator++() { diff --git a/patches/series b/patches/series index 56208f843..86fa818ab 100644 --- a/patches/series +++ b/patches/series @@ -6,11 +6,7 @@ 0010-remove-legacy-init.d-ceph-script.patch 0011-only-suggest-mgr-plugins.patch 0012-Remove-failing-actions-from-prerm.patch -0013-d-control-move-python-dependencies-over-to-python3.patch 0014-fix-service-ordering-avoid-Before-remote-fs-pre.targ.patch 0015-d-control-drop-outdated-build-dependencies-and-bump-.patch 0016-d-rules-fix-no-restart-on-upgrade.patch -0017-python3.10-pep-620.patch -0018-fix-lib-fmt-v9-compat.patch -0019-define-iterators-without-std-iterator.patch 0020-fix-4759-run-ceph-crash-daemon-with-www-data-group-f.patch