From 3e1ee1fda758885c17be7d4d45f514d370b1b92b Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Thu, 9 Nov 2023 05:11:44 +0000 Subject: ceph: initial update to 18.2.0 The ability to detected our python is fixed, but we are now failing in the compilation phase on some of the applications. Signed-off-by: Bruce Ashfield --- ...ppyCompressor.h-fix-snappy-compiler-error.patch | 30 --- ...dd-missing-header-file-due-to-gcc-upgrade.patch | 30 --- ...1-ceph-fix-build-errors-for-cross-compile.patch | 143 +++++++------- .../0001-cmake-add-support-for-python3.11.patch | 15 +- ...build-with-GCC-13-missing-cstdint-include.patch | 41 ---- .../0001-fix-host-library-paths-were-used.patch | 59 +++--- ...0001-kv-rocksdb_cache-drop-ROCKSDB_PRIszt.patch | 51 ----- ...-FTBFS-due-to-dout-need_dynamic-on-GCC-12.patch | 42 ----- ...ace-BitVector-NoInitAllocator-with-wrappe.patch | 101 ---------- ...cache-reorder-ShardedCache-methods-declar.patch | 70 ------- ...cache-define-DeleterFn-function-pointer-t.patch | 101 ---------- .../ceph/0003-librdb-fix-build-with-gcc-13.patch | 30 --- ...cache-implement-methods-required-by-rocks.patch | 207 --------------------- .../0005-kv-rocksdb_cache-mark-Shard-const.patch | 32 ---- recipes-extended/ceph/ceph/CVE-2021-3979.patch | 158 ---------------- recipes-extended/ceph/ceph_15.2.15.bb | 157 ---------------- recipes-extended/ceph/ceph_18.2.0.bb | 172 +++++++++++++++++ 17 files changed, 280 insertions(+), 1159 deletions(-) delete mode 100644 recipes-extended/ceph/ceph/0001-SnappyCompressor.h-fix-snappy-compiler-error.patch delete mode 100644 recipes-extended/ceph/ceph/0001-buffer.h-add-missing-header-file-due-to-gcc-upgrade.patch delete mode 100644 recipes-extended/ceph/ceph/0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch delete mode 100644 recipes-extended/ceph/ceph/0001-kv-rocksdb_cache-drop-ROCKSDB_PRIszt.patch delete mode 100644 recipes-extended/ceph/ceph/0002-common-fix-FTBFS-due-to-dout-need_dynamic-on-GCC-12.patch delete mode 100644 recipes-extended/ceph/ceph/0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch delete mode 100644 recipes-extended/ceph/ceph/0002-kv-rocksdb_cache-reorder-ShardedCache-methods-declar.patch delete mode 100644 recipes-extended/ceph/ceph/0003-kv-rocksdb_cache-define-DeleterFn-function-pointer-t.patch delete mode 100644 recipes-extended/ceph/ceph/0003-librdb-fix-build-with-gcc-13.patch delete mode 100644 recipes-extended/ceph/ceph/0004-kv-rocksdb_cache-implement-methods-required-by-rocks.patch delete mode 100644 recipes-extended/ceph/ceph/0005-kv-rocksdb_cache-mark-Shard-const.patch delete mode 100644 recipes-extended/ceph/ceph/CVE-2021-3979.patch delete mode 100644 recipes-extended/ceph/ceph_15.2.15.bb create mode 100644 recipes-extended/ceph/ceph_18.2.0.bb diff --git a/recipes-extended/ceph/ceph/0001-SnappyCompressor.h-fix-snappy-compiler-error.patch b/recipes-extended/ceph/ceph/0001-SnappyCompressor.h-fix-snappy-compiler-error.patch deleted file mode 100644 index 2ebd32d1..00000000 --- a/recipes-extended/ceph/ceph/0001-SnappyCompressor.h-fix-snappy-compiler-error.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 85bde55627cfbb35d8b4735dec32bf33fa30079f Mon Sep 17 00:00:00 2001 -From: Saul Wold -Date: Fri, 28 May 2021 10:16:07 -0700 -Subject: [PATCH] SnappyCompressor.h: fix snappy compiler error - -snappy quietly changed public type - -Known issue in ceph: https://tracker.ceph.com/issues/50934 - -Upstream-Status: Pending - -Signed-off-by: Saul Wold - ---- - src/compressor/snappy/SnappyCompressor.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/compressor/snappy/SnappyCompressor.h b/src/compressor/snappy/SnappyCompressor.h -index 0cfb819c..2fbe35b7 100644 ---- a/src/compressor/snappy/SnappyCompressor.h -+++ b/src/compressor/snappy/SnappyCompressor.h -@@ -96,7 +96,7 @@ class SnappyCompressor : public Compressor { - if (qat_enabled) - return qat_accel.decompress(p, compressed_len, dst); - #endif -- snappy::uint32 res_len = 0; -+ uint32_t res_len = 0; - BufferlistSource source_1(p, compressed_len); - if (!snappy::GetUncompressedLength(&source_1, &res_len)) { - return -1; diff --git a/recipes-extended/ceph/ceph/0001-buffer.h-add-missing-header-file-due-to-gcc-upgrade.patch b/recipes-extended/ceph/ceph/0001-buffer.h-add-missing-header-file-due-to-gcc-upgrade.patch deleted file mode 100644 index 70d3eb94..00000000 --- a/recipes-extended/ceph/ceph/0001-buffer.h-add-missing-header-file-due-to-gcc-upgrade.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 496465d9238109a93612e28682273e5bf576823b Mon Sep 17 00:00:00 2001 -From: Chen Qi -Date: Sun, 22 May 2022 19:40:59 -0700 -Subject: [PATCH 1/2] buffer.h: add missing header file due to gcc upgrade - -The header file have been changed to be no longer included by other -heades, thus requiring explicit include. See https://gcc.gnu.org/gcc-12/porting_to.html - -Upstream-Status: Pending - -Signed-off-by: Chen Qi ---- - src/include/buffer.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/include/buffer.h b/src/include/buffer.h -index 5c8b427d..88845ee6 100644 ---- a/src/include/buffer.h -+++ b/src/include/buffer.h -@@ -43,6 +43,7 @@ - #include - #include - #include -+#include - #if __cplusplus >= 201703L - #include - #endif // __cplusplus >= 201703L --- -2.36.0 - diff --git a/recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch b/recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch index 4d54549f..9686becb 100644 --- a/recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch +++ b/recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch @@ -24,11 +24,11 @@ Signed-off-by: Sakib Sajal src/pybind/rgw/setup.py | 8 -------- 7 files changed, 8 insertions(+), 55 deletions(-) -diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake -index 5fe929499d..802eb37e32 100644 ---- a/cmake/modules/Distutils.cmake -+++ b/cmake/modules/Distutils.cmake -@@ -18,17 +18,8 @@ function(distutils_install_module name) +Index: ceph-18.2.0/cmake/modules/Distutils.cmake +=================================================================== +--- ceph-18.2.0.orig/cmake/modules/Distutils.cmake ++++ ceph-18.2.0/cmake/modules/Distutils.cmake +@@ -29,17 +29,10 @@ cmake_parse_arguments(DU "" "INSTALL_SCRIPT" "" ${ARGN}) install(CODE " set(options --prefix=${CMAKE_INSTALL_PREFIX}) @@ -39,25 +39,25 @@ index 5fe929499d..802eb37e32 100644 - list(APPEND options - --root=\$ENV{DESTDIR} - --single-version-externally-managed) -- if(NOT \"${DU_INSTALL_SCRIPT}\" STREQUAL \"\") -- list(APPEND options --install-script=${DU_INSTALL_SCRIPT}) -- endif() +- endif() + if(NOT \"${DU_INSTALL_SCRIPT}\" STREQUAL \"\") + list(APPEND options --install-script=${DU_INSTALL_SCRIPT}) - endif() + list(APPEND options --root=${CMAKE_DESTDIR}) + list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR}) execute_process( COMMAND ${Python3_EXECUTABLE} setup.py install \${options} -@@ -50,7 +41,7 @@ function(distutils_add_cython_module target name src) - # Note: no quotes, otherwise distutils will execute "/usr/bin/ccache gcc" - # CMake's implicit conversion between strings and lists is wonderful, isn't it? - string(REPLACE " " ";" cflags ${CMAKE_C_FLAGS}) -- list(APPEND cflags -iquote${CMAKE_SOURCE_DIR}/src/include -w) -+ list(APPEND cflags -iquote${CMAKE_SOURCE_DIR}/src/include -w --sysroot=${CMAKE_SYSROOT}) +@@ -65,7 +58,7 @@ + if(DU_DISABLE_VTA AND HAS_VTA) + list(APPEND PY_CFLAGS -fno-var-tracking-assignments) + endif() +- list(APPEND PY_CPPFLAGS -iquote${CMAKE_SOURCE_DIR}/src/include -w) ++ list(APPEND PY_CPPFLAGS -iquote${CMAKE_SOURCE_DIR}/src/include -w --sysroot=${CMAKE_SYSROOT}) # This little bit of magic wipes out __Pyx_check_single_interpreter() # Note: this is reproduced in distutils_install_cython_module - list(APPEND cflags -D'void0=dead_function\(void\)') -@@ -108,14 +99,8 @@ function(distutils_install_cython_module name) + list(APPEND PY_CPPFLAGS -D'void0=dead_function\(void\)') +@@ -135,14 +128,8 @@ set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\") set(options --prefix=${CMAKE_INSTALL_PREFIX}) @@ -74,10 +74,10 @@ index 5fe929499d..802eb37e32 100644 execute_process( COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py -diff --git a/cmake/modules/FindRocksDB.cmake b/cmake/modules/FindRocksDB.cmake -index c5dd3dfaf6..be38597af2 100644 ---- a/cmake/modules/FindRocksDB.cmake -+++ b/cmake/modules/FindRocksDB.cmake +Index: ceph-18.2.0/cmake/modules/FindRocksDB.cmake +=================================================================== +--- ceph-18.2.0.orig/cmake/modules/FindRocksDB.cmake ++++ ceph-18.2.0/cmake/modules/FindRocksDB.cmake @@ -9,9 +9,9 @@ # ROCKSDB_VERSION_MINOR # ROCKSDB_VERSION_PATCH @@ -90,95 +90,100 @@ index c5dd3dfaf6..be38597af2 100644 if(ROCKSDB_INCLUDE_DIR AND EXISTS "${ROCKSDB_INCLUDE_DIR}/rocksdb/version.h") foreach(ver "MAJOR" "MINOR" "PATCH") -diff --git a/src/compressor/zstd/CMakeLists.txt b/src/compressor/zstd/CMakeLists.txt -index a5ebdaf538..a234068150 100644 ---- a/src/compressor/zstd/CMakeLists.txt -+++ b/src/compressor/zstd/CMakeLists.txt -@@ -9,7 +9,7 @@ ExternalProject_Add(zstd_ext - CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_C_FLAGS=${ZSTD_C_FLAGS} -- -DCMAKE_AR=${CMAKE_AR} -+ -DCMAKE_SYSROOT=${CMAKE_SYSROOT} - -DCMAKE_POSITION_INDEPENDENT_CODE=${ENABLE_SHARED} - -G${CMAKE_GENERATOR} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzstd -diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py -index 19ae6c329a..c9a25ccfff 100755 ---- a/src/pybind/cephfs/setup.py -+++ b/src/pybind/cephfs/setup.py -@@ -135,14 +135,6 @@ def check_sanity(): +Index: ceph-18.2.0/src/pybind/cephfs/setup.py +=================================================================== +--- ceph-18.2.0.orig/src/pybind/cephfs/setup.py ++++ ceph-18.2.0/src/pybind/cephfs/setup.py +@@ -135,20 +135,6 @@ finally: shutil.rmtree(tmp_dir) - --if 'BUILD_DOC' in os.environ.keys(): -- pass +-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ: +- ext_args = {} +- cython_constants = dict(BUILD_DOC=True) +- cythonize_args = dict(compile_time_env=cython_constants) -elif check_sanity(): -- pass +- ext_args = get_python_flags(['cephfs']) +- cython_constants = dict(BUILD_DOC=False) +- include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")] +- cythonize_args = dict(compile_time_env=cython_constants, +- include_path=include_path) -else: - sys.exit(1) - cmdclass = {} try: from Cython.Build import cythonize -diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py -index e2c5696404..4e99d26721 100755 ---- a/src/pybind/rados/setup.py -+++ b/src/pybind/rados/setup.py -@@ -134,14 +134,6 @@ def check_sanity(): +Index: ceph-18.2.0/src/pybind/rados/setup.py +=================================================================== +--- ceph-18.2.0.orig/src/pybind/rados/setup.py ++++ ceph-18.2.0/src/pybind/rados/setup.py +@@ -130,17 +130,6 @@ finally: shutil.rmtree(tmp_dir) - --if 'BUILD_DOC' in os.environ.keys(): -- pass +-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ: +- ext_args = {} +- cython_constants = dict(BUILD_DOC=True) -elif check_sanity(): -- pass +- ext_args = get_python_flags(['rados']) +- cython_constants = dict(BUILD_DOC=False) -else: - sys.exit(1) - - cmdclass = {} +-cmdclass = {} try: from Cython.Build import cythonize -diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py -index 634484f140..f5bbbdab4f 100755 ---- a/src/pybind/rbd/setup.py -+++ b/src/pybind/rbd/setup.py -@@ -133,14 +133,6 @@ def check_sanity(): + from Cython.Distutils import build_ext +Index: ceph-18.2.0/src/pybind/rbd/setup.py +=================================================================== +--- ceph-18.2.0.orig/src/pybind/rbd/setup.py ++++ ceph-18.2.0/src/pybind/rbd/setup.py +@@ -133,20 +133,6 @@ finally: shutil.rmtree(tmp_dir) - --if 'BUILD_DOC' in os.environ.keys(): -- pass +-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ: +- ext_args = {} +- cython_constants = dict(BUILD_DOC=True) +- cythonize_args = dict(compile_time_env=cython_constants) -elif check_sanity(): -- pass +- ext_args = get_python_flags(['rados', 'rbd']) +- cython_constants = dict(BUILD_DOC=False) +- include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")] +- cythonize_args = dict(compile_time_env=cython_constants, +- include_path=include_path) -else: - sys.exit(1) - cmdclass = {} try: from Cython.Build import cythonize -diff --git a/src/pybind/rgw/setup.py b/src/pybind/rgw/setup.py -index eb1591a460..b9f2428cf9 100755 ---- a/src/pybind/rgw/setup.py -+++ b/src/pybind/rgw/setup.py -@@ -134,14 +134,6 @@ def check_sanity(): +Index: ceph-18.2.0/src/pybind/rgw/setup.py +=================================================================== +--- ceph-18.2.0.orig/src/pybind/rgw/setup.py ++++ ceph-18.2.0/src/pybind/rgw/setup.py +@@ -134,20 +134,6 @@ finally: shutil.rmtree(tmp_dir) - --if 'BUILD_DOC' in os.environ.keys(): -- pass +-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ: +- ext_args = {} +- cython_constants = dict(BUILD_DOC=True) +- cythonize_args = dict(compile_time_env=cython_constants) -elif check_sanity(): -- pass +- ext_args = get_python_flags(['rados', 'rgw']) +- cython_constants = dict(BUILD_DOC=False) +- include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")] +- cythonize_args = dict(compile_time_env=cython_constants, +- include_path=include_path) -else: - sys.exit(1) - cmdclass = {} try: from Cython.Build import cythonize --- -2.20.1 - diff --git a/recipes-extended/ceph/ceph/0001-cmake-add-support-for-python3.11.patch b/recipes-extended/ceph/ceph/0001-cmake-add-support-for-python3.11.patch index c0b718a2..c72c91b2 100644 --- a/recipes-extended/ceph/ceph/0001-cmake-add-support-for-python3.11.patch +++ b/recipes-extended/ceph/ceph/0001-cmake-add-support-for-python3.11.patch @@ -16,19 +16,16 @@ Signed-off-by: Kai Kang cmake/modules/FindPython/Support.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/cmake/modules/FindPython/Support.cmake b/cmake/modules/FindPython/Support.cmake -index 6584699b79..c05bbe3306 100644 ---- a/cmake/modules/FindPython/Support.cmake -+++ b/cmake/modules/FindPython/Support.cmake -@@ -17,7 +17,7 @@ if (NOT DEFINED _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR) +Index: ceph-18.2.0/cmake/modules/FindPython/Support.cmake +=================================================================== +--- ceph-18.2.0.orig/cmake/modules/FindPython/Support.cmake ++++ ceph-18.2.0/cmake/modules/FindPython/Support.cmake +@@ -17,7 +17,7 @@ message (FATAL_ERROR "FindPython: INTERNAL ERROR") endif() if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 3) -- set(_${_PYTHON_PREFIX}_VERSIONS 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) +- set(_${_PYTHON_PREFIX}_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) + set(_${_PYTHON_PREFIX}_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) elseif (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 2) set(_${_PYTHON_PREFIX}_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) else() --- -2.18.2 - diff --git a/recipes-extended/ceph/ceph/0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch b/recipes-extended/ceph/ceph/0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch deleted file mode 100644 index b6ba82b6..00000000 --- a/recipes-extended/ceph/ceph/0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 59e6b44f7ed4020a860e347322acfdacc6e4560b Mon Sep 17 00:00:00 2001 -From: Sam James -Date: Fri, 28 Oct 2022 16:47:38 +0100 -Subject: [PATCH] common: fix build with GCC 13 (missing include) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Needed for uint8_t. Only worked by chance before (see -https://www.gnu.org/software/gcc/gcc-13/porting_to.html). - -``` -FAILED: src/CMakeFiles/common-objs.dir/mds/FSMapUser.cc.o -/usr/bin/x86_64-pc-linux-gnu-g++ -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D__CEPH__ -D__STDC_FORMAT_MACROS -D__linux__ -I/var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5_build/src/include -I/var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src -isystem /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5_build/include -isystem /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/xxHash -isystem /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/rapidjson/include -O2 -march=native -pipe -fPIC -U_FORTIFY_SOURCE -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wpessimizing-move -Wredundant-move -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -fstack-protector-strong -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -std=c++17 -MD -MT src/CMakeFiles/common-objs.dir/mds/FSMapUser.cc.o -MF src/CMakeFiles/common-objs.dir/mds/FSMapUser.cc.o.d -o src/CMakeFiles/common-objs.dir/mds/FSMapUser.cc.o -c /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/mds/FSMapUser.cc -In file included from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/log/SubsystemMap.h:12, - from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/common/config.h:23, - from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/mds/mdstypes.h:13, - from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/mds/FSMapUser.h:21, - from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/mds/FSMapUser.cc:1: -/var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/common/subsys_types.h:56:23: error: ‘uint8_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’? -``` - -Bug: https://bugs.gentoo.org/878531 -Signed-off-by: Sam James -Upstream-Status: Backport [https://github.com/ceph/ceph/commit/74794f9d6f5c6671438085bdba730b504901a7c0] ---- - src/common/subsys_types.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/common/subsys_types.h b/src/common/subsys_types.h -index 52171809..bd7cc439 100644 ---- a/src/common/subsys_types.h -+++ b/src/common/subsys_types.h -@@ -17,6 +17,7 @@ - - #include - #include -+#include - - enum ceph_subsys_id_t { - ceph_subsys_, // default diff --git a/recipes-extended/ceph/ceph/0001-fix-host-library-paths-were-used.patch b/recipes-extended/ceph/ceph/0001-fix-host-library-paths-were-used.patch index 310bfa47..24fd0409 100644 --- a/recipes-extended/ceph/ceph/0001-fix-host-library-paths-were-used.patch +++ b/recipes-extended/ceph/ceph/0001-fix-host-library-paths-were-used.patch @@ -15,12 +15,12 @@ Signed-off-by: Hongxu Jia src/pybind/rgw/setup.py | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) -diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py -index c9a25ccf..972f936c 100755 ---- a/src/pybind/cephfs/setup.py -+++ b/src/pybind/cephfs/setup.py -@@ -63,9 +63,13 @@ def get_python_flags(libs): - distutils.sysconfig.get_config_vars('LIBS', 'SYSLIBS')), []) +Index: ceph-18.2.0/src/pybind/cephfs/setup.py +=================================================================== +--- ceph-18.2.0.orig/src/pybind/cephfs/setup.py ++++ ceph-18.2.0/src/pybind/cephfs/setup.py +@@ -63,9 +63,13 @@ + filter(lambda lib: lib.startswith('-l'), py_libs)] compiler = new_compiler() distutils.sysconfig.customize_compiler(compiler) + libpl = distutils.sysconfig.get_config_var('LIBPL') @@ -31,15 +31,15 @@ index c9a25ccf..972f936c 100755 include_dirs=[distutils.sysconfig.get_python_inc()], - library_dirs=distutils.sysconfig.get_config_vars('LIBDIR', 'LIBPL'), + library_dirs=[distutils.sysconfig.get_config_var('LIBDIR'), libpl], - libraries=libs + [lib.replace('-l', '') for lib in py_libs], + libraries=libs + py_libs, extra_compile_args=filter_unsupported_flags( compiler.compiler[0], -diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py -index 4e99d267..de24f766 100755 ---- a/src/pybind/rados/setup.py -+++ b/src/pybind/rados/setup.py -@@ -66,9 +66,13 @@ def get_python_flags(libs): - distutils.sysconfig.get_config_vars('LIBS', 'SYSLIBS')), []) +Index: ceph-18.2.0/src/pybind/rados/setup.py +=================================================================== +--- ceph-18.2.0.orig/src/pybind/rados/setup.py ++++ ceph-18.2.0/src/pybind/rados/setup.py +@@ -62,9 +62,13 @@ + filter(lambda lib: lib.startswith('-l'), py_libs)] compiler = new_compiler() distutils.sysconfig.customize_compiler(compiler) + libpl = distutils.sysconfig.get_config_var('LIBPL') @@ -50,15 +50,15 @@ index 4e99d267..de24f766 100755 include_dirs=[distutils.sysconfig.get_python_inc()], - library_dirs=distutils.sysconfig.get_config_vars('LIBDIR', 'LIBPL'), + library_dirs=[distutils.sysconfig.get_config_var('LIBDIR'), libpl], - libraries=libs + [lib.replace('-l', '') for lib in py_libs], + libraries=libs + py_libs, extra_compile_args=filter_unsupported_flags( compiler.compiler[0], -diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py -index f5bbbdab..a1f70e1d 100755 ---- a/src/pybind/rbd/setup.py -+++ b/src/pybind/rbd/setup.py -@@ -63,9 +63,13 @@ def get_python_flags(libs): - distutils.sysconfig.get_config_vars('LIBS', 'SYSLIBS')), []) +Index: ceph-18.2.0/src/pybind/rbd/setup.py +=================================================================== +--- ceph-18.2.0.orig/src/pybind/rbd/setup.py ++++ ceph-18.2.0/src/pybind/rbd/setup.py +@@ -63,9 +63,13 @@ + filter(lambda lib: lib.startswith('-l'), py_libs)] compiler = new_compiler() distutils.sysconfig.customize_compiler(compiler) + libpl = distutils.sysconfig.get_config_var('LIBPL') @@ -69,15 +69,15 @@ index f5bbbdab..a1f70e1d 100755 include_dirs=[distutils.sysconfig.get_python_inc()], - library_dirs=distutils.sysconfig.get_config_vars('LIBDIR', 'LIBPL'), + library_dirs=[distutils.sysconfig.get_config_var('LIBDIR'), libpl], - libraries=libs + [lib.replace('-l', '') for lib in py_libs], + libraries=libs + py_libs, extra_compile_args=filter_unsupported_flags( compiler.compiler[0], -diff --git a/src/pybind/rgw/setup.py b/src/pybind/rgw/setup.py -index b9f2428c..f5119f73 100755 ---- a/src/pybind/rgw/setup.py -+++ b/src/pybind/rgw/setup.py -@@ -64,9 +64,13 @@ def get_python_flags(libs): - distutils.sysconfig.get_config_vars('LIBS', 'SYSLIBS')), []) +Index: ceph-18.2.0/src/pybind/rgw/setup.py +=================================================================== +--- ceph-18.2.0.orig/src/pybind/rgw/setup.py ++++ ceph-18.2.0/src/pybind/rgw/setup.py +@@ -64,9 +64,13 @@ + filter(lambda lib: lib.startswith('-l'), py_libs)] compiler = new_compiler() distutils.sysconfig.customize_compiler(compiler) + libpl = distutils.sysconfig.get_config_var('LIBPL') @@ -88,9 +88,6 @@ index b9f2428c..f5119f73 100755 include_dirs=[distutils.sysconfig.get_python_inc()], - library_dirs=distutils.sysconfig.get_config_vars('LIBDIR', 'LIBPL'), + library_dirs=[distutils.sysconfig.get_config_var('LIBDIR'), libpl], - libraries=libs + [lib.replace('-l', '') for lib in py_libs], + libraries=libs + py_libs, extra_compile_args=filter_unsupported_flags( compiler.compiler[0], --- -2.21.0 - diff --git a/recipes-extended/ceph/ceph/0001-kv-rocksdb_cache-drop-ROCKSDB_PRIszt.patch b/recipes-extended/ceph/ceph/0001-kv-rocksdb_cache-drop-ROCKSDB_PRIszt.patch deleted file mode 100644 index 795c60fc..00000000 --- a/recipes-extended/ceph/ceph/0001-kv-rocksdb_cache-drop-ROCKSDB_PRIszt.patch +++ /dev/null @@ -1,51 +0,0 @@ -From b7b58010fd10b95c681df78cc4322e6586a39099 Mon Sep 17 00:00:00 2001 -From: Kefu Chai -Date: Tue, 17 Aug 2021 15:20:24 +0800 -Subject: [PATCH 1/6] kv/rocksdb_cache: drop ROCKSDB_PRIszt - -ROCKSDB_PRIszt is a macro for "zu", which is in turn use for printing an -(unsigned) size_t variable. - -there is no point having it in the header file or define a macro for it, -as %zu is standard compliant, and we don't get any advantage by using a -macro for it. - -Signed-off-by: Kefu Chai - -Upstream-Status: Backport [44f5b827eb3c65665373a86908bf5d47e7d02687] - -Signed-off-by: Sakib Sajal - ---- - src/kv/rocksdb_cache/ShardedCache.cc | 2 +- - src/kv/rocksdb_cache/ShardedCache.h | 1 - - 2 files changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/kv/rocksdb_cache/ShardedCache.cc b/src/kv/rocksdb_cache/ShardedCache.cc -index 367140a9..8e08deb8 100644 ---- a/src/kv/rocksdb_cache/ShardedCache.cc -+++ b/src/kv/rocksdb_cache/ShardedCache.cc -@@ -131,7 +131,7 @@ std::string ShardedCache::GetPrintableOptions() const { - char buffer[kBufferSize]; - { - std::lock_guard l(capacity_mutex_); -- snprintf(buffer, kBufferSize, " capacity : %" ROCKSDB_PRIszt "\n", -+ snprintf(buffer, kBufferSize, " capacity : %zu\n", - capacity_); - ret.append(buffer); - snprintf(buffer, kBufferSize, " num_shard_bits : %d\n", num_shard_bits_); -diff --git a/src/kv/rocksdb_cache/ShardedCache.h b/src/kv/rocksdb_cache/ShardedCache.h -index 4d64893a..8ab2587b 100644 ---- a/src/kv/rocksdb_cache/ShardedCache.h -+++ b/src/kv/rocksdb_cache/ShardedCache.h -@@ -22,7 +22,6 @@ - #ifndef CACHE_LINE_SIZE - #define CACHE_LINE_SIZE 64 // XXX arch-specific define - #endif --#define ROCKSDB_PRIszt "zu" - - namespace rocksdb_cache { - --- -2.33.0 - diff --git a/recipes-extended/ceph/ceph/0002-common-fix-FTBFS-due-to-dout-need_dynamic-on-GCC-12.patch b/recipes-extended/ceph/ceph/0002-common-fix-FTBFS-due-to-dout-need_dynamic-on-GCC-12.patch deleted file mode 100644 index d119bf1b..00000000 --- a/recipes-extended/ceph/ceph/0002-common-fix-FTBFS-due-to-dout-need_dynamic-on-GCC-12.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 841806de212226921eeaeb3eea054bda8ccce616 Mon Sep 17 00:00:00 2001 -From: Radoslaw Zarzynski -Date: Wed, 19 Jan 2022 15:24:11 +0000 -Subject: [PATCH 2/2] common: fix FTBFS due to dout & need_dynamic on GCC-12 - -For details see: -https://gist.github.com/rzarzynski/d6d2df6888923bef6a3e764f4856853f. - -Special thanks to Kaleb Keithley who reported the issue -and tested the fix! - -Fixes: https://tracker.ceph.com/issues/53896 -Signed-off-by: Radoslaw Zarzynski - -Upstream-Status: Backport [963d756ded40f5adf2efef53893c917bec1845c1] -Signed-off-by: Chen Qi ---- - src/common/dout.h | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/common/dout.h b/src/common/dout.h -index c7c08182..42f49915 100644 ---- a/src/common/dout.h -+++ b/src/common/dout.h -@@ -99,11 +99,12 @@ namespace ceph::dout { - template - struct dynamic_marker_t { - T value; -- operator T() const { return value; } -+ // constexpr ctor isn't needed as it's an aggregate type -+ constexpr operator T() const { return value; } - }; - - template --dynamic_marker_t need_dynamic(T&& t) { -+constexpr dynamic_marker_t need_dynamic(T&& t) { - return dynamic_marker_t{ std::forward(t) }; - } - --- -2.36.0 - diff --git a/recipes-extended/ceph/ceph/0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch b/recipes-extended/ceph/ceph/0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch deleted file mode 100644 index 4f46d223..00000000 --- a/recipes-extended/ceph/ceph/0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch +++ /dev/null @@ -1,101 +0,0 @@ -From cca3144aca7f7c19772065421f9b02205a84e0b8 Mon Sep 17 00:00:00 2001 -From: Casey Bodley -Date: Tue, 15 Feb 2022 18:27:10 -0500 -Subject: [PATCH] common: replace BitVector::NoInitAllocator with wrapper - struct - -in c++20, the deprecated `struct std::allocator::rebind` template was -removed, so `BitVector` no longer compiles. without a `rebind` to -inherit, `std::allocator_traits::rebind_alloc` was -looking for `NoInitAllocator`, but it isn't a template class - -further investigation found that in c++17, `vector<__u32, NoInitAllocator>` -was rebinding this `NoInitAllocator` to `std::allocator<__u32>` and -preventing the no-init optimization from taking effect - -instead of messing with the allocator to avoid zero-initialization, wrap -each __u32 in a struct whose constructor does not initialize the value - -Fixes: https://tracker.ceph.com/issues/54279 - -Signed-off-by: Casey Bodley ---- -Fixes: -http://errors.yoctoproject.org/Errors/Details/701862/ - -Upstream-Status: Backport [https://github.com/ceph/ceph/commit/4f0ad8aab6b21a1fd57a7c1630d298e31b5d9bb6] - - src/common/bit_vector.hpp | 27 +++++++++++---------------- - 1 file changed, 11 insertions(+), 16 deletions(-) - -diff --git a/src/common/bit_vector.hpp b/src/common/bit_vector.hpp -index 10ee6c3e..9ce3e8b1 100644 ---- a/src/common/bit_vector.hpp -+++ b/src/common/bit_vector.hpp -@@ -223,23 +223,18 @@ public: - - static void generate_test_instances(std::list &o); - private: -- struct NoInitAllocator : public std::allocator<__u32> { -- NoInitAllocator() {} -- NoInitAllocator(const std::allocator<__u32>& alloc) -- : std::allocator<__u32>(alloc) { -- } -- -- template -- void construct(U* p, Args&&... args) const { -- } -- }; -- - bufferlist m_data; - uint64_t m_size; - bool m_crc_enabled; - - mutable __u32 m_header_crc; -- mutable std::vector<__u32, NoInitAllocator> m_data_crcs; -+ -+ // inhibit value-initialization when used in std::vector -+ struct u32_struct { -+ u32_struct() {} -+ __u32 val; -+ }; -+ mutable std::vector m_data_crcs; - - void resize(uint64_t elements, bool zero); - -@@ -351,7 +346,7 @@ void BitVector<_b>::encode_data(bufferlist& bl, uint64_t data_byte_offset, - - bufferlist bit; - bit.substr_of(m_data, data_byte_offset, len); -- m_data_crcs[data_byte_offset / BLOCK_SIZE] = bit.crc32c(0); -+ m_data_crcs[data_byte_offset / BLOCK_SIZE].val = bit.crc32c(0); - - bl.claim_append(bit); - data_byte_offset += BLOCK_SIZE; -@@ -385,7 +380,7 @@ void BitVector<_b>::decode_data(bufferlist::const_iterator& it, - bufferlist bit; - bit.append(ptr); - if (m_crc_enabled && -- m_data_crcs[data_byte_offset / BLOCK_SIZE] != bit.crc32c(0)) { -+ m_data_crcs[data_byte_offset / BLOCK_SIZE].val != bit.crc32c(0)) { - throw buffer::malformed_input("invalid data block CRC"); - } - data.append(bit); -@@ -499,7 +494,7 @@ void BitVector<_b>::encode_data_crcs(bufferlist& bl, uint64_t offset, - compute_index(offset + length - 1, &index, &shift); - uint64_t end_crc_index = index / BLOCK_SIZE; - while (crc_index <= end_crc_index) { -- __u32 crc = m_data_crcs[crc_index++]; -+ __u32 crc = m_data_crcs[crc_index++].val; - ceph::encode(crc, bl); - } - } -@@ -520,7 +515,7 @@ void BitVector<_b>::decode_data_crcs(bufferlist::const_iterator& it, - while (remaining > 0) { - __u32 crc; - ceph::decode(crc, it); -- m_data_crcs[crc_index++] = crc; -+ m_data_crcs[crc_index++].val = crc; - --remaining; - } - } diff --git a/recipes-extended/ceph/ceph/0002-kv-rocksdb_cache-reorder-ShardedCache-methods-declar.patch b/recipes-extended/ceph/ceph/0002-kv-rocksdb_cache-reorder-ShardedCache-methods-declar.patch deleted file mode 100644 index 3fc8c860..00000000 --- a/recipes-extended/ceph/ceph/0002-kv-rocksdb_cache-reorder-ShardedCache-methods-declar.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 6cdb1387a713fad765b5193d5acf4504f206a66f Mon Sep 17 00:00:00 2001 -From: Kefu Chai -Date: Tue, 17 Aug 2021 15:39:00 +0800 -Subject: [PATCH 2/6] kv/rocksdb_cache: reorder ShardedCache methods - declarations - -in the exact order in which rocksdb::Cache declare its public virtual -methods. - -Signed-off-by: Kefu Chai - -Upstream-Status: Backport [633656f8ade2c1d67a66f8b7ca3aa0a2ae82e6b1] - -Signed-off-by: Sakib Sajal ---- - src/kv/rocksdb_cache/ShardedCache.h | 21 ++++++++++----------- - 1 file changed, 10 insertions(+), 11 deletions(-) - -diff --git a/src/kv/rocksdb_cache/ShardedCache.h b/src/kv/rocksdb_cache/ShardedCache.h -index 8ab2587b..a16cf561 100644 ---- a/src/kv/rocksdb_cache/ShardedCache.h -+++ b/src/kv/rocksdb_cache/ShardedCache.h -@@ -56,34 +56,33 @@ class ShardedCache : public rocksdb::Cache, public PriorityCache::PriCache { - public: - ShardedCache(size_t capacity, int num_shard_bits, bool strict_capacity_limit); - virtual ~ShardedCache() = default; -+ // rocksdb::Cache - virtual const char* Name() const override = 0; -- virtual CacheShard* GetShard(int shard) = 0; -- virtual const CacheShard* GetShard(int shard) const = 0; -- virtual void* Value(Handle* handle) override = 0; -- virtual size_t GetCharge(Handle* handle) const = 0; -- virtual uint32_t GetHash(Handle* handle) const = 0; -- virtual void DisownData() override = 0; -- -- virtual void SetCapacity(size_t capacity) override; -- virtual void SetStrictCapacityLimit(bool strict_capacity_limit) override; -- - virtual rocksdb::Status Insert(const rocksdb::Slice& key, void* value, size_t charge, - void (*deleter)(const rocksdb::Slice& key, void* value), - rocksdb::Cache::Handle** handle, Priority priority) override; - virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, rocksdb::Statistics* stats) override; - virtual bool Ref(rocksdb::Cache::Handle* handle) override; - virtual bool Release(rocksdb::Cache::Handle* handle, bool force_erase = false) override; -+ virtual void* Value(Handle* handle) override = 0; - virtual void Erase(const rocksdb::Slice& key) override; - virtual uint64_t NewId() override; -- virtual size_t GetCapacity() const override; -+ virtual void SetCapacity(size_t capacity) override; -+ virtual void SetStrictCapacityLimit(bool strict_capacity_limit) override; - virtual bool HasStrictCapacityLimit() const override; -+ virtual size_t GetCapacity() const override; - virtual size_t GetUsage() const override; - virtual size_t GetUsage(rocksdb::Cache::Handle* handle) const override; - virtual size_t GetPinnedUsage() const override; -+ virtual size_t GetCharge(Handle* handle) const = 0; -+ virtual void DisownData() override = 0; - virtual void ApplyToAllCacheEntries(void (*callback)(void*, size_t), - bool thread_safe) override; - virtual void EraseUnRefEntries() override; - virtual std::string GetPrintableOptions() const override; -+ virtual CacheShard* GetShard(int shard) = 0; -+ virtual const CacheShard* GetShard(int shard) const = 0; -+ virtual uint32_t GetHash(Handle* handle) const = 0; - - int GetNumShardBits() const { return num_shard_bits_; } - --- -2.33.0 - diff --git a/recipes-extended/ceph/ceph/0003-kv-rocksdb_cache-define-DeleterFn-function-pointer-t.patch b/recipes-extended/ceph/ceph/0003-kv-rocksdb_cache-define-DeleterFn-function-pointer-t.patch deleted file mode 100644 index 01144b79..00000000 --- a/recipes-extended/ceph/ceph/0003-kv-rocksdb_cache-define-DeleterFn-function-pointer-t.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 29f1e556c1e7c5ab195983552387e1410e0b5b6c Mon Sep 17 00:00:00 2001 -From: Kefu Chai -Date: Tue, 17 Aug 2021 16:25:32 +0800 -Subject: [PATCH 3/6] kv/rocksdb_cache: define DeleterFn function pointer type - -this paves the road to rocksdb v6.22.1 compatible implementation - -Signed-off-by: Kefu Chai - -Upstream-Status: Backport [c7a6c74b62dfcc96f676eb6d8844852c4705b66f] - -Signed-off-by: Sakib Sajal ---- - src/kv/rocksdb_cache/BinnedLRUCache.cc | 2 +- - src/kv/rocksdb_cache/BinnedLRUCache.h | 4 ++-- - src/kv/rocksdb_cache/ShardedCache.cc | 2 +- - src/kv/rocksdb_cache/ShardedCache.h | 6 ++++-- - 4 files changed, 8 insertions(+), 6 deletions(-) - -diff --git a/src/kv/rocksdb_cache/BinnedLRUCache.cc b/src/kv/rocksdb_cache/BinnedLRUCache.cc -index 2391a7f6..4e5f4dd4 100644 ---- a/src/kv/rocksdb_cache/BinnedLRUCache.cc -+++ b/src/kv/rocksdb_cache/BinnedLRUCache.cc -@@ -344,7 +344,7 @@ bool BinnedLRUCacheShard::Release(rocksdb::Cache::Handle* handle, bool force_era - - rocksdb::Status BinnedLRUCacheShard::Insert(const rocksdb::Slice& key, uint32_t hash, void* value, - size_t charge, -- void (*deleter)(const rocksdb::Slice& key, void* value), -+ DeleterFn deleter, - rocksdb::Cache::Handle** handle, rocksdb::Cache::Priority priority) { - auto e = new BinnedLRUHandle(); - rocksdb::Status s; -diff --git a/src/kv/rocksdb_cache/BinnedLRUCache.h b/src/kv/rocksdb_cache/BinnedLRUCache.h -index 96023ce2..b0fb7148 100644 ---- a/src/kv/rocksdb_cache/BinnedLRUCache.h -+++ b/src/kv/rocksdb_cache/BinnedLRUCache.h -@@ -56,7 +56,7 @@ std::shared_ptr NewBinnedLRUCache( - - struct BinnedLRUHandle { - void* value; -- void (*deleter)(const rocksdb::Slice&, void* value); -+ DeleterFn deleter; - BinnedLRUHandle* next_hash; - BinnedLRUHandle* next; - BinnedLRUHandle* prev; -@@ -189,7 +189,7 @@ class alignas(CACHE_LINE_SIZE) BinnedLRUCacheShard : public CacheShard { - // Like Cache methods, but with an extra "hash" parameter. - virtual rocksdb::Status Insert(const rocksdb::Slice& key, uint32_t hash, void* value, - size_t charge, -- void (*deleter)(const rocksdb::Slice& key, void* value), -+ DeleterFn deleter, - rocksdb::Cache::Handle** handle, - rocksdb::Cache::Priority priority) override; - virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, uint32_t hash) override; -diff --git a/src/kv/rocksdb_cache/ShardedCache.cc b/src/kv/rocksdb_cache/ShardedCache.cc -index 8e08deb8..ef3b3b98 100644 ---- a/src/kv/rocksdb_cache/ShardedCache.cc -+++ b/src/kv/rocksdb_cache/ShardedCache.cc -@@ -44,7 +44,7 @@ void ShardedCache::SetStrictCapacityLimit(bool strict_capacity_limit) { - } - - rocksdb::Status ShardedCache::Insert(const rocksdb::Slice& key, void* value, size_t charge, -- void (*deleter)(const rocksdb::Slice& key, void* value), -+ DeleterFn deleter, - rocksdb::Cache::Handle** handle, Priority priority) { - uint32_t hash = HashSlice(key); - return GetShard(Shard(hash)) -diff --git a/src/kv/rocksdb_cache/ShardedCache.h b/src/kv/rocksdb_cache/ShardedCache.h -index a16cf561..674e5322 100644 ---- a/src/kv/rocksdb_cache/ShardedCache.h -+++ b/src/kv/rocksdb_cache/ShardedCache.h -@@ -25,6 +25,8 @@ - - namespace rocksdb_cache { - -+using DeleterFn = void (*)(const rocksdb::Slice& key, void* value); -+ - // Single cache shard interface. - class CacheShard { - public: -@@ -33,7 +35,7 @@ class CacheShard { - - virtual rocksdb::Status Insert(const rocksdb::Slice& key, uint32_t hash, void* value, - size_t charge, -- void (*deleter)(const rocksdb::Slice& key, void* value), -+ DeleterFn deleter, - rocksdb::Cache::Handle** handle, rocksdb::Cache::Priority priority) = 0; - virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, uint32_t hash) = 0; - virtual bool Ref(rocksdb::Cache::Handle* handle) = 0; -@@ -59,7 +61,7 @@ class ShardedCache : public rocksdb::Cache, public PriorityCache::PriCache { - // rocksdb::Cache - virtual const char* Name() const override = 0; - virtual rocksdb::Status Insert(const rocksdb::Slice& key, void* value, size_t charge, -- void (*deleter)(const rocksdb::Slice& key, void* value), -+ DeleterFn, - rocksdb::Cache::Handle** handle, Priority priority) override; - virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, rocksdb::Statistics* stats) override; - virtual bool Ref(rocksdb::Cache::Handle* handle) override; --- -2.33.0 - diff --git a/recipes-extended/ceph/ceph/0003-librdb-fix-build-with-gcc-13.patch b/recipes-extended/ceph/ceph/0003-librdb-fix-build-with-gcc-13.patch deleted file mode 100644 index c27d6f3e..00000000 --- a/recipes-extended/ceph/ceph/0003-librdb-fix-build-with-gcc-13.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 937231991bd7e2cd578cf8cb6c1bedf611c5faef Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Sat, 29 Apr 2023 13:47:43 +0200 -Subject: [PATCH] librdb: fix build with gcc-13 - -* fixes: -ceph-15.2.15/src/librbd/api/PoolMetadata.h:28:19: error: 'uint64_t' has not bee -n declared -ceph/15.2.15-r0/ceph-15.2.15/src/librbd/api/PoolMetadata.cc:133:5: error: no declaration matche -s 'int librbd::api::PoolMetadata::list(librados::v14_2_0::IoCtx&, const std::string&, uint64_t, std::map, ceph::buffer::v15_2_0::list>*)' - -Signed-off-by: Martin Jansa -Upstream-Status: Pending ---- - src/librbd/api/PoolMetadata.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/librbd/api/PoolMetadata.h b/src/librbd/api/PoolMetadata.h -index c0a81735..69ab574a 100644 ---- a/src/librbd/api/PoolMetadata.h -+++ b/src/librbd/api/PoolMetadata.h -@@ -7,6 +7,7 @@ - #include "include/buffer_fwd.h" - #include "include/rados/librados_fwd.hpp" - -+#include - #include - #include - diff --git a/recipes-extended/ceph/ceph/0004-kv-rocksdb_cache-implement-methods-required-by-rocks.patch b/recipes-extended/ceph/ceph/0004-kv-rocksdb_cache-implement-methods-required-by-rocks.patch deleted file mode 100644 index ee1e1416..00000000 --- a/recipes-extended/ceph/ceph/0004-kv-rocksdb_cache-implement-methods-required-by-rocks.patch +++ /dev/null @@ -1,207 +0,0 @@ -From 90696cb3652eb307c6aadde4af7d9198dc00c15f Mon Sep 17 00:00:00 2001 -From: Kefu Chai -Date: Tue, 17 Aug 2021 16:27:47 +0800 -Subject: [PATCH 4/6] kv/rocksdb_cache: implement methods required by rocksdb - v6.22.1 - -rocksdb v6.22.1 added couple pure methods, so let's implement them. - -Signed-off-by: Kefu Chai - -Upstream-Status: Backport [2c445598ce5280e85feb1f0e94d1940a444ee421] - -Signed-off-by: Sakib Sajal ---- - src/kv/rocksdb_cache/BinnedLRUCache.cc | 26 +++++++++++++++++++++++--- - src/kv/rocksdb_cache/BinnedLRUCache.h | 14 +++++++++++--- - src/kv/rocksdb_cache/ShardedCache.cc | 25 ++++++++++++++++++++++++- - src/kv/rocksdb_cache/ShardedCache.h | 20 ++++++++++++++++++-- - 4 files changed, 76 insertions(+), 9 deletions(-) - -diff --git a/src/kv/rocksdb_cache/BinnedLRUCache.cc b/src/kv/rocksdb_cache/BinnedLRUCache.cc -index 4e5f4dd4..1e6ba7af 100644 ---- a/src/kv/rocksdb_cache/BinnedLRUCache.cc -+++ b/src/kv/rocksdb_cache/BinnedLRUCache.cc -@@ -150,13 +150,20 @@ void BinnedLRUCacheShard::EraseUnRefEntries() { - } - } - --void BinnedLRUCacheShard::ApplyToAllCacheEntries(void (*callback)(void*, size_t), -- bool thread_safe) { -+void BinnedLRUCacheShard::ApplyToAllCacheEntries( -+ const std::function& callback, -+ bool thread_safe) -+{ - if (thread_safe) { - mutex_.lock(); - } - table_.ApplyToAllCacheEntries( -- [callback](BinnedLRUHandle* h) { callback(h->value, h->charge); }); -+ [callback](BinnedLRUHandle* h) { -+ callback(h->key(), h->value, h->charge, h->deleter); -+ }); - if (thread_safe) { - mutex_.unlock(); - } -@@ -463,6 +470,12 @@ std::string BinnedLRUCacheShard::GetPrintableOptions() const { - return std::string(buffer); - } - -+DeleterFn BinnedLRUCacheShard::GetDeleter(rocksdb::Cache::Handle* h) const -+{ -+ auto* handle = reinterpret_cast(h); -+ return handle->deleter; -+} -+ - BinnedLRUCache::BinnedLRUCache(CephContext *c, - size_t capacity, - int num_shard_bits, -@@ -518,6 +531,13 @@ void BinnedLRUCache::DisownData() { - #endif // !__SANITIZE_ADDRESS__ - } - -+#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22) -+DeleterFn BinnedLRUCache::GetDeleter(Handle* handle) const -+{ -+ return reinterpret_cast(handle)->deleter; -+} -+#endif -+ - size_t BinnedLRUCache::TEST_GetLRUSize() { - size_t lru_size_of_all_shards = 0; - for (int i = 0; i < num_shards_; i++) { -diff --git a/src/kv/rocksdb_cache/BinnedLRUCache.h b/src/kv/rocksdb_cache/BinnedLRUCache.h -index b0fb7148..ba0c2720 100644 ---- a/src/kv/rocksdb_cache/BinnedLRUCache.h -+++ b/src/kv/rocksdb_cache/BinnedLRUCache.h -@@ -205,13 +205,19 @@ class alignas(CACHE_LINE_SIZE) BinnedLRUCacheShard : public CacheShard { - virtual size_t GetUsage() const override; - virtual size_t GetPinnedUsage() const override; - -- virtual void ApplyToAllCacheEntries(void (*callback)(void*, size_t), -- bool thread_safe) override; -+ virtual void ApplyToAllCacheEntries( -+ const std::function& callback, -+ bool thread_safe) override; - - virtual void EraseUnRefEntries() override; - - virtual std::string GetPrintableOptions() const override; - -+ virtual DeleterFn GetDeleter(rocksdb::Cache::Handle* handle) const override; -+ - void TEST_GetLRUList(BinnedLRUHandle** lru, BinnedLRUHandle** lru_low_pri); - - // Retrieves number of elements in LRU, for unit test purpose only -@@ -303,7 +309,9 @@ class BinnedLRUCache : public ShardedCache { - virtual size_t GetCharge(Handle* handle) const override; - virtual uint32_t GetHash(Handle* handle) const override; - virtual void DisownData() override; -- -+#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22) -+ virtual DeleterFn GetDeleter(Handle* handle) const override; -+#endif - // Retrieves number of elements in LRU, for unit test purpose only - size_t TEST_GetLRUSize(); - // Sets the high pri pool ratio -diff --git a/src/kv/rocksdb_cache/ShardedCache.cc b/src/kv/rocksdb_cache/ShardedCache.cc -index ef3b3b98..6cbd89ad 100644 ---- a/src/kv/rocksdb_cache/ShardedCache.cc -+++ b/src/kv/rocksdb_cache/ShardedCache.cc -@@ -109,13 +109,36 @@ size_t ShardedCache::GetPinnedUsage() const { - return usage; - } - -+#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22) -+DeleterFn ShardedCache::GetDeleter(Handle* handle) const -+{ -+ uint32_t hash = GetHash(handle); -+ return GetShard(Shard(hash))->GetDeleter(handle); -+} -+ -+void ShardedCache::ApplyToAllEntries( -+ const std::function& callback, -+ const ApplyToAllEntriesOptions& opts) -+{ -+ int num_shards = 1 << num_shard_bits_; -+ for (int s = 0; s < num_shards; s++) { -+ GetShard(s)->ApplyToAllCacheEntries(callback, true /* thread_safe */); -+ } -+} -+#else - void ShardedCache::ApplyToAllCacheEntries(void (*callback)(void*, size_t), - bool thread_safe) { - int num_shards = 1 << num_shard_bits_; - for (int s = 0; s < num_shards; s++) { -- GetShard(s)->ApplyToAllCacheEntries(callback, thread_safe); -+ GetShard(s)->ApplyToAllCacheEntries( -+ [callback](const rocksdb::Slice&, void* value, size_t charge, DeleterFn) { -+ callback(value, charge); -+ }, -+ thread_safe); - } - } -+#endif - - void ShardedCache::EraseUnRefEntries() { - int num_shards = 1 << num_shard_bits_; -diff --git a/src/kv/rocksdb_cache/ShardedCache.h b/src/kv/rocksdb_cache/ShardedCache.h -index 674e5322..4d3ca302 100644 ---- a/src/kv/rocksdb_cache/ShardedCache.h -+++ b/src/kv/rocksdb_cache/ShardedCache.h -@@ -14,6 +14,7 @@ - #include - #include - -+#include "rocksdb/version.h" - #include "rocksdb/cache.h" - #include "include/ceph_hash.h" - #include "common/PriorityCache.h" -@@ -45,10 +46,15 @@ class CacheShard { - virtual void SetStrictCapacityLimit(bool strict_capacity_limit) = 0; - virtual size_t GetUsage() const = 0; - virtual size_t GetPinnedUsage() const = 0; -- virtual void ApplyToAllCacheEntries(void (*callback)(void*, size_t), -- bool thread_safe) = 0; -+ virtual void ApplyToAllCacheEntries( -+ const std::function& callback, -+ bool thread_safe) = 0; - virtual void EraseUnRefEntries() = 0; - virtual std::string GetPrintableOptions() const { return ""; } -+ virtual DeleterFn GetDeleter(rocksdb::Cache::Handle* handle) const = 0; - }; - - // Generic cache interface which shards cache by hash of keys. 2^num_shard_bits -@@ -77,9 +83,19 @@ class ShardedCache : public rocksdb::Cache, public PriorityCache::PriCache { - virtual size_t GetUsage(rocksdb::Cache::Handle* handle) const override; - virtual size_t GetPinnedUsage() const override; - virtual size_t GetCharge(Handle* handle) const = 0; -+#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22) -+ virtual DeleterFn GetDeleter(Handle* handle) const override; -+#endif - virtual void DisownData() override = 0; -+#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22) -+ virtual void ApplyToAllEntries( -+ const std::function& callback, -+ const ApplyToAllEntriesOptions& opts) override; -+#else - virtual void ApplyToAllCacheEntries(void (*callback)(void*, size_t), - bool thread_safe) override; -+#endif - virtual void EraseUnRefEntries() override; - virtual std::string GetPrintableOptions() const override; - virtual CacheShard* GetShard(int shard) = 0; --- -2.33.0 - diff --git a/recipes-extended/ceph/ceph/0005-kv-rocksdb_cache-mark-Shard-const.patch b/recipes-extended/ceph/ceph/0005-kv-rocksdb_cache-mark-Shard-const.patch deleted file mode 100644 index bc18574c..00000000 --- a/recipes-extended/ceph/ceph/0005-kv-rocksdb_cache-mark-Shard-const.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 52c57e25a5e2c617bc797b8ce50060b5894bd7fc Mon Sep 17 00:00:00 2001 -From: Kefu Chai -Date: Tue, 17 Aug 2021 18:06:31 +0800 -Subject: [PATCH 5/6] kv/rocksdb_cache: mark Shard() const - -it does not mutate anything, so mark it `const`. - -Signed-off-by: Kefu Chai - -Upstream-Status: Backport [0296ac4458c0be0609f033e15b0fa8c6c9c20049] - -Signed-off-by: Sakib Sajal ---- - src/kv/rocksdb_cache/ShardedCache.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/kv/rocksdb_cache/ShardedCache.h b/src/kv/rocksdb_cache/ShardedCache.h -index 4d3ca302..f98421a0 100644 ---- a/src/kv/rocksdb_cache/ShardedCache.h -+++ b/src/kv/rocksdb_cache/ShardedCache.h -@@ -136,7 +136,7 @@ class ShardedCache : public rocksdb::Cache, public PriorityCache::PriCache { - // return Hash(s.data(), s.size(), 0); - } - -- uint32_t Shard(uint32_t hash) { -+ uint32_t Shard(uint32_t hash) const { - // Note, hash >> 32 yields hash in gcc, not the zero we expect! - return (num_shard_bits_ > 0) ? (hash >> (32 - num_shard_bits_)) : 0; - } --- -2.33.0 - diff --git a/recipes-extended/ceph/ceph/CVE-2021-3979.patch b/recipes-extended/ceph/ceph/CVE-2021-3979.patch deleted file mode 100644 index 081b32ba..00000000 --- a/recipes-extended/ceph/ceph/CVE-2021-3979.patch +++ /dev/null @@ -1,158 +0,0 @@ -From 47c33179f9a15ae95cc1579a421be89378602656 Mon Sep 17 00:00:00 2001 -From: Guillaume Abrioux -Date: Tue, 25 Jan 2022 10:25:53 +0100 -Subject: [PATCH] ceph-volume: honour osd_dmcrypt_key_size option - -ceph-volume doesn't honour osd_dmcrypt_key_size. -It means the default size is always applied. - -It also changes the default value in `get_key_size_from_conf()` - -From cryptsetup manpage: - -> For XTS mode you can optionally set a key size of 512 bits with the -s option. - -Using more than 512bits will end up with the following error message: - -``` -Key size in XTS mode must be 256 or 512 bits. -``` - -Fixes: https://tracker.ceph.com/issues/54006 - -Signed-off-by: Guillaume Abrioux - -Upstream-Status: Backport - github.com/ceph/ceph.git - equivalent to cherry-pick of commit 47c33179f9a15ae95cc1579a421be89378602656 - -CVE: CVE-2021-3979 - -Signed-off-by: Joe Slater ---- - .../ceph_volume/tests/util/test_encryption.py | 41 +++++++++++++------ - .../ceph_volume/util/encryption.py | 34 ++++++++++----- - 2 files changed, 51 insertions(+), 24 deletions(-) - -diff --git a/src/ceph-volume/ceph_volume/tests/util/test_encryption.py b/src/ceph-volume/ceph_volume/tests/util/test_encryption.py -index e1420b440d3..c86dc50b7c7 100644 ---- a/src/ceph-volume/ceph_volume/tests/util/test_encryption.py -+++ b/src/ceph-volume/ceph_volume/tests/util/test_encryption.py -@@ -1,5 +1,31 @@ - from ceph_volume.util import encryption -+import base64 - -+class TestGetKeySize(object): -+ def test_get_size_from_conf_default(self, conf_ceph_stub): -+ conf_ceph_stub(''' -+ [global] -+ fsid=asdf -+ ''') -+ assert encryption.get_key_size_from_conf() == '512' -+ -+ def test_get_size_from_conf_custom(self, conf_ceph_stub): -+ conf_ceph_stub(''' -+ [global] -+ fsid=asdf -+ [osd] -+ osd_dmcrypt_key_size=256 -+ ''') -+ assert encryption.get_key_size_from_conf() == '256' -+ -+ def test_get_size_from_conf_custom_invalid(self, conf_ceph_stub): -+ conf_ceph_stub(''' -+ [global] -+ fsid=asdf -+ [osd] -+ osd_dmcrypt_key_size=1024 -+ ''') -+ assert encryption.get_key_size_from_conf() == '512' - - class TestStatus(object): - -@@ -37,17 +63,6 @@ class TestDmcryptClose(object): - - class TestDmcryptKey(object): - -- def test_dmcrypt_with_default_size(self, conf_ceph_stub): -- conf_ceph_stub('[global]\nfsid=asdf-lkjh') -- result = encryption.create_dmcrypt_key() -- assert len(result) == 172 -- -- def test_dmcrypt_with_custom_size(self, conf_ceph_stub): -- conf_ceph_stub(''' -- [global] -- fsid=asdf -- [osd] -- osd_dmcrypt_size=8 -- ''') -+ def test_dmcrypt(self): - result = encryption.create_dmcrypt_key() -- assert len(result) == 172 -+ assert len(base64.b64decode(result)) == 128 -diff --git a/src/ceph-volume/ceph_volume/util/encryption.py b/src/ceph-volume/ceph_volume/util/encryption.py -index 72a0ccf121e..2a2c03337b6 100644 ---- a/src/ceph-volume/ceph_volume/util/encryption.py -+++ b/src/ceph-volume/ceph_volume/util/encryption.py -@@ -9,21 +9,29 @@ from .disk import lsblk, device_family, get_part_entry_type - - logger = logging.getLogger(__name__) - -- --def create_dmcrypt_key(): -+def get_key_size_from_conf(): - """ -- Create the secret dm-crypt key used to decrypt a device. -+ Return the osd dmcrypt key size from config file. -+ Default is 512. - """ -- # get the customizable dmcrypt key size (in bits) from ceph.conf fallback -- # to the default of 1024 -- dmcrypt_key_size = conf.ceph.get_safe( -+ default_key_size = '512' -+ key_size = conf.ceph.get_safe( - 'osd', - 'osd_dmcrypt_key_size', -- default=1024, -- ) -- # The size of the key is defined in bits, so we must transform that -- # value to bytes (dividing by 8) because we read in bytes, not bits -- random_string = os.urandom(int(dmcrypt_key_size / 8)) -+ default='512') -+ -+ if key_size not in ['256', '512']: -+ logger.warning(("Invalid value set for osd_dmcrypt_key_size ({}). " -+ "Falling back to {}bits".format(key_size, default_key_size))) -+ return default_key_size -+ -+ return key_size -+ -+def create_dmcrypt_key(): -+ """ -+ Create the secret dm-crypt key (KEK) used to encrypt/decrypt the Volume Key. -+ """ -+ random_string = os.urandom(128) - key = base64.b64encode(random_string).decode('utf-8') - return key - -@@ -38,6 +46,8 @@ def luks_format(key, device): - command = [ - 'cryptsetup', - '--batch-mode', # do not prompt -+ '--key-size', -+ get_key_size_from_conf(), - '--key-file', # misnomer, should be key - '-', # because we indicate stdin for the key here - 'luksFormat', -@@ -83,6 +93,8 @@ def luks_open(key, device, mapping): - """ - command = [ - 'cryptsetup', -+ '--key-size', -+ get_key_size_from_conf(), - '--key-file', - '-', - '--allow-discards', # allow discards (aka TRIM) requests for device --- -2.35.1 - diff --git a/recipes-extended/ceph/ceph_15.2.15.bb b/recipes-extended/ceph/ceph_15.2.15.bb deleted file mode 100644 index 2c5cdf58..00000000 --- a/recipes-extended/ceph/ceph_15.2.15.bb +++ /dev/null @@ -1,157 +0,0 @@ -SUMMARY = "User space components of the Ceph file system" -LICENSE = "LGPL-2.1-only & GPL-2.0-only & Apache-2.0 & MIT" -LIC_FILES_CHKSUM = "file://COPYING-LGPL2.1;md5=fbc093901857fcd118f065f900982c24 \ - file://COPYING-GPL2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING;md5=4eb012c221c5fd4b760029a2981a6754 \ -" -inherit cmake pkgconfig python3native python3-dir systemd -# Disable python pybind support for ceph temporary, when corss compiling pybind, -# pybind mix cmake and python setup environment, would case a lot of errors. - -SRC_URI = "http://download.ceph.com/tarballs/ceph-${PV}.tar.gz \ - file://0001-ceph-fix-build-errors-for-cross-compile.patch \ - file://0001-fix-host-library-paths-were-used.patch \ - file://ceph.conf \ - file://0001-cmake-add-support-for-python3.11.patch \ - file://0001-SnappyCompressor.h-fix-snappy-compiler-error.patch \ - file://0001-buffer.h-add-missing-header-file-due-to-gcc-upgrade.patch \ - file://0002-common-fix-FTBFS-due-to-dout-need_dynamic-on-GCC-12.patch \ - file://CVE-2021-3979.patch \ - file://0001-kv-rocksdb_cache-drop-ROCKSDB_PRIszt.patch \ - file://0002-kv-rocksdb_cache-reorder-ShardedCache-methods-declar.patch \ - file://0003-kv-rocksdb_cache-define-DeleterFn-function-pointer-t.patch \ - file://0004-kv-rocksdb_cache-implement-methods-required-by-rocks.patch \ - file://0005-kv-rocksdb_cache-mark-Shard-const.patch \ - file://0006-rocksdb-build-with-rocksdb-7.y.z.patch \ - file://0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch \ - file://0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch \ - file://0003-librdb-fix-build-with-gcc-13.patch \ -" - -SRC_URI[sha256sum] = "5dccdaff2ebe18d435b32bfc06f8b5f474bf6ac0432a6a07d144b7c56700d0bf" - -DEPENDS = "boost bzip2 curl expat gperf-native \ - keyutils libaio libibverbs lz4 \ - nspr nss \ - oath openldap openssl \ - python3 python3-cython-native rabbitmq-c rocksdb snappy udev \ - valgrind xfsprogs zlib \ -" -SYSTEMD_SERVICE:${PN} = " \ - ceph-radosgw@.service \ - ceph-radosgw.target \ - ceph-mon@.service \ - ceph-mon.target \ - ceph-mds@.service \ - ceph-mds.target \ - ceph-osd@.service \ - ceph-osd.target \ - ceph.target \ - ceph-rbd-mirror@.service \ - ceph-rbd-mirror.target \ - ceph-volume@.service \ - ceph-mgr@.service \ - ceph-mgr.target \ - ceph-crash.service \ - rbdmap.service \ - ceph-immutable-object-cache@.service \ - ceph-immutable-object-cache.target \ -" -OECMAKE_GENERATOR = "Unix Makefiles" - -EXTRA_OECMAKE = "-DWITH_MANPAGE=OFF \ - -DWITH_FUSE=OFF \ - -DWITH_SPDK=OFF \ - -DWITH_LEVELDB=OFF \ - -DWITH_LTTNG=OFF \ - -DWITH_BABELTRACE=OFF \ - -DWITH_TESTS=OFF \ - -DWITH_MGR=OFF \ - -DWITH_MGR_DASHBOARD_FRONTEND=OFF \ - -DWITH_SYSTEM_BOOST=ON \ - -DWITH_SYSTEM_ROCKSDB=ON \ - -DWITH_RDMA=OFF \ - -DWITH_RADOSGW_AMQP_ENDPOINT=OFF \ - -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3 \ - -DPython3_EXECUTABLE=${PYTHON} \ - -DWITH_RADOSGW_KAFKA_ENDPOINT=OFF \ - -DWITH_REENTRANT_STRSIGNAL=ON \ -" - -CXXFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" -CFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" - -export STAGING_DIR_HOST - -do_configure:prepend () { - echo "set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" >> ${WORKDIR}/toolchain.cmake - echo "set( CMAKE_DESTDIR \"${D}\" )" >> ${WORKDIR}/toolchain.cmake - echo "set( PYTHON_SITEPACKAGES_DIR \"${PYTHON_SITEPACKAGES_DIR}\" )" >> ${WORKDIR}/toolchain.cmake -} - -do_install:append () { - sed -i -e 's:^#!/usr/bin/python$:&3:' \ - -e 's:${WORKDIR}.*python3:${bindir}/python3:' \ - ${D}${bindir}/ceph ${D}${bindir}/ceph-crash \ - ${D}${bindir}/ceph-volume ${D}${bindir}/ceph-volume-systemd - find ${D} -name SOURCES.txt | xargs sed -i -e 's:${WORKDIR}::' - install -d ${D}${sysconfdir}/ceph - install -m 644 ${WORKDIR}/ceph.conf ${D}${sysconfdir}/ceph/ - install -d ${D}${systemd_unitdir} - mv ${D}${libexecdir}/systemd/system ${D}${systemd_unitdir} - mv ${D}${libexecdir}/ceph/ceph-osd-prestart.sh ${D}${libdir}/ceph - mv ${D}${libexecdir}/ceph/ceph_common.sh ${D}${libdir}/ceph - # WITH_FUSE is set to OFF, remove ceph-fuse related units - rm ${D}${systemd_unitdir}/system/ceph-fuse.target ${D}${systemd_unitdir}/system/ceph-fuse@.service -} - -do_install:append:class-target () { - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/tmpfiles.d - echo "d /var/lib/ceph/crash/posted 0755 root root - -" > ${D}${sysconfdir}/tmpfiles.d/ceph-placeholder.conf - fi - - if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/default/volatiles - echo "d root root 0755 /var/lib/ceph/crash/posted none" > ${D}${sysconfdir}/default/volatiles/99_ceph-placeholder - fi -} - -pkg_postinst:${PN}() { - if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then - ${sysconfdir}/init.d/populate-volatile.sh update - fi -} - -FILES:${PN} += "\ - ${libdir}/rados-classes/*.so.* \ - ${libdir}/ceph/compressor/*.so \ - ${libdir}/rados-classes/*.so \ - ${libdir}/ceph/*.so \ -" - -FILES:${PN} += " \ - /etc/tmpfiles.d/ceph-placeholder.conf \ - /etc/default/volatiles/99_ceph-placeholder \ -" - -FILES:${PN}-python = "\ - ${PYTHON_SITEPACKAGES_DIR}/* \ -" -RDEPENDS:${PN} += "\ - python3-core \ - python3-misc \ - python3-modules \ - python3-prettytable \ - ${PN}-python \ - gawk \ -" -COMPATIBLE_HOST = "(x86_64).*" -PACKAGES += " \ - ${PN}-python \ -" -INSANE_SKIP:${PN}-python += "ldflags" -INSANE_SKIP:${PN} += "dev-so" -CCACHE_DISABLE = "1" - -CVE_PRODUCT = "ceph ceph_storage ceph_storage_mon ceph_storage_osd" diff --git a/recipes-extended/ceph/ceph_18.2.0.bb b/recipes-extended/ceph/ceph_18.2.0.bb new file mode 100644 index 00000000..35188106 --- /dev/null +++ b/recipes-extended/ceph/ceph_18.2.0.bb @@ -0,0 +1,172 @@ +SUMMARY = "User space components of the Ceph file system" +LICENSE = "LGPL-2.1-only & GPL-2.0-only & Apache-2.0 & MIT" +LIC_FILES_CHKSUM = "file://COPYING-LGPL2.1;md5=fbc093901857fcd118f065f900982c24 \ + file://COPYING-GPL2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING;md5=5351120989d78252e65dc1a2a92e3617 \ +" +inherit cmake pkgconfig python3native python3-dir systemd +# Disable python pybind support for ceph temporary, when corss compiling pybind, +# pybind mix cmake and python setup environment, would case a lot of errors. + +SRC_URI = "http://download.ceph.com/tarballs/ceph-${PV}.tar.gz \ + file://0001-ceph-fix-build-errors-for-cross-compile.patch \ + file://0001-fix-host-library-paths-were-used.patch \ + file://ceph.conf \ + file://0001-cmake-add-support-for-python3.11.patch \ +" + +SRC_URI[sha256sum] = "495b63e1146c604018ae0cb29bf769b5d6235e3c95849c43513baf12bba1364d" + +DEPENDS = "boost bzip2 curl cryptsetup expat gperf-native \ + keyutils libaio libibverbs lua lz4 \ + nspr nss ninja-native \ + oath openldap openssl \ + python3 python3-native python3-cython-native python3-pyyaml-native \ + rabbitmq-c rocksdb snappy thrift udev \ + valgrind xfsprogs zlib libgcc \ +" +SYSTEMD_SERVICE:${PN} = " \ + ceph-radosgw@.service \ + ceph-radosgw.target \ + ceph-mon@.service \ + ceph-mon.target \ + ceph-mds@.service \ + ceph-mds.target \ + ceph-osd@.service \ + ceph-osd.target \ + ceph.target \ + ceph-rbd-mirror@.service \ + ceph-rbd-mirror.target \ + ceph-volume@.service \ + ceph-mgr@.service \ + ceph-mgr.target \ + ceph-crash.service \ + rbdmap.service \ + ceph-immutable-object-cache@.service \ + ceph-immutable-object-cache.target \ +" +OECMAKE_GENERATOR = "Unix Makefiles" + +EXTRA_OECMAKE = "-DWITH_MANPAGE=OFF \ + -DWITH_FUSE=OFF \ + -DWITH_SPDK=OFF \ + -DWITH_LEVELDB=OFF \ + -DWITH_LTTNG=OFF \ + -DWITH_BABELTRACE=OFF \ + -DWITH_TESTS=OFF \ + -DWITH_MGR=OFF \ + -DWITH_MGR_DASHBOARD_FRONTEND=OFF \ + -DWITH_SYSTEM_BOOST=ON \ + -DWITH_SYSTEM_ROCKSDB=ON \ + -DWITH_RDMA=OFF \ + -DWITH_RADOSGW_AMQP_ENDPOINT=OFF \ + -DWITH_RADOSGW_KAFKA_ENDPOINT=OFF \ + -DWITH_REENTRANT_STRSIGNAL=ON \ + -DWITH_PYTHON3=3.12 \ + -DPYTHON_DESIRED=3 \ + -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${WORKDIR}/toolchain.cmake \ + " + +EXTRA_OECMAKE += "-DThrift_INCLUDE_DIR:PATH=${STAGING_INCDIR} \ + -DThrift_LIBRARIES:PATH=${STAGING_LIBDIR} \ + " + +# retired options: +# -DPython3_VERSION=${PYTHON_BASEVERSION} +# -DPython3_USE_STATIC_LIBS=FALSE +# -DPython3_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR} +# -DPython3_LIBRARY:PATH=${PYTHON_LIBRARY} +# -DPython3_ROOT_DIR:PATH=${PYTHON_SITEPACKAGES_DIR} +# -DPython3_EXECUTABLE:PATH="${PYTHON}" + +CXXFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +CFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" + +export STAGING_DIR_HOST + +do_compile:prepend() { + cmake_runcmake_build --target legacy-option-headers +} + +# do_compile() { +# ninja -v ${PARALLEL_MAKE} +# } +do_compile() { + cmake_runcmake_build --target all +} + +do_configure:prepend () { + echo "set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" >> ${WORKDIR}/toolchain.cmake + echo "set( CMAKE_DESTDIR \"${D}\" )" >> ${WORKDIR}/toolchain.cmake + echo "set( PYTHON_SITEPACKAGES_DIR \"${PYTHON_SITEPACKAGES_DIR}\" )" >> ${WORKDIR}/toolchain.cmake + # echo "set( CMAKE_C_COMPILER_WORKS TRUE)" >> ${WORKDIR}/toolchain.cmake + # echo "set( CMAKE_CXX_COMPILER_FORCED TRUE)" >> ${WORKDIR}/toolchain.cmake + echo "set( CMAKE_C_COMPILER_FORCED TRUE )" >> ${WORKDIR}/toolchain.cmake +} + +do_install:append () { + sed -i -e 's:^#!/usr/bin/python$:&3:' \ + -e 's:${WORKDIR}.*python3:${bindir}/python3:' \ + ${D}${bindir}/ceph ${D}${bindir}/ceph-crash \ + ${D}${bindir}/ceph-volume ${D}${bindir}/ceph-volume-systemd + find ${D} -name SOURCES.txt | xargs sed -i -e 's:${WORKDIR}::' + install -d ${D}${sysconfdir}/ceph + install -m 644 ${WORKDIR}/ceph.conf ${D}${sysconfdir}/ceph/ + install -d ${D}${systemd_unitdir} + mv ${D}${libexecdir}/systemd/system ${D}${systemd_unitdir} + mv ${D}${libexecdir}/ceph/ceph-osd-prestart.sh ${D}${libdir}/ceph + mv ${D}${libexecdir}/ceph/ceph_common.sh ${D}${libdir}/ceph + # WITH_FUSE is set to OFF, remove ceph-fuse related units + rm ${D}${systemd_unitdir}/system/ceph-fuse.target ${D}${systemd_unitdir}/system/ceph-fuse@.service +} + +do_install:append:class-target () { + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/tmpfiles.d + echo "d /var/lib/ceph/crash/posted 0755 root root - -" > ${D}${sysconfdir}/tmpfiles.d/ceph-placeholder.conf + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/default/volatiles + echo "d root root 0755 /var/lib/ceph/crash/posted none" > ${D}${sysconfdir}/default/volatiles/99_ceph-placeholder + fi +} + +pkg_postinst:${PN}() { + if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then + ${sysconfdir}/init.d/populate-volatile.sh update + fi +} + +FILES:${PN} += "\ + ${libdir}/rados-classes/*.so.* \ + ${libdir}/ceph/compressor/*.so \ + ${libdir}/rados-classes/*.so \ + ${libdir}/ceph/*.so \ +" + +FILES:${PN} += " \ + /etc/tmpfiles.d/ceph-placeholder.conf \ + /etc/default/volatiles/99_ceph-placeholder \ +" + +FILES:${PN}-python = "\ + ${PYTHON_SITEPACKAGES_DIR}/* \ +" +RDEPENDS:${PN} += "\ + python3-core \ + python3-misc \ + python3-modules \ + python3-prettytable \ + ${PN}-python \ + gawk \ +" +COMPATIBLE_HOST = "(x86_64).*" +PACKAGES += " \ + ${PN}-python \ +" +INSANE_SKIP:${PN}-python += "ldflags" +INSANE_SKIP:${PN} += "dev-so" +CCACHE_DISABLE = "1" + +CVE_PRODUCT = "ceph ceph_storage ceph_storage_mon ceph_storage_osd" -- cgit v1.2.3-54-g00ecf