From c08edfc84e48b8f168468112d5f29a36ed93dd3f Mon Sep 17 00:00:00 2001 From: mabofu Date: Mon, 12 Jun 2023 20:32:15 +0800 Subject: [PATCH] fixed with anlios23 FTBFS --- cmake/modules/BuildBoost.cmake | 2 +- make-dist-new | 19 +++++++++++++++++ src/cephadm/cephadm | 26 +++++++++++++++--------- src/common/dout.h | 5 +++-- src/compressor/snappy/SnappyCompressor.h | 2 +- src/include/buffer.h | 1 + src/mgr/CMakeLists.txt | 1 + 7 files changed, 42 insertions(+), 14 deletions(-) create mode 100755 make-dist-new diff --git a/cmake/modules/BuildBoost.cmake b/cmake/modules/BuildBoost.cmake index 17b560c56..88006f1d0 100644 --- a/cmake/modules/BuildBoost.cmake +++ b/cmake/modules/BuildBoost.cmake @@ -70,7 +70,7 @@ function(do_build_boost version) if(c MATCHES "^python([0-9])\$") set(with_python_version "${CMAKE_MATCH_1}") list(APPEND boost_with_libs "python") - elseif(c MATCHES "^python([0-9])\\.?([0-9])\$") + elseif(c MATCHES "^python([0-9])\\.?([0-9]+)\$") set(with_python_version "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}") list(APPEND boost_with_libs "python") else() diff --git a/make-dist-new b/make-dist-new new file mode 100755 index 000000000..0e3ace8bd --- /dev/null +++ b/make-dist-new @@ -0,0 +1,19 @@ +#!/bin/bash -e + + +# clean out old cruft... +echo "cleanup..." +rm -f dsms-storage* + +# build new tarball +echo "building tarball..." + + +git archive --format=tar --prefix=dsms-storage/ HEAD > dsms-storage-v1.0.tar + + +echo "compressing..." +bzip2 -9 dsms-storage-v1.0.tar +mv dsms-storage-v1.0.tar.bz2 dsms-storage-v1.0.tar.gz + +echo "done." diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 37903d45c..e57f875b0 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3256,14 +3256,18 @@ def list_daemons(detail=True, legacy_dir=None): image_field = '.ImageID' else: image_field = '.Image' - - out, err, code = call( - [ - container_path, 'inspect', - '--format', '{{.Id}},{{.Config.Image}},{{%s}},{{.Created}},{{index .Config.Labels "io.ceph.version"}}' % image_field, - 'ceph-%s-%s' % (fsid, j) - ], - verbosity=CallVerbosity.DEBUG) + if container_path: + out, err, code = call( + [ + container_path, 'inspect', + '--format', '{{.Id}},{{.Config.Image}},{{%s}},{{.Created}},{{index .Config.Labels "io.ceph.version"}}' % image_field, + 'ceph-%s-%s' % (fsid, j) + ], + verbosity=CallVerbosity.DEBUG) + else: + code = -1 + out = "" + err = "" if not code: (container_id, image_name, image_id, start, version) = out.strip().split(',') @@ -5518,8 +5522,10 @@ if __name__ == "__main__": logger.debug('Could not locate %s: %s' % (i, e)) if not container_path and args.func != command_prepare_host\ and args.func != command_add_repo: - sys.stderr.write('Unable to locate any of %s\n' % CONTAINER_PREFERENCE) - sys.exit(1) + # when no podman or docker + logger.debug('no podman or docker, skip') + # sys.stderr.write('Unable to locate any of %s\n' % CONTAINER_PREFERENCE) + # sys.exit(1) # container-init? container_init = args.container_init diff --git a/src/common/dout.h b/src/common/dout.h index c7c08182e..42f49915b 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) }; } diff --git a/src/compressor/snappy/SnappyCompressor.h b/src/compressor/snappy/SnappyCompressor.h index 0cfb819cd..98a3c2166 100644 --- a/src/compressor/snappy/SnappyCompressor.h +++ b/src/compressor/snappy/SnappyCompressor.h @@ -96,8 +96,8 @@ class SnappyCompressor : public Compressor { if (qat_enabled) return qat_accel.decompress(p, compressed_len, dst); #endif - snappy::uint32 res_len = 0; BufferlistSource source_1(p, compressed_len); + uint32_t res_len = 0; if (!snappy::GetUncompressedLength(&source_1, &res_len)) { return -1; } diff --git a/src/include/buffer.h b/src/include/buffer.h index 5c8b427d0..4af9b0400 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #if __cplusplus >= 201703L diff --git a/src/mgr/CMakeLists.txt b/src/mgr/CMakeLists.txt index f6f9e73d4..35e263895 100644 --- a/src/mgr/CMakeLists.txt +++ b/src/mgr/CMakeLists.txt @@ -30,6 +30,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 -- Gitee