From 901fe2e097548707350bc89c7650e0f72c45d994 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 15 May 2021 19:32:11 +0800 Subject: [PATCH] ceph-dev-*-setup: do not specify ALLOCATOR $DIST env variable is not set by ceph-dev-new-setup, as it prepares the dist tarball for building on different distros. to build with tcmalloc if gperftools 2.6.2 is available, we leave it to cmake to decide the allocator to use. because, if ALLOCATOR is not specified, cmake first tries to find gperftools, and falls back to JeMalloc, and the libc allocator. after quincy, the fix for gperftools <2.6.2 is dropped, and gperftools >= 2.6.2 is required, so it's safe. before quincy, the fix gperftools <2.6.2 is still included, so it's also safe. Signed-off-by: Kefu Chai --- ceph-dev-new-setup/build/build | 2 +- ceph-dev-setup/build/build | 2 +- scripts/build_utils.sh | 25 +++++++++++-------------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/ceph-dev-new-setup/build/build b/ceph-dev-new-setup/build/build index 11cc19d2..344345c8 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_and_dist ${FLAVOR} ${DIST} +ceph_build_args_from_flavor ${FLAVOR} mkdir -p release diff --git a/ceph-dev-setup/build/build b/ceph-dev-setup/build/build index bf94b27d..ed60f796 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_and_dist ${FLAVOR} ${DIST} +ceph_build_args_from_flavor ${FLAVOR} # 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 ba5005f2..f5a255b9 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -821,11 +821,9 @@ 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_and_dist() { +ceph_build_args_from_flavor() { local flavor=$1 shift - local dist=$1 - shift # shellcheck disable=SC2034 case "${flavor}" in @@ -838,17 +836,16 @@ ceph_build_args_from_flavor_and_dist() { # - 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 + # + # do not specify -DALLOCATOR=tcmalloc in CEPH_EXTRA_CMAKE_ARGS, and let + # cmake figure it out: + # - on quincy and up, gperftools 2.6.2 is required, so we are not + # impacted by https://tracker.ceph.com/issues/39703. and cmake uses + # tcmalloc if gperftools 2.6.2 and up is found. on bionic, cmake + # falls back to libc allocator. + # - before quincy, since ALLOCATOR is not specified, cmake uses + # tcmalloc as long as gperftools is found, and the fix of + # https://tracker.ceph.com/issues/39703 is still not removed. ;; crimson) CEPH_EXTRA_RPMBUILD_ARGS="--with seastar" -- 2.39.5