mirror of https://github.com/mongodb/mongo
GitOrigin-RevId: b06196ad7be2038227e22380e991b18f1e51409c
This commit is contained in:
parent
1fc18a6756
commit
7b146667c8
20
.bazelrc
20
.bazelrc
|
|
@ -7,10 +7,6 @@ info --config=local
|
||||||
# Don't use legacy toolchain resolution.
|
# Don't use legacy toolchain resolution.
|
||||||
build --incompatible_enable_cc_toolchain_resolution
|
build --incompatible_enable_cc_toolchain_resolution
|
||||||
|
|
||||||
# Improves build performance after first clean pull by
|
|
||||||
# about 1 minute on developer machines
|
|
||||||
build --experimental_remote_merkle_tree_cache
|
|
||||||
|
|
||||||
# This makes builds more hermetic by preventing environment variables from leaking into the execution of rules
|
# This makes builds more hermetic by preventing environment variables from leaking into the execution of rules
|
||||||
build --incompatible_strict_action_env=true
|
build --incompatible_strict_action_env=true
|
||||||
|
|
||||||
|
|
@ -112,8 +108,6 @@ build --flag_alias=dbg_level=//bazel/config:dbg_level
|
||||||
|
|
||||||
# The 'default' build profile - should match all the settings of a profile, currently fastbuild
|
# The 'default' build profile - should match all the settings of a profile, currently fastbuild
|
||||||
build -c fastbuild
|
build -c fastbuild
|
||||||
build --fission=yes
|
|
||||||
build --remote_download_regex=.*\.dwo$
|
|
||||||
build --//bazel/config:opt=off
|
build --//bazel/config:opt=off
|
||||||
build --//bazel/config:dbg=True
|
build --//bazel/config:dbg=True
|
||||||
build --//bazel/config:dbg_level=1
|
build --//bazel/config:dbg_level=1
|
||||||
|
|
@ -128,8 +122,6 @@ build --enable_platform_specific_config=true
|
||||||
|
|
||||||
# Profile for building fast with minimal debuggability - the build is fast ##################################################
|
# Profile for building fast with minimal debuggability - the build is fast ##################################################
|
||||||
build:fastbuild -c fastbuild
|
build:fastbuild -c fastbuild
|
||||||
build:fastbuild --fission=yes
|
|
||||||
build:fastbuild --remote_download_regex=.*\.dwo$
|
|
||||||
build:fastbuild --//bazel/config:opt=off
|
build:fastbuild --//bazel/config:opt=off
|
||||||
build:fastbuild --//bazel/config:dbg=True
|
build:fastbuild --//bazel/config:dbg=True
|
||||||
build:fastbuild --//bazel/config:dbg_level=1
|
build:fastbuild --//bazel/config:dbg_level=1
|
||||||
|
|
@ -144,9 +136,7 @@ build:fastbuild --enable_platform_specific_config=true
|
||||||
|
|
||||||
# Profile for building highly debuggable code - the build is slow, the code is slow, the binaries are large #################
|
# Profile for building highly debuggable code - the build is slow, the code is slow, the binaries are large #################
|
||||||
build:dbg -c dbg
|
build:dbg -c dbg
|
||||||
build:dbg --fission=yes
|
build:dbg --//bazel/config:opt=debug
|
||||||
build:dbg --remote_download_regex=.*\.dwo$
|
|
||||||
build:dbg --//bazel/config:opt=off
|
|
||||||
build:dbg --//bazel/config:dbg=True
|
build:dbg --//bazel/config:dbg=True
|
||||||
build:dbg --//bazel/config:dbg_level=2
|
build:dbg --//bazel/config:dbg_level=2
|
||||||
build:dbg --//bazel/config:debug_symbols=True
|
build:dbg --//bazel/config:debug_symbols=True
|
||||||
|
|
@ -160,15 +150,15 @@ build:dbg --enable_platform_specific_config=true
|
||||||
|
|
||||||
# Build with address and undefined sanitizers
|
# Build with address and undefined sanitizers
|
||||||
build:dbg_aubsan --config=dbg
|
build:dbg_aubsan --config=dbg
|
||||||
build:dbg_aubsan --//bazel/config:opt=debug
|
build:dbg_aubsan --//bazel/config:linkstatic=False
|
||||||
build:dbg_aubsan --//bazel/config:allocator=system
|
build:dbg_aubsan --//bazel/config:allocator=system
|
||||||
build:dbg_aubsan --//bazel/config:asan=True
|
build:dbg_aubsan --//bazel/config:asan=True
|
||||||
build:dbg_aubsan --//bazel/config:ubsan=True
|
build:dbg_aubsan --//bazel/config:ubsan=True
|
||||||
|
build:dbg_aubsan --//bazel/config:skip_archive=False
|
||||||
build:dbg_aubsan --enable_platform_specific_config=true
|
build:dbg_aubsan --enable_platform_specific_config=true
|
||||||
|
|
||||||
# Build with thread sanitizers
|
# Build with thread sanitizers
|
||||||
build:dbg_tsan --config=dbg
|
build:dbg_tsan --config=dbg
|
||||||
build:dbg_tsan --//bazel/config:opt=debug
|
|
||||||
build:dbg_tsan --//bazel/config:linkstatic=False
|
build:dbg_tsan --//bazel/config:linkstatic=False
|
||||||
build:dbg_tsan --//bazel/config:allocator=system
|
build:dbg_tsan --//bazel/config:allocator=system
|
||||||
build:dbg_tsan --//bazel/config:tsan=True
|
build:dbg_tsan --//bazel/config:tsan=True
|
||||||
|
|
@ -179,8 +169,6 @@ build:dbg_tsan --enable_platform_specific_config=true
|
||||||
|
|
||||||
# Profile for building optimized code - the build is slow, the code is fast #################################################
|
# Profile for building optimized code - the build is slow, the code is fast #################################################
|
||||||
build:opt -c opt
|
build:opt -c opt
|
||||||
build:opt --fission=yes
|
|
||||||
build:opt --remote_download_regex=.*\.dwo$
|
|
||||||
build:opt --//bazel/config:opt=on
|
build:opt --//bazel/config:opt=on
|
||||||
build:opt --//bazel/config:dbg=False
|
build:opt --//bazel/config:dbg=False
|
||||||
build:opt --//bazel/config:dbg_level=2
|
build:opt --//bazel/config:dbg_level=2
|
||||||
|
|
@ -326,7 +314,7 @@ build:public-release --legacy_important_outputs
|
||||||
|
|
||||||
--config=fission
|
--config=fission
|
||||||
build:fission --fission=yes
|
build:fission --fission=yes
|
||||||
build:fission --remote_download_regex=.*\.dwo$
|
build:fission --remote_download_all
|
||||||
|
|
||||||
# Avoid failing builds when BES metadata fails to upload.
|
# Avoid failing builds when BES metadata fails to upload.
|
||||||
common --bes_upload_mode=fully_async
|
common --bes_upload_mode=fully_async
|
||||||
|
|
|
||||||
|
|
@ -1411,7 +1411,6 @@ def generate(env: SCons.Environment.Environment) -> None:
|
||||||
f"MONGO_DISTMOD={env['MONGO_DISTMOD']}",
|
f"MONGO_DISTMOD={env['MONGO_DISTMOD']}",
|
||||||
"--compilation_mode=dbg", # always build this compilation mode as we always build with -g
|
"--compilation_mode=dbg", # always build this compilation mode as we always build with -g
|
||||||
"--dynamic_mode=off",
|
"--dynamic_mode=off",
|
||||||
"--fission=no",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Timeout linking at 8 minutes to retry with a lower concurrency.
|
# Timeout linking at 8 minutes to retry with a lower concurrency.
|
||||||
|
|
|
||||||
34
tools/bazel
34
tools/bazel
|
|
@ -10,40 +10,6 @@ bazel_real="$BAZEL_REAL"
|
||||||
echo $BAZEL_REAL > ".bazel_real"
|
echo $BAZEL_REAL > ".bazel_real"
|
||||||
bazelrc_xcode_lines=()
|
bazelrc_xcode_lines=()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# If disk space becomes an issue, this block can be used to clean up configs
|
|
||||||
# when disk space is getting low. It is commented out because "bazel info output_path"
|
|
||||||
# takes .5 seconds, and no need to add that extra time unless disk space becomes a large
|
|
||||||
# problem
|
|
||||||
|
|
||||||
#if [ $# -eq 2 ] || [ $# -eq 3 ]; then
|
|
||||||
# if [ "$1" = "build" ]; then
|
|
||||||
# output_path=$($bazel_real info output_path)
|
|
||||||
# remaining_kb=$(df --output=avail $output_path | tail -n 1)
|
|
||||||
# remaining_gb=$(($remaining_kb / 1024 / 1024))
|
|
||||||
# fastbuild_dir=${output_path}/aarch64-fastbuild
|
|
||||||
# dbg_dir=${output_path}/aarch64-dbg
|
|
||||||
# opt_dir=${output_path}/aarch64-opt
|
|
||||||
# if [ "$remaining_gb" -lt 40 ]; then
|
|
||||||
# echo "Disk space is getting low (under 40GB) - cleaning up other config outputs"
|
|
||||||
# if [ $# -eq 2 ]; then
|
|
||||||
# rm -rf "$dbg_dir" &>/dev/null
|
|
||||||
# rm -rf "$opt_dir" &>/dev/null
|
|
||||||
# elif [[ "$2" == "--config=fastbuild"* ]]; then
|
|
||||||
# rm -rf "$dbg_dir" &>/dev/null
|
|
||||||
# rm -rf "$opt_dir" &>/dev/null
|
|
||||||
# elif [[ "$2" == "--config=dbg"* ]]; then
|
|
||||||
# rm -rf "$fastbuild_dir" &>/dev/null
|
|
||||||
# rm -rf "$opt_dir" &>/dev/null
|
|
||||||
# elif [[ "$2" == "--config=opt"* ]]; then
|
|
||||||
# rm -rf "$fastbuild_dir" &>/dev/null
|
|
||||||
# rm -rf "$dbg_dir" &>/dev/null
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
#fi
|
|
||||||
|
|
||||||
if [[ -z "${BAZELISK_SKIP_WRAPPER}" ]]; then
|
if [[ -z "${BAZELISK_SKIP_WRAPPER}" ]]; then
|
||||||
echo "You're not using Bazelisk, which is recommended for a consistent build environment." >&2
|
echo "You're not using Bazelisk, which is recommended for a consistent build environment." >&2
|
||||||
echo "Your version of Bazel may be mismatched with the version intended to be used to build MongoDB." >&2
|
echo "Your version of Bazel may be mismatched with the version intended to be used to build MongoDB." >&2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue