SERVER-114232 Make opt out env var for bazel wrapper output redirects (#44258)

GitOrigin-RevId: 6382190b107ea50ec726a016bd4234594313e43e
This commit is contained in:
Daniel Moody 2025-11-20 18:07:07 -06:00 committed by MongoDB Bot
parent d8a57b8b9d
commit 4f26e918f5
3 changed files with 7 additions and 4 deletions

View File

@ -27,4 +27,5 @@ BAZEL_BINARY=bazel
echo "python buildscripts/install_bazel.py" >bazel-invocation.txt echo "python buildscripts/install_bazel.py" >bazel-invocation.txt
echo " bazel coverage ${args} ${target}" >>bazel-invocation.txt echo " bazel coverage ${args} ${target}" >>bazel-invocation.txt
export MONGO_WRAPPER_OUTPUT_ALL=1
$BAZEL_BINARY coverage ${args} ${target} $BAZEL_BINARY coverage ${args} ${target}

View File

@ -14,6 +14,7 @@ else
fi fi
activate_venv activate_venv
export MONGO_WRAPPER_OUTPUT_ALL=1
# number of parallel jobs to use for build. # number of parallel jobs to use for build.
# Even with scale=0 (the default), bc command adds decimal digits in case of multiplication. Division by 1 gives us a whole number with scale=0 # Even with scale=0 (the default), bc command adds decimal digits in case of multiplication. Division by 1 gives us a whole number with scale=0
bazel_jobs=$(bc <<<"$(grep -c '^processor' /proc/cpuinfo) * .85 / 1") bazel_jobs=$(bc <<<"$(grep -c '^processor' /proc/cpuinfo) * .85 / 1")

View File

@ -145,7 +145,7 @@ if [ "$skip_python" == "1" ]; then
fi fi
if [[ "$SLOW_PATH" == "1" ]]; then if [[ "$SLOW_PATH" == "1" ]] && [[ -z "${MONGO_WRAPPER_OUTPUT_ALL}" ]]; then
ORIGINAL_ARGS=("$@") ORIGINAL_ARGS=("$@")
# Save original terminal output FDs # Save original terminal output FDs
@ -293,8 +293,9 @@ if [[ $autocomplete_query == 1 ]]; then
else else
trap 'cleanup_logfile' EXIT trap 'cleanup_logfile' EXIT
# Slow path: restore stdout/stderr so Bazel prints normally # Slow path: restore stdout/stderr so Bazel prints normally
exec 1>&3 2>&4 if [[ -z "${MONGO_WRAPPER_OUTPUT_ALL}" ]]; then
exec 1>&3 2>&4
fi
$bazel_real "${new_args[@]}" $bazel_real "${new_args[@]}"
bazel_exit_code=$? bazel_exit_code=$?