2023-08-04 12:53:37 +00:00
# Reference docs: https://bazel.build/run/bazelrc
2023-08-15 15:50:02 +00:00
2024-04-30 00:36:06 -05:00
# coverity need to use the local command without remote execution auto
# enabled.
info --config=local
2024-08-15 23:05:05 +02:00
# Don't use legacy toolchain resolution.
2025-01-06 14:11:11 -08:00
common --incompatible_enable_cc_toolchain_resolution
2025-03-17 22:10:13 -04:00
# https://github.com/bazelbuild/bazel/issues/8766
# there is WIP to allow users to inject constraints
# this flag is required because the default for BZLMOD is @platform//host:host
build --platforms=@internal_platforms_do_not_use//host
common --enable_workspace=true
2024-08-15 23:05:05 +02:00
2024-12-31 12:03:10 -08:00
# Improves build performance after first clean pull by
# about 1 minute on developer machines
2025-01-06 14:11:11 -08:00
common --experimental_remote_merkle_tree_cache
2024-12-31 12:03:10 -08:00
2025-03-27 10:17:17 -07:00
# Linter will have issues with duplicate configurations due to some of our
# install targets depending on tests that have testonly set. This flag can be removed
# if we stop installing our test targets.
common --experimental_retain_test_configuration_across_testonly
2025-01-02 21:23:56 -06:00
# allow multiple execution infos to be set
2025-01-06 14:11:11 -08:00
common --incompatible_modify_execution_info_additive
2025-01-02 21:23:56 -06:00
2023-08-15 16:44:06 +00:00
# This makes builds more hermetic by preventing environment variables from leaking into the execution of rules
2025-01-06 14:11:11 -08:00
common --incompatible_strict_action_env=true
2023-08-15 16:44:06 +00:00
2023-11-28 22:20:17 +00:00
# allows us to use python rules. This is needed because of the bug:
# https://github.com/bazelbuild/bazel/issues/4327
2025-01-06 14:11:11 -08:00
common --experimental_inprocess_symlink_creation
2023-11-28 22:20:17 +00:00
2024-01-26 20:22:18 -08:00
# cc_library transitively propagates link opts. The build uses cc_shared_library to avoid this when linking
# dynamically.
2025-01-06 14:11:11 -08:00
common --experimental_cc_shared_library
2024-01-26 20:22:18 -08:00
2024-08-23 23:21:36 +02:00
# Reuse sandboxes to save sandbox execution and deletion times.
2025-01-06 14:11:11 -08:00
common --experimental_reuse_sandbox_directories
2024-08-23 23:21:36 +02:00
2025-06-18 09:59:26 -05:00
# Disabling runfiles links drastically increases performance in slow disk IO situations
# Do not build runfile trees by default. If an execution strategy relies on runfile
# symlink tree, the tree is created on-demand. See: https://github.com/bazelbuild/bazel/issues/6627
# and https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df
common --nobuild_runfile_links
# This will become the default bazel 8.0+
# https://bazel.build/reference/command-line-reference#flag--legacy_external_runfiles
common --nolegacy_external_runfiles
2025-05-19 14:50:11 -07:00
# Seeing as we link locally, you'll end up with 99% of the files locally anyways.
# Using remote download all save some build time because it will immediately download an object
# file when it is available, where toplevel will wait until the local linking job needs it
# before starting the download.
common --remote_download_outputs=all
2025-01-08 14:39:08 -08:00
# Files we always want to download for debugging and error checking
2025-08-26 15:46:08 -07:00
common --remote_download_regex=.*\.(dwo|h|cpp|test.xml)$
2025-01-08 14:39:08 -08:00
2025-04-22 09:38:35 -07:00
# Disable caching of test results by default since many of our tests are non-deterministic.
common --cache_test_results=no
2025-04-25 09:33:06 -04:00
# Stream the test output so users can see the test progression.
common --test_output=streamed
2025-05-02 16:04:36 -05:00
# when using remote asset api, fallback to the direct urls to download
common --experimental_remote_downloader_local_fallback
2025-04-30 13:26:23 -04:00
# Build only what is necessary to run the *_test and test_suite rules that were
# not filtered due to their size, timeout, tag, or language.
test --build_tests_only
2025-07-16 16:13:47 -04:00
# Skip zipping test outputs, to save the extra step of unzipping to investigate them.
test --nozip_undeclared_test_outputs
2025-07-14 09:14:07 -07:00
# This is a major bottleneck on remote execution concurrency and does not appear to have
# any negative affects on local RAM usage.
common --noexperimental_throttle_remote_action_building
2025-06-23 09:16:18 -04:00
# Port blocks that can be exclusively used by one test action at a time, representing
# a range of 250 ports up until the next block.
# The contract for acquiring is detailed in buildscripts/bazel_local_resources.py.
2025-08-07 16:12:46 -04:00
# "common" is used to avoid invalidating bazel's analysis cache when switching between
2025-07-24 12:05:03 -04:00
# build and test commands.
common --local_resources=port_block=40 # 40 distinct port blocks
common --define=LOCAL_RESOURCES="port_block=20000,20250,20500,20750,21000,21250,21500,21750,22000,22250,22500,22750,23000,23250,23500,23750,24000,24250,24500,24750,25000,25250,25500,25750,26000,26250,26500,26750,27000,27250,27500,27750,28000,28250,28500,28750,29000,29250,29500,29750"
2025-06-23 09:16:18 -04:00
2025-05-30 18:54:30 -04:00
# Pin down the OSS LLVM Clang version for MacOS builds.
common:macos --repo_env=LLVM_VERSION=19
2025-06-02 16:18:09 -04:00
# Pin down the Microsoft Visual compiler. If you would like to use
# the default compiler version installed in this host, comment the line.
common:windows --repo_env=BAZEL_VC_FULL_VERSION=14.31.31103
# Default the Visual C Redistribution to v14.3 for Windows installer.
common:windows --repo_env=MONGO_VC_REDIST_FULL_VERSION=v143
2025-01-09 14:21:30 -08:00
2024-10-22 06:44:07 +00:00
# while in hybrid build state, using local unsandboxed linking should be faster. When most of our link
# targets have been converted (i.e. unittest binaries) and we can BWOB, remote linking should be faster
# in those cases:
2025-01-06 14:11:11 -08:00
common --strategy=CppLink=local
common --strategy=CppArchive=local
common --strategy=SolibSymlink=local
common --strategy=StripDebuginfo=local
common --strategy=ExtractDebuginfo=local
common --strategy=TestRunner=local
2025-03-28 09:54:35 -07:00
common --strategy=CoverageReport=local
2025-04-28 10:29:10 -07:00
common --strategy=CcGenerateIntermediateDwp=local
common --strategy=CcGenerateDwp=local
common --modify_execution_info=^(TestRunner|CppLink|CppArchive|SolibSymlink|ExtractDebuginfo|StripDebuginfo|CcGenerateIntermediateDwp|CcGenerateDwp)$=+no-remote-cache
2024-10-22 06:44:07 +00:00
2025-06-02 17:44:32 -07:00
# Global clang tidy flags to avoid invalidating analysis cache between clang-tidy / regular runs
common --@bazel_clang_tidy//:clang_tidy_excludes=".pb.cc,icu_init.cpp"
2025-08-13 16:41:45 -05:00
common --@bazel_clang_tidy//:clang_tidy_additional_configs=//:clang_tidy_config_files
2025-06-02 17:44:32 -07:00
common --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config_strict
2025-08-13 16:41:45 -05:00
common --@bazel_clang_tidy//:clang_tidy_merge_tool=//bazel:merge_tidy_configs
2025-06-02 17:44:32 -07:00
common --@bazel_clang_tidy//:clang_tidy_executable=//:clang_tidy
common --@bazel_clang_tidy//:clang_tidy_additional_deps=//:toolchain_files
common --@bazel_clang_tidy//:clang_tidy_plugin_deps=//src/mongo/tools/mongo_tidy_checks:mongo_tidy_checks
2024-09-27 18:18:38 -04:00
# Aliases for config flags
2025-01-06 14:11:11 -08:00
common --flag_alias=linkstatic=//bazel/config:linkstatic
common --flag_alias=compiler_type=//bazel/config:compiler_type
common --flag_alias=linker=//bazel/config:linker
common --flag_alias=use_gdbserver=//bazel/config:use_gdbserver
common --flag_alias=libunwind=//bazel/config:libunwind
common --flag_alias=spider_monkey_dbg=//bazel/config:spider_monkey_dbg
common --flag_alias=allocator=//bazel/config:allocator
common --flag_alias=use_lldbserver=//bazel/config:use_lldbserver
common --flag_alias=opt=//bazel/config:opt
common --flag_alias=dbg=//bazel/config:dbg
common --flag_alias=debug_symbols=//bazel/config:debug_symbols
common --flag_alias=thin_lto=//bazel/config:thin_lto
common --flag_alias=separate_debug=//bazel/config:separate_debug
common --flag_alias=use_wait_for_debugger=//bazel/config:use_wait_for_debugger
common --flag_alias=use_ocsp_stapling=//bazel/config:use_ocsp_stapling
common --flag_alias=use_disable_ref_track=//bazel/config:use_disable_ref_track
common --flag_alias=use_wiredtiger=//bazel/config:use_wiredtiger
common --flag_alias=use_glibcxx_debug=//bazel/config:use_glibcxx_debug
common --flag_alias=use_tracing_profiler=//bazel/config:use_tracing_profiler
common --flag_alias=build_otel=//bazel/config:build_otel
2025-07-24 13:16:51 -04:00
common --flag_alias=mutex_observation=//bazel/config:mutex_observation
2025-01-06 14:11:11 -08:00
common --flag_alias=detect_odr_violations=//bazel/config:detect_odr_violations
common --flag_alias=shared_archive=//bazel/config:shared_archive
common --flag_alias=skip_archive=//bazel/config:skip_archive
common --flag_alias=streams_release_build=//bazel/config:streams_release_build
2025-02-14 16:26:02 -06:00
common --flag_alias=disable_streams=//bazel/config:disable_streams
2025-01-06 14:11:11 -08:00
common --flag_alias=release=//bazel/config:release
common --flag_alias=build_enterprise=//bazel/config:build_enterprise
common --flag_alias=visibility_support=//bazel/config:visibility_support
common --flag_alias=disable_warnings_as_errors=//bazel/config:disable_warnings_as_errors
common --flag_alias=gcov=//bazel/config:gcov
2025-07-16 12:25:15 -07:00
common --flag_alias=pgo_profile_generate=//bazel/config:pgo_profile_generate
common --flag_alias=pgo_profile_use=//bazel/config:pgo_profile_use
common --flag_alias=bolt_profile_generate=//bazel/config:bolt_profile_generate
common --flag_alias=bolt_profile_use=//bazel/config:bolt_profile_use
common --flag_alias=propeller_profile_generate=//bazel/config:propeller_profile_generate
common --flag_alias=propeller_profile_use=//bazel/config:propeller_profile_use
2025-01-06 14:11:11 -08:00
common --flag_alias=server_js=//bazel/config:server_js
common --flag_alias=ssl=//bazel/config:ssl
common --flag_alias=js_engine=//bazel/config:js_engine
common --flag_alias=use_sasl_client=//bazel/config:use_sasl_client
common --flag_alias=enterprise_feature_all=//bazel/config:enterprise_feature_all
common --flag_alias=link_timeout=//bazel/config:link_timeout
2025-01-30 15:07:12 -08:00
common --flag_alias=compress_debug_compile=//bazel/config:compress_debug_compile
2025-02-10 15:37:10 -08:00
common --flag_alias=include_mongot=//bazel/config:include_mongot
2025-02-14 10:35:12 -08:00
# This flag will only work if you pass it on the command line as it is parsed by bazelisk pre-bazel script
common --flag_alias=include_autogenerated_targets=//bazel/config:include_autogenerated_targets
2025-02-25 22:03:09 -06:00
common --flag_alias=bolt=//bazel/config:bolt
2025-01-06 14:11:11 -08:00
common --flag_alias=dwarf_version=//bazel/config:dwarf_version
common --flag_alias=http_client=//bazel/config:http_client
common --flag_alias=asan=//bazel/config:asan
common --flag_alias=fsan=//bazel/config:fsan
common --flag_alias=msan=//bazel/config:msan
common --flag_alias=lsan=//bazel/config:lsan
common --flag_alias=tsan=//bazel/config:tsan
common --flag_alias=ubsan=//bazel/config:ubsan
common --flag_alias=dbg_level=//bazel/config:dbg_level
2025-02-03 14:09:48 -08:00
common --flag_alias=mongo_toolchain_version=//bazel/config:mongo_toolchain_version
2025-04-22 10:41:12 -07:00
common --flag_alias=simple_build_id=//bazel/config:simple_build_id
2025-04-28 10:29:10 -07:00
common --flag_alias=create_dwp=//bazel/config:create_dwp
2025-06-09 18:24:20 -04:00
common --flag_alias=win_min_version=//bazel/config:win_min_version
2025-07-31 20:19:45 -05:00
common --flag_alias=build_atlas=//bazel/config:build_atlas
2025-08-19 11:47:11 -07:00
common --flag_alias=dtlto=//bazel/config:dtlto
2024-12-09 09:19:12 -08:00
#############################################################################################################################
# BUILD 'PROFILES' - this is the area to set up configurations of flags to be used by developers.
2025-08-07 16:12:46 -04:00
# --enable_platform_specific_config=true is passed to every profile so more hardware specific
2024-12-09 09:19:12 -08:00
# configurations can override the defaults in these profiles. These represent the only supported flag configurations,
# and should be the only thing passed on the command line in most scenarios
# Every profile should explicitly specify every option used by every other profile, with the exception of the
# profile modifiers
# The base profiles are fast, opt and debug - these reflect the output directories artifacts will get placed into
# and match the bazel compilation modes
# Should a profile modify another profile, it should be named {original_profile}_{modifier_name} - example fast_static
2025-01-03 14:38:07 -08:00
# You can use .bazelrc.local to modify the default build type you want to use locally
2024-12-09 09:19:12 -08:00
# Current Profiles:
# fastbuild
# dbg
# dbg_san
# dbg_tsan
# opt
2025-01-24 15:27:23 -08:00
# Bazel will by default strip on fastbuild, if we want stripping we will handle it ourselves
common --strip=never
2025-01-03 14:38:07 -08:00
# Current default profile - fastbuild - this matches the config options of fastbuild. It does not just set --config=fastbuild
# To avoid the bazel warning about passing multiple configs
2025-01-06 14:11:11 -08:00
common -c fastbuild
common --fission=yes
2025-03-27 10:17:17 -07:00
common --//bazel/config:dwarf_version=5
2025-01-30 15:07:12 -08:00
common --//bazel/config:compress_debug_compile=True
2025-01-06 14:11:11 -08:00
common --//bazel/config:opt=off
common --//bazel/config:dbg=True
common --//bazel/config:dbg_level=1
common --//bazel/config:debug_symbols=True
common --//bazel/config:separate_debug=False
common --//bazel/config:compiler_type=clang
2025-05-05 09:55:05 -07:00
common --//bazel/config:linker=mold
2025-01-06 14:11:11 -08:00
common --//bazel/config:linkstatic=True
common --//bazel/config:build_enterprise=True
common --//bazel/config:skip_archive=True
common --//bazel/config:allocator=auto
common --//bazel/config:asan=False
common --//bazel/config:tsan=False
common --//bazel/config:ubsan=False
common --//bazel/config:libunwind=auto
2025-09-02 15:29:09 -07:00
common --//bazel/config:dtlto=False
common --//bazel/config:pgo_profile_use=False
common --//bazel/config:bolt_profile_use=False
2025-01-30 09:32:51 -08:00
common --jobs=300
2025-01-06 14:11:11 -08:00
common:macos --jobs=auto
common:windows --jobs=auto
2025-01-09 14:21:30 -08:00
common --enable_platform_specific_config=true
2024-12-09 09:19:12 -08:00
# Profile for building fast with minimal debuggability - the build is fast ##################################################
2025-01-03 14:38:07 -08:00
--config=fastbuild
2025-01-06 14:11:11 -08:00
common:fastbuild -c fastbuild
common:fastbuild --fission=yes
2025-03-27 10:17:17 -07:00
common:fastbuild --//bazel/config:dwarf_version=5
2025-01-30 15:07:12 -08:00
common:fastbuild --//bazel/config:compress_debug_compile=True
2025-01-06 14:11:11 -08:00
common:fastbuild --//bazel/config:opt=off
common:fastbuild --//bazel/config:dbg=True
common:fastbuild --//bazel/config:dbg_level=1
common:fastbuild --//bazel/config:debug_symbols=True
common:fastbuild --//bazel/config:separate_debug=False
common:fastbuild --//bazel/config:compiler_type=clang
2025-05-05 09:55:05 -07:00
common:fastbuild --//bazel/config:linker=mold
2025-01-06 14:11:11 -08:00
common:fastbuild --//bazel/config:linkstatic=True
common:fastbuild --//bazel/config:build_enterprise=True
common:fastbuild --//bazel/config:skip_archive=True
common:fastbuild --//bazel/config:allocator=auto
common:fastbuild --//bazel/config:asan=False
common:fastbuild --//bazel/config:tsan=False
common:fastbuild --//bazel/config:ubsan=False
2025-09-02 15:29:09 -07:00
common:fastbuild --//bazel/config:dtlto=False
common:fastbuild --//bazel/config:pgo_profile_use=False
common:fastbuild --//bazel/config:bolt_profile_use=False
2025-01-06 14:11:11 -08:00
common:fastbuild --//bazel/config:libunwind=auto
common:fastbuild --enable_platform_specific_config=true
2024-12-09 09:19:12 -08:00
# Profile for building highly debuggable code - the build is slow, the code is slow, the binaries are large #################
2025-01-03 14:38:07 -08:00
--config=dbg
2025-01-06 14:11:11 -08:00
common:dbg -c dbg
common:dbg --fission=yes
2025-03-27 10:17:17 -07:00
common:dbg --//bazel/config:dwarf_version=5
2025-01-30 15:07:12 -08:00
common:dbg --//bazel/config:compress_debug_compile=True
2025-01-06 14:11:11 -08:00
common:dbg --//bazel/config:opt=off
common:dbg --//bazel/config:dbg=True
common:dbg --//bazel/config:dbg_level=2
common:dbg --//bazel/config:debug_symbols=True
common:dbg --//bazel/config:separate_debug=False
common:dbg --//bazel/config:compiler_type=clang
2025-05-29 12:50:04 -07:00
common:dbg --//bazel/config:linker=mold
2025-01-06 14:11:11 -08:00
common:dbg --//bazel/config:linkstatic=True
common:dbg --//bazel/config:build_enterprise=True
common:dbg --//bazel/config:skip_archive=True
common:dbg --//bazel/config:allocator=auto
common:dbg --//bazel/config:asan=False
common:dbg --//bazel/config:tsan=False
common:dbg --//bazel/config:ubsan=False
common:dbg --//bazel/config:libunwind=auto
2025-09-02 15:29:09 -07:00
common:dbg --//bazel/config:dtlto=False
common:dbg --//bazel/config:pgo_profile_use=False
common:dbg --//bazel/config:bolt_profile_use=False
2025-01-06 14:11:11 -08:00
common:dbg --enable_platform_specific_config=true
2024-12-09 09:19:12 -08:00
# Build with address and undefined sanitizers
2025-01-03 14:38:07 -08:00
--config=dbg_aubsan
2025-01-06 14:11:11 -08:00
common:dbg_aubsan --config=dbg
common:dbg_aubsan --//bazel/config:opt=debug
common:dbg_aubsan --//bazel/config:linkstatic=False
common:dbg_aubsan --//bazel/config:allocator=system
common:dbg_aubsan --//bazel/config:asan=True
common:dbg_aubsan --//bazel/config:ubsan=True
common:dbg_aubsan --enable_platform_specific_config=true
2024-12-09 09:19:12 -08:00
# Build with thread sanitizers
2025-01-03 14:38:07 -08:00
--config=dbg_tsan
2025-01-06 14:11:11 -08:00
common:dbg_tsan --config=dbg
common:dbg_tsan --//bazel/config:opt=debug
common:dbg_tsan --//bazel/config:linkstatic=False
common:dbg_tsan --//bazel/config:allocator=system
common:dbg_tsan --//bazel/config:tsan=True
common:dbg_tsan --//bazel/config:libunwind=off
common:dbg_tsan --//bazel/config:skip_archive=False
common:dbg_tsan --enable_platform_specific_config=true
2024-12-09 09:19:12 -08:00
# Profile for building optimized code - the build is slow, the code is fast #################################################
2025-01-03 14:38:07 -08:00
--config=opt
2025-01-06 14:11:11 -08:00
common:opt -c opt
common:opt --fission=yes
2025-03-27 10:17:17 -07:00
common:opt --//bazel/config:dwarf_version=5
2025-01-30 15:07:12 -08:00
common:opt --//bazel/config:compress_debug_compile=True
2025-01-06 14:11:11 -08:00
common:opt --//bazel/config:opt=on
common:opt --//bazel/config:dbg=False
common:opt --//bazel/config:dbg_level=2
common:opt --//bazel/config:debug_symbols=True
common:opt --//bazel/config:separate_debug=False
common:opt --//bazel/config:compiler_type=gcc
2025-05-05 09:55:05 -07:00
common:opt --//bazel/config:linker=auto
2025-01-06 14:11:11 -08:00
common:opt --//bazel/config:linkstatic=True
common:opt --//bazel/config:build_enterprise=True
common:opt --//bazel/config:skip_archive=True
common:opt --//bazel/config:allocator=auto
common:opt --//bazel/config:asan=False
common:opt --//bazel/config:tsan=False
common:opt --//bazel/config:ubsan=False
common:opt --//bazel/config:libunwind=auto
2025-09-02 15:29:09 -07:00
common:opt --//bazel/config:dtlto=False
common:opt --//bazel/config:pgo_profile_use=False
common:opt --//bazel/config:bolt_profile_use=False
2025-01-06 14:11:11 -08:00
common:opt --enable_platform_specific_config=true
2024-12-09 09:19:12 -08:00
2025-09-02 15:29:09 -07:00
--config=opt_profiled
common:opt_profiled --config=opt
common:opt_profiled --fission=no
common:opt_profiled --//bazel/config:separate_debug=True
common:opt_profiled --//bazel/config:compiler_type=clang
common:opt_profiled --//bazel/config:dtlto=True
common:opt_profiled --//bazel/config:pgo_profile_use=True
common:opt_profiled --//bazel/config:bolt_profile_use=True
common:opt_profiled --enable_platform_specific_config=true
2025-03-27 10:17:17 -07:00
--config=evg
common:evg --config=opt
2025-09-02 15:29:09 -07:00
common:evg --fission=no
2025-03-27 10:17:17 -07:00
common:evg --//bazel/config:opt=auto
common:evg --//bazel/config:separate_debug=True
2025-04-28 10:29:10 -07:00
common:evg --enable_platform_specific_config=true
2025-03-27 10:17:17 -07:00
--config=evg_crypt
common:evg_crypt --config=evg
common:evg_crypt --//bazel/config:allocator=system
common:evg_crypt --//bazel/config:js_engine=none
common:evg_crypt --//bazel/config:ssl=False
common:evg_crypt --//bazel/config:http_client=False
common:evg_crypt --//bazel/config:shared_archive=True
--config=evg_crypt_dbg
common:evg_crypt_dbg --config=evg_crypt
common:evg_crypt_dbg --//bazel/config:opt=off
common:evg_crypt_dbg --//bazel/config:dbg=True
--config=evg_crypt_test
common:evg_crypt_test --config=evg_crypt
common:evg_crypt_test --//bazel/config:shared_archive=False
2025-07-21 16:00:41 -05:00
2025-03-27 10:17:17 -07:00
--config=evg_stitch
common:evg_stitch --config=evg
common:evg_stitch --//bazel/config:build_enterprise=False
common:evg_stitch --//bazel/config:ssl=False
common:evg_stitch --//bazel/config:http_client=False
common:evg_stitch --//bazel/config:shared_archive=True
--config=evg_stitch_test
common:evg_stitch_test --config=evg_stitch
common:evg_stitch_test --//bazel/config:shared_archive=False
2024-12-09 09:19:12 -08:00
# TODO: Build the code as we would release it
2025-01-06 14:11:11 -08:00
# common:opt_release --config=opt
# common:opt_release --//bazel/config:separate_debug=True
# common:opt_release --//bazel/config:build_enterprise=True
# common:opt_release --//bazel/config:release=True
2024-12-09 09:19:12 -08:00
# TODO: Open Source community build flags
2025-08-07 16:12:46 -04:00
# common:community
2024-12-09 09:19:12 -08:00
#############################################################################################################################
2024-09-27 18:18:38 -04:00
2024-10-22 06:44:07 +00:00
--config=remote_link
2025-01-06 14:11:11 -08:00
common:remote_link --strategy=CppLink=remote
common:remote_link --strategy=CppArchive=remote
common:remote_link --strategy=SolibSymlink=remote
common:remote_link --strategy=ExtractDebugInfo=remote
common:remote_link --strategy=StripDebugInfo=remote
2025-08-13 14:33:51 -07:00
common:remote_link --//bazel/config:remote_link=True
2025-01-06 14:11:11 -08:00
common:remote_link --features=-thin_archive
2024-10-22 06:44:07 +00:00
2025-08-25 06:15:52 -07:00
--config=remote_test
common:remote_test --strategy=CppLink=remote
common:remote_test --strategy=CppArchive=remote
common:remote_test --strategy=SolibSymlink=remote
common:remote_test --strategy=ExtractDebugInfo=remote
common:remote_test --strategy=StripDebugInfo=remote
common:remote_test --//bazel/config:remote_link=True
common:remote_test --//bazel/config:remote_test=True
common:remote_test --strategy=TestRunner=remote
common:remote_test --features=-thin_archive
common:remote_test --remote_download_outputs=minimal
common:remote_test --test_output=summary
2025-08-26 15:46:08 -07:00
common:remote_test --modify_execution_info=^(CppLink|CppArchive|SolibSymlink|ExtractDebuginfo|StripDebuginfo|CcGenerateIntermediateDwp|CcGenerateDwp)$=-no-remote-cache
2025-09-17 14:46:32 -04:00
common:remote_test --remote_download_regex=.*(TestLogs.*|report.*\.json$|\.core$|data_archives.*\.tgz$) # Resmoke TestLogs directory, report, core dumps, and data directory archives.
2025-08-25 06:15:52 -07:00
test:remote_test --test_timeout=600
test:remote_test --test_tag_filters=-incompatible_with_bazel_remote_test
2025-01-10 12:18:13 -05:00
# Coverage
coverage --config=dbg
2025-01-13 11:34:11 -05:00
coverage --compiler_type=clang
2025-01-10 12:18:13 -05:00
coverage --linkstatic=False
coverage --combined_report=lcov
2025-01-13 11:34:11 -05:00
coverage --experimental_use_llvm_covmap
coverage --experimental_generate_llvm_lcov
2025-01-10 12:18:13 -05:00
coverage --remote_download_outputs=all
coverage --fission=no
2025-07-01 08:42:34 -07:00
coverage --build_runfile_links
coverage --legacy_external_runfiles
2025-03-28 09:54:35 -07:00
# This is set in .bazelrc.evergreen:
# coverage --config=no-remote-exec
2025-01-10 12:18:13 -05:00
2025-05-22 15:57:08 -05:00
# code ownership configuration
common --define codeowners_add_auto_approve_user=True
2025-06-17 10:45:18 -05:00
common --define codeowners_have_allowed_unowned_files=True
common --define codeowners_allowed_unowned_files_path=.github/ALLOWED_UNOWNED_FILES.yml
2025-09-19 14:27:16 -04:00
common --define codeowners_have_banned_codeowners=True
common --define codeowners_banned_codeowners_file_path=.github/BANNED_CODEOWNERS.txt
2025-06-26 13:14:35 -05:00
common --define codeowners_have_default_owner=True
common --define codeowners_default_owner=@10gen/mongo-default-approvers
2025-05-22 15:57:08 -05:00
2024-12-20 13:08:14 -05:00
# Don't detect the native toolchain on linux, only use the hermetic toolchains.
# Opt out of this by passing --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0 on the command line.
2025-01-06 14:11:11 -08:00
common:linux --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
2024-12-20 13:08:14 -05:00
2025-01-30 15:07:12 -08:00
# Only use fission and debug compression on Linux
2025-01-06 14:11:11 -08:00
common:windows --fission=no
2025-04-28 10:29:10 -07:00
common:windows --//bazel/config:create_dwp=False
2025-01-30 15:07:12 -08:00
common:windows --//bazel/config:compress_debug_compile=False
2025-01-06 14:11:11 -08:00
common:macos --fission=no
2025-04-28 10:29:10 -07:00
common:macos --//bazel/config:create_dwp=False
2025-01-30 15:07:12 -08:00
common:macos --//bazel/config:compress_debug_compile=False
2024-12-31 10:33:20 -08:00
2024-01-11 13:14:58 -08:00
# Dynamic linking on Windows (DLL generation) is currently not supported.
2025-01-06 14:11:11 -08:00
common:windows --//bazel/config:linkstatic=True
2024-01-11 13:14:58 -08:00
2024-03-13 16:44:00 -07:00
# The only Windows compiler we support is MSVC.
2025-01-06 14:11:11 -08:00
common:windows --//bazel/config:compiler_type=msvc
2025-05-05 09:55:05 -07:00
common:windows --//bazel/config:linker=auto
2024-03-13 16:44:00 -07:00
2025-04-28 14:53:11 -07:00
# Data dependencies don't work in bazel run or bazel test on windows without this
startup --windows_enable_symlinks
common:windows --enable_runfiles
build:windows --action_env=MSYS=winsymlinks:nativestrict
test:windows --action_env=MSYS=winsymlinks:nativestrict
2025-03-27 10:17:17 -07:00
# Always use clang on macos
common:macos --//bazel/config:compiler_type=clang
2025-05-05 09:55:05 -07:00
common:macos --//bazel/config:linker=auto
2025-03-27 10:17:17 -07:00
common:macos --macos_minimum_os=11.0
# TODO(SERVER-102959): Find out why tests fail when mac is not in compilation mode dbg
common:macos -c dbg
2024-10-03 17:05:41 -07:00
# Remote execution and caching is the default, but only mongodb employees will be able to access
# the engflow cluster. External builders should use the --config=local option
# Enable remote build execution:
2025-04-15 14:54:52 -05:00
common:linux --remote_executor=grpcs://sodalite.cluster.engflow.com
2025-03-27 10:17:17 -07:00
common:windows --remote_executor=
common:macos --remote_executor=
2024-10-03 17:05:41 -07:00
# Enable remote cache (also necessary for remote build execution):
2025-05-02 16:04:36 -05:00
common --experimental_remote_downloader=grpcs://sodalite.cluster.engflow.com
2025-01-06 14:11:11 -08:00
common --remote_cache=grpcs://sodalite.cluster.engflow.com
common --bes_backend=grpcs://sodalite.cluster.engflow.com
common --bes_results_url=https://sodalite.cluster.engflow.com/invocation/
2025-08-07 16:12:46 -04:00
common --remote_cache_compression=true
2025-01-06 14:11:11 -08:00
common --grpc_keepalive_time=30s
common --nolegacy_important_outputs
common --bes_keywords=repo:mongo
2024-03-01 19:14:00 -06:00
common --remote_upload_local_results=False
2023-10-20 22:34:24 +00:00
2024-04-18 19:00:12 -04:00
# Settings specific for clang-tidy
--config=clang-tidy
2025-01-06 14:11:11 -08:00
common:clang-tidy --config=dbg
2025-08-26 16:30:14 -05:00
common:clang-tidy --build_atlas
2025-06-03 10:30:20 -05:00
common:clang-tidy --remote_download_outputs=all
2025-04-30 12:35:15 -05:00
common:clang-tidy --build_tag_filters=-third_party,-mongo-tidy-tests,-third_party_debug,-mongo-tidy-tests_debug
2025-01-06 14:11:11 -08:00
common:clang-tidy --//bazel/config:compiler_type=clang
2025-03-24 22:26:07 -05:00
common:clang-tidy --keep_going
2025-01-06 14:11:11 -08:00
common:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
common:clang-tidy --output_groups=report
2025-07-14 09:14:07 -07:00
common:clang-tidy --jobs=300
2024-12-06 11:32:08 -08:00
2025-02-07 21:30:06 +01:00
--config=mod-scanner
common:mod-scanner --config=dbg
2025-08-26 16:30:14 -05:00
common:mod-scanner --build_atlas
2025-04-30 12:35:15 -05:00
common:mod-scanner --build_tag_filters=-third_party,-mongo-tidy-tests,-third_party_debug,-mongo-tidy-tests_debug
2025-02-07 21:30:06 +01:00
common:mod-scanner --//bazel/config:compiler_type=clang
common:mod-scanner --//bazel/config:mongo_toolchain_version=v5
common:mod-scanner --output_groups=report
common:mod-scanner --aspects //modules_poc:mod_scanner.bzl%mod_scanner_aspect
common:mod-scanner --remote_download_regex=.*\.mod_scanner_decls.json$
2023-10-20 22:34:24 +00:00
# if you don't have access to the remote execution cluster above, use the local config
2025-03-31 11:05:00 -05:00
# by passing "--config=local" on the bazel command line
2023-10-20 22:34:24 +00:00
--config=local
2025-01-06 14:11:11 -08:00
common:local --remote_executor=
2025-05-02 16:04:36 -05:00
common:local --experimental_remote_downloader=
2025-01-06 14:11:11 -08:00
common:local --remote_cache=
common:local --bes_backend=
common:local --bes_results_url=
common:local --tls_client_certificate=
common:local --tls_client_key=
common:local --remote_cache_compression=false
common:local --grpc_keepalive_time=0s
common:local --legacy_important_outputs
common:local --jobs=auto
2023-11-06 18:57:17 +00:00
2024-10-09 17:44:35 -07:00
# Disable remote execution but keep remote cache enabled
--config=no-remote-exec
common:no-remote-exec --remote_executor=
common:no-remote-exec --jobs=auto
2024-01-24 15:05:30 -08:00
# Disable remote execution and caching for public releases
--config=public-release
2025-01-06 14:11:11 -08:00
common:public-release --remote_executor=
2025-05-05 11:56:10 -05:00
common:public-release --experimental_remote_downloader=
2025-01-06 14:11:11 -08:00
common:public-release --remote_cache=
common:public-release --bes_backend=
common:public-release --bes_results_url=
common:public-release --tls_client_certificate=
common:public-release --tls_client_key=
common:public-release --remote_cache_compression=false
common:public-release --grpc_keepalive_time=0s
common:public-release --legacy_important_outputs
2025-03-27 10:17:17 -07:00
common:public-release --//bazel/config:release=True
2024-01-24 15:05:30 -08:00
2024-12-03 13:01:07 +01:00
--config=fission
2025-01-06 14:11:11 -08:00
common:fission --fission=yes
common:fission --remote_download_regex=.*\.dwo$
2024-12-03 13:01:07 +01:00
2024-03-04 20:13:31 +00:00
# Avoid failing builds when BES metadata fails to upload.
common --bes_upload_mode=fully_async
2023-11-06 18:57:17 +00:00
2024-10-24 14:17:15 -07:00
# Default distmod if not specified.
2025-01-06 14:11:11 -08:00
common --define=MONGO_DISTMOD=""
2024-08-08 18:44:34 -07:00
2024-10-29 16:45:10 -07:00
# Default if .git directory is not present
2025-01-06 14:11:11 -08:00
common --define=GIT_COMMIT_HASH="nogitversion"
2024-10-29 16:45:10 -07:00
2025-08-07 16:12:46 -04:00
# Default retry downloads three times
common --experimental_repository_downloader_retries=3
2024-04-08 14:05:01 -07:00
# TODO(WT-12780): delete this once wiredtiger switches to /.bazelrc.evergreen.
2024-01-11 13:14:58 -08:00
try-import %workspace%/.bazelrc.evergreen_engflow_creds
2024-04-08 14:05:01 -07:00
# Evergreen settings, ex. in evergreen this will set the key/cert options for access to the cluster
try-import %workspace%/.bazelrc.evergreen
2024-10-09 19:42:06 -05:00
# local default dev settings
2025-01-28 21:05:00 -06:00
try-import %workspace%/.bazelrc.common_bes
2024-10-29 16:45:10 -07:00
2025-07-31 14:04:27 -05:00
# local default dev settings
2025-08-04 09:51:03 -07:00
try-import %workspace%/.bazelrc.mongo_variables
2025-07-31 14:04:27 -05:00
2024-10-29 16:45:10 -07:00
# local git version info
2025-01-06 17:04:09 -08:00
try-import %workspace%/.bazelrc.git
2025-01-03 14:38:07 -08:00
# Used for build profiles and any settings a user wants to consistently use
try-import %workspace%/.bazelrc.local
2025-01-07 16:46:42 -08:00
# Flag as built with bazelisk
try-import %workspace%/.bazelrc.bazelisk
2025-07-11 13:49:07 -05:00
# Flags synced from Flag Sync
try-import %workspace%/.bazelrc.sync