Skip to content

Commit 1fc5909

Browse files
committed
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 <mbreizma@redhat.com>
1 parent 30067a8 commit 1fc5909

File tree

2 files changed

+23
-27
lines changed

2 files changed

+23
-27
lines changed

ceph-dev-pipeline/build/Jenkinsfile

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -440,20 +440,17 @@ pipeline {
440440
}
441441
def ceph_extra_cmake_args = "";
442442
def deb_build_profiles = "";
443-
switch (env.FLAVOR) {
444-
case "default":
445-
ceph_extra_cmake_args += " -DALLOCATOR=tcmalloc"
446-
ceph_extra_cmake_args += " -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON"
447-
if (os.version_name == "focal") {
448-
ceph_extra_cmake_args += " -DWITH_STATIC_LIBSTDCXX=ON"
449-
}
450-
break
451-
case "debug":
452-
ceph_extra_cmake_args += " -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON"
453-
break
454-
default:
455-
println "FLAVOR=${env.FLAVOR} is invalid"
456-
assert false
443+
ceph_extra_cmake_args += " -DALLOCATOR=tcmalloc"
444+
ceph_extra_cmake_args += " -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON"
445+
if (os.version_name == "focal") {
446+
ceph_extra_cmake_args += " -DWITH_STATIC_LIBSTDCXX=ON"
447+
}
448+
if (env.FLAVOR == "debug") {
449+
ceph_extra_cmake_args += " -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON"
450+
}
451+
if (env.FLAVOR != "default" && env.FLAVOR != "debug") {
452+
println "FLAVOR=${env.FLAVOR} is invalid"
453+
assert false
457454
}
458455
bwc_command = "${bwc_command} ${bwc_cmd_sccache_flags}"
459456
if ( os.pkg_type == "deb" ) {

scripts/build_utils.sh

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -876,21 +876,20 @@ ceph_build_args_from_flavor() {
876876
shift
877877

878878
# shellcheck disable=SC2034
879-
case "${flavor}" in
880-
default)
881-
CEPH_EXTRA_RPMBUILD_ARGS="--with tcmalloc"
882-
CEPH_EXTRA_CMAKE_ARGS+=" -DALLOCATOR=tcmalloc"
883-
# build boost with valgrind=on for https://tracker.ceph.com/issues/56500
884-
CEPH_EXTRA_CMAKE_ARGS+=" -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON"
885-
DEB_BUILD_PROFILES=""
886-
;;
887-
debug)
879+
CEPH_EXTRA_RPMBUILD_ARGS="--with tcmalloc"
880+
CEPH_EXTRA_CMAKE_ARGS+=" -DALLOCATOR=tcmalloc"
881+
# build boost with valgrind=on for https://tracker.ceph.com/issues/56500
882+
CEPH_EXTRA_CMAKE_ARGS+=" -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON"
883+
DEB_BUILD_PROFILES=""
884+
885+
if [[ "$flavor" == "debug" ]]; then
888886
CEPH_EXTRA_CMAKE_ARGS+=" -DCMAKE_BUILD_TYPE=Debug -DWITH_CEPH_DEBUG_MUTEX=ON"
889-
;;
890-
*)
891-
echo "unknown FLAVOR: ${FLAVOR}" >&2
887+
fi
888+
889+
if [[ "$flavor" != "default" && "$flavor" != "debug" ]]; then
890+
echo "unknown FLAVOR: ${FLAVOR}" >&2"
892891
exit 1
893-
esac
892+
fi
894893
}
895894
896895
write_dist_files()

0 commit comments

Comments
 (0)