SERVER-112966 put release config at the end of the bazel commands (#43152)

GitOrigin-RevId: ba70b6a13fda907977110bf46e6c8137f5de48f6
This commit is contained in:
Daniel Moody 2025-10-24 23:39:06 -05:00 committed by MongoDB Bot
parent d35c8be0a5
commit 6649991c99
3 changed files with 6 additions and 7 deletions

View File

@ -142,13 +142,13 @@ LOCAL_ARG="$(bazel_evergreen_shutils::compute_local_arg build)"
# build on the waterfall, then we don't need the --release
# flag. Otherwise, this is potentially a build that "leaves
# the building", so we do want that flag.
LOCAL_ARG="$(bazel_evergreen_shutils::maybe_release_flag "$LOCAL_ARG")"
RELEASE_FLAG="$(bazel_evergreen_shutils::maybe_release_flag)"
# Ensure server is up and print PID
bazel_evergreen_shutils::ensure_server_and_print_pid "$BAZEL_BINARY"
# Build flags line
ALL_FLAGS="--verbose_failures ${LOCAL_ARG} ${bazel_args:-} ${bazel_compile_flags:-} ${task_compile_flags:-} --define=MONGO_VERSION=${version} ${patch_compile_flags:-}"
ALL_FLAGS="--verbose_failures ${LOCAL_ARG} ${bazel_args:-} ${bazel_compile_flags:-} ${task_compile_flags:-} --define=MONGO_VERSION=${version} $RELEASE_FLAG ${patch_compile_flags:-}"
echo "${ALL_FLAGS}" > .bazel_build_flags
set +o errexit

View File

@ -115,11 +115,10 @@ bazel_evergreen_shutils::extract_config_flags() {
# Adds --config=public-release if this is a release-ish build.
bazel_evergreen_shutils::maybe_release_flag() {
local local_arg="$1"
if [[ "${is_patch:-}" == "true" || -z "${push_bucket:-}" || "${compiling_for_test:-}" == "true" ]]; then
echo "$local_arg" # non-release
echo "" # non-release
else
echo "$local_arg --config=public-release"
echo "--config=public-release"
fi
}

View File

@ -29,13 +29,13 @@ LOCAL_ARG="$(bazel_evergreen_shutils::compute_local_arg test)"
# build on the waterfall, then we don't need the --release
# flag. Otherwise, this is potentially a build that "leaves
# the building", so we do want that flag.
LOCAL_ARG="$(bazel_evergreen_shutils::maybe_release_flag "$LOCAL_ARG")"
RELEASE_FLAG="$(bazel_evergreen_shutils::maybe_release_flag)"
# Possibly scale test timeout and append to bazel_args
bazel_evergreen_shutils::maybe_scale_test_timeout_and_append
# Build the shared flags and persist the --config subset
ALL_FLAGS="--verbose_failures ${LOCAL_ARG} ${bazel_args:-} ${bazel_compile_flags:-} ${task_compile_flags:-} --define=MONGO_VERSION=${version} ${patch_compile_flags:-}"
ALL_FLAGS="--verbose_failures ${LOCAL_ARG} ${bazel_args:-} ${bazel_compile_flags:-} ${task_compile_flags:-} --define=MONGO_VERSION=${version} $RELEASE_FLAG ${patch_compile_flags:-}"
echo "${ALL_FLAGS}" > .bazel_build_flags
# to capture exit codes