SERVER-98649 Enable minimal debug in benchmark CI builds (#30510)

GitOrigin-RevId: 333c8b89d719acddae321f50da13e6a8ecdd9ae2
This commit is contained in:
Zack Winter 2024-12-18 22:07:09 -08:00 committed by MongoDB Bot
parent 77420b9422
commit de92d5851f
4 changed files with 12 additions and 7 deletions

View File

@ -349,14 +349,12 @@ add_option(
type="choice",
)
add_option(
"debug-symbols",
choices=["on", "off"],
const="on",
choices=["on", "off", "minimal"],
default=build_profile.debug_symbols,
help="Enable producing debug symbols",
nargs="?",
nargs=1,
type="choice",
)
@ -2146,7 +2144,7 @@ env.AddMethod(is_toolchain, "ToolchainIs")
releaseBuild = get_option("release") == "on"
debugBuild = get_option("dbg") == "on"
debug_symbols = get_option("debug-symbols") == "on"
debug_symbols = get_option("debug-symbols") != "off"
optBuild = mongo_generators.get_opt_options(env)
if env.get("ENABLE_BUILD_RETRY"):
@ -4700,8 +4698,10 @@ def doConfigure(myenv):
# Turn off debug symbols. Due to g0 disabling any previously added debugging flags,
# it is easier to append g0 near the end rather than trying to not add all the other
# debug flags. This should be added after any debug flags.
if not debug_symbols:
if get_option("debug-symbols") == "off":
myenv.AppendUnique(LINKFLAGS=["-g0"], CCFLAGS=["-g0"])
elif get_option("debug-symbols") == "minimal":
myenv.AppendUnique(LINKFLAGS=["-g1"], CCFLAGS=["-g1"])
# Our build is already parallel.
if not myenv.AddToLINKFLAGSIfSupported("-Wl,--no-threads"):

View File

@ -253,6 +253,8 @@ buildvariants:
MONGO_DISTMOD=amazon2
-j$(grep -c ^processor /proc/cpuinfo)
--variables-files=etc/scons/mongodbtoolchain_stable_gcc.vars
--debug-symbols=minimal
separate_debug: off
scons_cache_scope: shared
compile_variant: *al2023-arm64-sep-benchmark
tasks:

View File

@ -387,6 +387,8 @@ buildvariants:
MONGO_DISTMOD=rhel88
-j$(grep -c ^processor /proc/cpuinfo)
--variables-files=etc/scons/mongodbtoolchain_stable_gcc.vars
--debug-symbols=minimal
separate_debug: off
scons_cache_scope: shared
num_scons_link_jobs_available: 0.5
compile_variant: *enterprise-rhel-8-benchmarks

View File

@ -1289,7 +1289,8 @@ def generate(env: SCons.Environment.Environment) -> None:
f"--compiler_type={env.ToolchainName()}",
f'--opt={env.GetOption("opt")}',
f'--dbg={env.GetOption("dbg") == "on"}',
f'--debug_symbols={env.GetOption("debug-symbols") == "on"}',
f'--debug_symbols={env.GetOption("debug-symbols") != "off"}',
f'--dbg_level={1 if env.GetOption("debug-symbols") == "minimal" else 2}',
f'--thin_lto={env.GetOption("thin-lto") is not None}',
f'--separate_debug={True if env.GetOption("separate-debug") == "on" else False}',
f'--libunwind={env.GetOption("use-libunwind")}',