2023-08-04 14:53:37 +02:00
|
|
|
# Reference docs: https://bazel.build/run/bazelrc
|
2023-08-15 17:50:02 +02:00
|
|
|
|
2024-04-30 07:36:06 +02:00
|
|
|
# coverity need to use the local command without remote execution auto
|
|
|
|
# enabled.
|
|
|
|
info --config=local
|
|
|
|
|
2023-11-10 21:58:44 +01:00
|
|
|
# This automatically sets a config based on host platform, ex: --config=macos if the host is macos
|
|
|
|
build --enable_platform_specific_config=true
|
|
|
|
|
2024-08-15 23:05:05 +02:00
|
|
|
# Don't use legacy toolchain resolution.
|
|
|
|
build --incompatible_enable_cc_toolchain_resolution
|
|
|
|
|
2023-08-15 18:44:06 +02:00
|
|
|
# This makes builds more hermetic by preventing environment variables from leaking into the execution of rules
|
2023-08-15 17:50:02 +02:00
|
|
|
build --incompatible_strict_action_env=true
|
2023-08-15 18:44:06 +02:00
|
|
|
|
2023-11-28 23:20:17 +01:00
|
|
|
# allows us to use python rules. This is needed because of the bug:
|
|
|
|
# https://github.com/bazelbuild/bazel/issues/4327
|
2024-08-02 22:30:12 +02:00
|
|
|
build --experimental_inprocess_symlink_creation
|
2023-11-28 23:20:17 +01:00
|
|
|
|
2024-01-27 05:22:18 +01:00
|
|
|
# cc_library transitively propagates link opts. The build uses cc_shared_library to avoid this when linking
|
|
|
|
# dynamically.
|
|
|
|
build --experimental_cc_shared_library
|
|
|
|
|
2024-08-23 23:21:36 +02:00
|
|
|
# Reuse sandboxes to save sandbox execution and deletion times.
|
|
|
|
build --experimental_reuse_sandbox_directories
|
|
|
|
|
2024-10-22 08:44:07 +02: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:
|
|
|
|
build --strategy=CppLink=local
|
|
|
|
build --strategy=CppArchive=local
|
|
|
|
build --strategy=SolibSymlink=local
|
2024-10-25 20:24:08 +02:00
|
|
|
build --strategy=StripDebuginfo=local
|
|
|
|
build --strategy=ExtractDebuginfo=local
|
|
|
|
build --modify_execution_info=^(CppLink|CppArchive|SolibSymlink|ExtractDebuginfo|StripDebuginfo)$=+no-remote-cache
|
2024-10-22 08:44:07 +02:00
|
|
|
|
2024-09-28 00:18:38 +02:00
|
|
|
# Aliases for config flags
|
|
|
|
build --flag_alias=linkstatic=//bazel/config:linkstatic
|
|
|
|
build --flag_alias=compiler_type=//bazel/config:compiler_type
|
|
|
|
build --flag_alias=linker=//bazel/config:linker
|
|
|
|
build --flag_alias=use_gdbserver=//bazel/config:use_gdbserver
|
|
|
|
build --flag_alias=libunwind=//bazel/config:libunwind
|
|
|
|
build --flag_alias=spider_monkey_dbg=//bazel/config:spider_monkey_dbg
|
|
|
|
build --flag_alias=allocator=//bazel/config:allocator
|
|
|
|
build --flag_alias=use_lldbserver=//bazel/config:use_lldbserver
|
|
|
|
build --flag_alias=opt=//bazel/config:opt
|
|
|
|
build --flag_alias=dbg=//bazel/config:dbg
|
2024-10-17 20:31:45 +02:00
|
|
|
build --flag_alias=debug_symbols=//bazel/config:debug_symbols
|
2024-09-28 00:18:38 +02:00
|
|
|
build --flag_alias=thin_lto=//bazel/config:thin_lto
|
|
|
|
build --flag_alias=separate_debug=//bazel/config:separate_debug
|
|
|
|
build --flag_alias=use_wait_for_debugger=//bazel/config:use_wait_for_debugger
|
|
|
|
build --flag_alias=use_ocsp_stapling=//bazel/config:use_ocsp_stapling
|
|
|
|
build --flag_alias=use_disable_ref_track=//bazel/config:use_disable_ref_track
|
|
|
|
build --flag_alias=use_wiredtiger=//bazel/config:use_wiredtiger
|
|
|
|
build --flag_alias=use_glibcxx_debug=//bazel/config:use_glibcxx_debug
|
|
|
|
build --flag_alias=use_tracing_profiler=//bazel/config:use_tracing_profiler
|
|
|
|
build --flag_alias=build_grpc=//bazel/config:build_grpc
|
|
|
|
build --flag_alias=use_libcxx=//bazel/config:use_libcxx
|
|
|
|
build --flag_alias=detect_odr_violations=//bazel/config:detect_odr_violations
|
|
|
|
build --flag_alias=shared_archive=//bazel/config:shared_archive
|
|
|
|
build --flag_alias=streams_release_build=//bazel/config:streams_release_build
|
|
|
|
build --flag_alias=release=//bazel/config:release
|
|
|
|
build --flag_alias=build_enterprise=//bazel/config:build_enterprise
|
|
|
|
build --flag_alias=visibility_support=//bazel/config:visibility_support
|
|
|
|
build --flag_alias=disable_warnings_as_errors=//bazel/config:disable_warnings_as_errors
|
|
|
|
build --flag_alias=gcov=//bazel/config:gcov
|
|
|
|
build --flag_alias=pgo_profile=//bazel/config:pgo_profile
|
|
|
|
build --flag_alias=server_js=//bazel/config:server_js
|
|
|
|
build --flag_alias=ssl=//bazel/config:ssl
|
|
|
|
build --flag_alias=js_engine=//bazel/config:js_engine
|
2024-10-21 20:10:54 +02:00
|
|
|
build --flag_alias=use_sasl_client=//bazel/config:use_sasl_client
|
2024-09-28 00:18:38 +02:00
|
|
|
build --flag_alias=enterprise_feature_all=//bazel/config:enterprise_feature_all
|
|
|
|
build --flag_alias=enterprise_feature_all=//bazel/config:enterprise_feature_all
|
|
|
|
build --flag_alias=enterprise_feature_all=//bazel/config:enterprise_feature_all
|
|
|
|
|
|
|
|
build --flag_alias=dwarf_version=//bazel/config:dwarf_version
|
|
|
|
build --flag_alias=http_client=//bazel/config:http_client
|
|
|
|
build --flag_alias=developer_dir=//bazel/config:developer_dir
|
|
|
|
build --flag_alias=asan=//bazel/config:asan
|
|
|
|
build --flag_alias=fsan=//bazel/config:fsan
|
|
|
|
build --flag_alias=msan=//bazel/config:msan
|
|
|
|
build --flag_alias=lsan=//bazel/config:lsan
|
|
|
|
build --flag_alias=tsan=//bazel/config:tsan
|
|
|
|
build --flag_alias=ubsan=//bazel/config:ubsan
|
|
|
|
|
2024-10-22 08:44:07 +02:00
|
|
|
--config=remote_link
|
|
|
|
build:remote_link --strategy=CppLink=remote
|
|
|
|
build:remote_link --strategy=CppArchive=remote
|
|
|
|
build:remote_link --strategy=SolibSymlink=remote
|
|
|
|
build:remote_link --strategy=ExtractDebugInfo=remote
|
|
|
|
build:remote_link --strategy=StripDebugInfo=remote
|
|
|
|
build:remote_link --features=-thin_archive
|
|
|
|
|
2024-06-11 22:06:10 +02:00
|
|
|
# Disable the default compiler flags to avoid certain flags that conflict with flags we setup.
|
|
|
|
build:windows --features=-smaller_binary
|
|
|
|
build:windows --features=-frame_pointer
|
|
|
|
build:windows --features=-opt
|
|
|
|
build:windows --features=-dbg
|
|
|
|
build:windows --features=-fastbuild
|
|
|
|
build:windows --features=-dynamic_link_msvcrt
|
|
|
|
|
2024-01-11 22:14:58 +01:00
|
|
|
# Dynamic linking on Windows (DLL generation) is currently not supported.
|
|
|
|
build:windows --//bazel/config:linkstatic=True
|
|
|
|
|
2024-03-14 00:44:00 +01:00
|
|
|
# The only Windows compiler we support is MSVC.
|
|
|
|
build:windows --//bazel/config:compiler_type=msvc
|
|
|
|
|
2024-03-07 06:54:03 +01:00
|
|
|
# Windows and MacOS do not use the custom toolchain config, so the compiler flags need to be set here.
|
|
|
|
build:macos --cxxopt=-std=c++20
|
|
|
|
build:windows --cxxopt=/std:c++20
|
|
|
|
|
2024-03-28 00:38:35 +01:00
|
|
|
# Set the windows version to win10 by default
|
|
|
|
# TODO(SERVER-87654): We may want to add support for other Windows versions in the future.
|
|
|
|
build:windows --cxxopt=-D_WIN32_WINNT=0x0A00
|
|
|
|
build:windows --cxxopt=-DBOOST_USE_WINAPI_VERSION=0x0A00
|
|
|
|
build:windows --cxxopt=-DNTDDI_VERSION=0x0A000000
|
2024-08-14 20:14:39 +02:00
|
|
|
# TODO(SERVER-93585): Remove this and fix s2 to work with Bazel's default which
|
|
|
|
# sets COMPILER_MSVC on windows.
|
|
|
|
build:windows --cxxopt=-UCOMPILER_MSVC
|
2024-03-28 00:38:35 +01:00
|
|
|
|
2024-10-04 02:05:41 +02: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:
|
2024-08-22 20:52:19 +02:00
|
|
|
build:linux --remote_executor=grpcs://sodalite.cluster.engflow.com
|
2024-10-04 02:05:41 +02:00
|
|
|
build:linux --jobs=200
|
|
|
|
|
|
|
|
# Enable remote cache (also necessary for remote build execution):
|
2023-10-21 00:34:24 +02:00
|
|
|
build --remote_cache=grpcs://sodalite.cluster.engflow.com
|
2024-02-02 03:11:51 +01:00
|
|
|
build --bes_backend=grpcs://sodalite.cluster.engflow.com
|
|
|
|
build --bes_results_url=https://sodalite.cluster.engflow.com/invocation/
|
2024-11-01 21:26:33 +01:00
|
|
|
build --remote_cache_compression=true
|
2023-10-21 00:34:24 +02:00
|
|
|
build --grpc_keepalive_time=30s
|
|
|
|
build --nolegacy_important_outputs
|
2024-02-17 21:18:52 +01:00
|
|
|
build --bes_keywords=repo:mongo
|
2024-03-02 02:14:00 +01:00
|
|
|
common --remote_upload_local_results=False
|
2023-10-21 00:34:24 +02:00
|
|
|
|
2024-04-19 01:00:12 +02:00
|
|
|
# Settings specific for clang-tidy
|
|
|
|
--config=clang-tidy
|
2024-06-15 03:30:15 +02:00
|
|
|
build:clang-tidy --//bazel/config:compiler_type=clang
|
2024-04-19 01:00:12 +02:00
|
|
|
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
|
|
|
|
build:clang-tidy --output_groups=report
|
|
|
|
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config
|
|
|
|
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_executable=@mongo_toolchain//:clang_tidy
|
|
|
|
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_additional_deps=@mongo_toolchain//:all
|
|
|
|
|
2023-10-21 00:34:24 +02:00
|
|
|
# if you don't have access to the remote execution cluster above, use the local config
|
|
|
|
# described below.
|
|
|
|
# pass local config to SCons like:
|
|
|
|
# > buildscripts/scons.py BAZEL_FLAGS=--config=local <others args>
|
|
|
|
# or if invoking bazel directly pass "--config=local" on the bazel command line
|
|
|
|
--config=local
|
|
|
|
build:local --remote_executor=
|
|
|
|
build:local --remote_cache=
|
|
|
|
build:local --bes_backend=
|
|
|
|
build:local --bes_results_url=
|
|
|
|
build:local --tls_client_certificate=
|
|
|
|
build:local --tls_client_key=
|
2024-11-01 21:26:33 +01:00
|
|
|
build:local --remote_cache_compression=false
|
2023-10-21 00:34:24 +02:00
|
|
|
build:local --grpc_keepalive_time=0s
|
|
|
|
build:local --legacy_important_outputs
|
2024-03-09 04:04:17 +01:00
|
|
|
build:local --jobs=auto
|
2023-11-06 19:57:17 +01:00
|
|
|
|
2024-10-10 02:44:35 +02: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-25 00:05:30 +01:00
|
|
|
# Disable remote execution and caching for public releases
|
|
|
|
--config=public-release
|
|
|
|
build:public-release --remote_executor=
|
|
|
|
build:public-release --remote_cache=
|
|
|
|
build:public-release --bes_backend=
|
|
|
|
build:public-release --bes_results_url=
|
|
|
|
build:public-release --tls_client_certificate=
|
|
|
|
build:public-release --tls_client_key=
|
2024-11-01 21:26:33 +01:00
|
|
|
build:public-release --remote_cache_compression=false
|
2024-01-25 00:05:30 +01:00
|
|
|
build:public-release --grpc_keepalive_time=0s
|
|
|
|
build:public-release --legacy_important_outputs
|
|
|
|
|
2024-03-04 21:13:31 +01:00
|
|
|
# Avoid failing builds when BES metadata fails to upload.
|
|
|
|
common --bes_upload_mode=fully_async
|
2023-11-06 19:57:17 +01:00
|
|
|
|
2024-03-12 21:24:17 +01:00
|
|
|
# Enable Build without the Bytes
|
2024-11-01 21:26:33 +01:00
|
|
|
common --remote_download_outputs=toplevel
|
|
|
|
|
|
|
|
common --enable_bzlmod=false
|
2024-03-12 21:24:17 +01:00
|
|
|
|
2024-08-09 03:44:34 +02:00
|
|
|
# Default Mongo Version if a version is not specified.
|
2024-10-24 23:17:15 +02:00
|
|
|
build --define=MONGO_VERSION=8.1.0-alpha
|
|
|
|
|
|
|
|
# Default distmod if not specified.
|
|
|
|
build --define=MONGO_DISTMOD=""
|
2024-08-09 03:44:34 +02:00
|
|
|
|
2024-10-30 00:45:10 +01:00
|
|
|
# Default if .git directory is not present
|
|
|
|
build --define=GIT_COMMIT_HASH="nogitversion"
|
|
|
|
|
2023-11-06 19:57:17 +01:00
|
|
|
# try to import the bazelrc files if available
|
|
|
|
try-import %workspace%/.bazelrc.local
|
2023-11-28 04:55:31 +01:00
|
|
|
|
2024-04-08 23:05:01 +02:00
|
|
|
# TODO(WT-12780): delete this once wiredtiger switches to /.bazelrc.evergreen.
|
2024-01-11 22:14:58 +01:00
|
|
|
try-import %workspace%/.bazelrc.evergreen_engflow_creds
|
2024-04-08 23:05:01 +02: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-10 02:42:06 +02:00
|
|
|
|
2024-11-01 21:26:33 +01:00
|
|
|
# Import settings for selecting the right xcode version on mac
|
|
|
|
try-import %workspace%/.bazelrc.xcode
|
|
|
|
|
2024-10-10 02:42:06 +02:00
|
|
|
# local default dev settings
|
2024-10-24 23:17:15 +02:00
|
|
|
try-import %workspace%/.bazelrc.workstation
|
2024-10-30 00:45:10 +01:00
|
|
|
|
|
|
|
# local git version info
|
|
|
|
try-import %workspace%/.bazelrc.gitinfo
|