From 30067a8766e1251b069cf5c904ae020c813537c3 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Sun, 21 Dec 2025 12:28:06 +0200 Subject: [PATCH 1/2] ceph-dev-new-setup/build: cleanup *-debug branches The newly introduced "debug" flavor from https://github.com/ceph/ceph-build/pull/2497 can be used instead. Add "DWITH_CEPH_DEBUG_MUTEX" to preserve existing *-debug behavior. Signed-off-by: Matan Breizman --- ceph-dev-new-setup/build/build | 22 ---------------------- ceph-dev-pipeline/build/Jenkinsfile | 2 +- scripts/build_utils.sh | 2 +- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/ceph-dev-new-setup/build/build b/ceph-dev-new-setup/build/build index a3623bb71..b5fa4425e 100644 --- a/ceph-dev-new-setup/build/build +++ b/ceph-dev-new-setup/build/build @@ -64,28 +64,6 @@ else echo "forcing." fi -# This is a dev release, enable some debug cmake configs. Note: it has been -# this way since at least 35e1a715. It's difficult to tell when or even if ceph -# was ever properly built with debugging configurations for QA as there are -# corresponding changes in ceph with the switch to cmake which makes this -# challenging to evaluate. -# -# It's likely that it was wrongly assumed that cmake would set the build type -# to Debug because the ".git" directory would be present. This is not the case -# because the "make-dist" script (executed below) creates a git tarball that is -# used for the actual untar/build. See also: -# -# https://github.com/ceph/ceph/pull/53800 -# -# Addendum and possibly temporary restriction: only enable these for branches -# ending in "-debug". -if [[ "$BRANCH" == *-debug ]]; then - CEPH_EXTRA_CMAKE_ARGS+=" -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON" - printf 'Added debug cmake configs to branch %s. CEPH_EXTRA_CMAKE_ARGS: %s\n' "$BRANCH" "$CEPH_EXTRA_CMAKE_ARGS" -else - printf 'No cmake debug options added to branch %s.\n' "$BRANCH" -fi - # Tentacle is the last release that needs dedicated Crimson builds, # Later releases are able to use Crimson with the default build. # As the "Crimson flavor" is no longer available, we need a *temporary* way diff --git a/ceph-dev-pipeline/build/Jenkinsfile b/ceph-dev-pipeline/build/Jenkinsfile index 94d047a1c..2df1cd197 100644 --- a/ceph-dev-pipeline/build/Jenkinsfile +++ b/ceph-dev-pipeline/build/Jenkinsfile @@ -449,7 +449,7 @@ pipeline { } break case "debug": - ceph_extra_cmake_args += " -DCMAKE_BUILD_TYPE=Debug" + ceph_extra_cmake_args += " -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON" break default: println "FLAVOR=${env.FLAVOR} is invalid" diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 3c8b1f7c8..e8a150c79 100755 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -885,7 +885,7 @@ ceph_build_args_from_flavor() { DEB_BUILD_PROFILES="" ;; debug) - CEPH_EXTRA_CMAKE_ARGS+=" -DCMAKE_BUILD_TYPE=Debug" + CEPH_EXTRA_CMAKE_ARGS+=" -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON" ;; *) echo "unknown FLAVOR: ${FLAVOR}" >&2 From 968c5375ebdc75ddfc727eb79f2de76a856fc405 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Sun, 21 Dec 2025 12:47:45 +0200 Subject: [PATCH 2/2] ceph-dev-pipeline, build_utils: cleanup case switch The only two flavors are default and debug. The debug case should apply additional flags on top of the defualt ones. There's no need for case switch. Signed-off-by: Matan Breizman --- ceph-dev-pipeline/build/Jenkinsfile | 25 +++++++++++-------------- scripts/build_utils.sh | 25 ++++++++++++------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/ceph-dev-pipeline/build/Jenkinsfile b/ceph-dev-pipeline/build/Jenkinsfile index 2df1cd197..9b05dc1b1 100644 --- a/ceph-dev-pipeline/build/Jenkinsfile +++ b/ceph-dev-pipeline/build/Jenkinsfile @@ -440,20 +440,17 @@ pipeline { } def ceph_extra_cmake_args = ""; def deb_build_profiles = ""; - switch (env.FLAVOR) { - case "default": - ceph_extra_cmake_args += " -DALLOCATOR=tcmalloc" - ceph_extra_cmake_args += " -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON" - if (os.version_name == "focal") { - ceph_extra_cmake_args += " -DWITH_STATIC_LIBSTDCXX=ON" - } - break - case "debug": - ceph_extra_cmake_args += " -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON" - break - default: - println "FLAVOR=${env.FLAVOR} is invalid" - assert false + ceph_extra_cmake_args += " -DALLOCATOR=tcmalloc" + ceph_extra_cmake_args += " -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON" + if (os.version_name == "focal") { + ceph_extra_cmake_args += " -DWITH_STATIC_LIBSTDCXX=ON" + } + if (env.FLAVOR == "debug") { + ceph_extra_cmake_args += " -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON" + } + if (env.FLAVOR != "default" && env.FLAVOR != "debug") { + println "FLAVOR=${env.FLAVOR} is invalid" + assert false } bwc_command = "${bwc_command} ${bwc_cmd_sccache_flags}" if ( os.pkg_type == "deb" ) { diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index e8a150c79..2868232ce 100755 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -876,22 +876,21 @@ ceph_build_args_from_flavor() { shift # shellcheck disable=SC2034 - case "${flavor}" in - default) - CEPH_EXTRA_RPMBUILD_ARGS="--with tcmalloc" - CEPH_EXTRA_CMAKE_ARGS+=" -DALLOCATOR=tcmalloc" - # build boost with valgrind=on for https://tracker.ceph.com/issues/56500 - CEPH_EXTRA_CMAKE_ARGS+=" -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON" - DEB_BUILD_PROFILES="" - ;; - debug) + CEPH_EXTRA_RPMBUILD_ARGS="--with tcmalloc" + CEPH_EXTRA_CMAKE_ARGS+=" -DALLOCATOR=tcmalloc" + # build boost with valgrind=on for https://tracker.ceph.com/issues/56500 + CEPH_EXTRA_CMAKE_ARGS+=" -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON" + DEB_BUILD_PROFILES="" + + if [[ "$flavor" == "debug" ]]; then CEPH_EXTRA_CMAKE_ARGS+=" -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON" - ;; - *) + fi + + if [[ "$flavor" != "default" && "$flavor" != "debug" ]]; then echo "unknown FLAVOR: ${FLAVOR}" >&2 exit 1 - esac -} + fi + write_dist_files() {