From: Kefu Chai Date: Fri, 14 May 2021 14:37:08 +0000 (+0800) Subject: ceph-dev-*-setup: use libc allocator when building quincy on bionic X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=17b40974b1cb10d1d8ba0373dbf578fb0e82f036;p=ceph-build.git ceph-dev-*-setup: use libc allocator when building quincy on bionic see also https://tracker.ceph.com/issues/39703, to silence the warning std::allocator is deprecated in C++17 and will be removed in C++20, so stop using allocator in quincy and up. but the libtcmalloc shipped by bionic is still buggy (v2.5), so we should not build qunincy and up with tcmalloc on this distro. after this change, we only build quincy and up with tcmalloc on non-bionic distro. Signed-off-by: Kefu Chai --- diff --git a/ceph-dev-new-setup/build/build b/ceph-dev-new-setup/build/build index 344345c8..11cc19d2 100644 --- a/ceph-dev-new-setup/build/build +++ b/ceph-dev-new-setup/build/build @@ -64,7 +64,7 @@ else echo "forcing." fi -ceph_build_args_from_flavor ${FLAVOR} +ceph_build_args_from_flavor_and_dist ${FLAVOR} ${DIST} mkdir -p release diff --git a/ceph-dev-setup/build/build b/ceph-dev-setup/build/build index ed60f796..bf94b27d 100644 --- a/ceph-dev-setup/build/build +++ b/ceph-dev-setup/build/build @@ -36,7 +36,7 @@ rm -rf release echo "Running submodule update ..." git submodule update --init -ceph_build_args_from_flavor ${FLAVOR} +ceph_build_args_from_flavor_and_dist ${FLAVOR} ${DIST} # When using autotools/autoconf it is possible to see output from `git diff` # since some macros can be copied over to the ceph source, triggering this diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index cc2876f8..ba5005f2 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -821,15 +821,34 @@ gen_debian_version() { # Flavor Builds support # - CEPH_EXTRA_RPMBUILD_ARGS is consumed by build_rpms() # - CEPH_EXTRA_CMAKE_ARGS is consumed by debian/rules and ceph.spec directly -ceph_build_args_from_flavor() { +ceph_build_args_from_flavor_and_dist() { local flavor=$1 shift + local dist=$1 + shift # shellcheck disable=SC2034 case "${flavor}" in default) CEPH_EXTRA_RPMBUILD_ARGS="--with tcmalloc" - CEPH_EXTRA_CMAKE_ARGS+=" -DALLOCATOR=tcmalloc" + # we have to build quincy and up on bionic, because some teuthology tests are + # still using ubuntu bionic: + # - the perftest depends on cosbench which is not compatible with ubuntu/focal, see + # https://tracker.ceph.com/issues/49139 + # - we need to test old clients which are built on bionic. for instance, we don't build + # nautilus on focal yet. + # - some upgrade tests still include bionic facets. + if [ "$dist" == "bionic" ]; then + local ver + ver=$(git describe --abbrev=8 --match "v*" | sed s/^v// | cut -f1 -d'.') + # use libc allocator when building on quincy and up on bionic + if [ ${ver} -lt 17 ]; then + CEPH_EXTRA_CMAKE_ARGS+=" -DALLOCATOR=tcmalloc" + fi + else + # always use tcmalloc on non-bionic dists + CEPH_EXTRA_CMAKE_ARGS+=" -DALLOCATOR=tcmalloc" + fi ;; crimson) CEPH_EXTRA_RPMBUILD_ARGS="--with seastar"