mirror of https://github.com/mongodb/mongo
SERVER-105745: Enable the Apple OSS LLVM Clang as default compiler for Apple Builds. (#36982)
GitOrigin-RevId: 8e7cc041f25fff8ed1e47e77bccef1fdfdd92c92
This commit is contained in:
parent
1f831612fa
commit
227307d062
2
.bazelrc
2
.bazelrc
|
|
@ -152,7 +152,7 @@ common --flag_alias=dbg_level=//bazel/config:dbg_level
|
|||
common --flag_alias=mongo_toolchain_version=//bazel/config:mongo_toolchain_version
|
||||
common --flag_alias=simple_build_id=//bazel/config:simple_build_id
|
||||
common --flag_alias=create_dwp=//bazel/config:create_dwp
|
||||
common --flag_alias=local_clang_compiler=//bazel/config:local_clang_compiler
|
||||
common --flag_alias=use_apple_clang=//bazel/config:apple_clang
|
||||
|
||||
#############################################################################################################################
|
||||
# BUILD 'PROFILES' - this is the area to set up configurations of flags to be used by developers.
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ load(
|
|||
"libunwind",
|
||||
"linker",
|
||||
"linkstatic",
|
||||
"local_clang_compiler",
|
||||
"lsan",
|
||||
"mongo_toolchain_version",
|
||||
"msan",
|
||||
|
|
@ -92,15 +91,15 @@ config_setting(
|
|||
},
|
||||
)
|
||||
|
||||
local_clang_compiler(
|
||||
name = "local_clang_compiler",
|
||||
bool_flag(
|
||||
name = "apple_clang",
|
||||
build_setting_default = False,
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "use_local_clang_compiler",
|
||||
name = "use_apple_clang",
|
||||
flag_values = {
|
||||
"//bazel/config:local_clang_compiler": "True",
|
||||
":apple_clang": "true",
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -23,20 +23,6 @@ compiler_type = rule(
|
|||
build_setting = config.string(flag = True),
|
||||
)
|
||||
|
||||
# =============
|
||||
# compiler_type
|
||||
# =============
|
||||
|
||||
local_clang_compiler_provider = provider(
|
||||
doc = "use the local clang compiler",
|
||||
fields = ["enabled"],
|
||||
)
|
||||
|
||||
local_clang_compiler = rule(
|
||||
implementation = lambda ctx: local_clang_compiler_provider(enabled = ctx.build_setting_value),
|
||||
build_setting = config.bool(flag = True),
|
||||
)
|
||||
|
||||
# =========
|
||||
# mongo_toolchain_version
|
||||
# =========
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ package(default_visibility = ["//visibility:public"])
|
|||
"@platforms//cpu:" + cpu,
|
||||
],
|
||||
toolchain = select({
|
||||
"@//bazel/config:use_local_clang_compiler": "@mongo_apple_brew_llvm_toolchain_config//:cc-compiler-" + apple_arch,
|
||||
"@//conditions:default": "@mongo_apple_toolchain_config//:cc-compiler-" + apple_arch,
|
||||
"@//bazel/config:use_apple_clang": "@mongo_apple_toolchain_config//:cc-compiler-" + apple_arch,
|
||||
"@//conditions:default": "@mongo_apple_brew_llvm_toolchain_config//:cc-compiler-" + apple_arch,
|
||||
}),
|
||||
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ To build MongoDB, you will need:
|
|||
- A modern C++ compiler capable of compiling C++20. One of the following is required:
|
||||
- GCC 14.2 or newer
|
||||
- Clang 19.1 or newer
|
||||
- Apple XCode 14 or newer
|
||||
- Apple XCode 16.4 or newer
|
||||
- Visual Studio 2022 version 17.0 or newer (See Windows section below for details)
|
||||
- On Linux and macOS, the libcurl library and header is required. MacOS includes libcurl.
|
||||
- Fedora/RHEL - `dnf install libcurl-devel`
|
||||
|
|
@ -95,4 +95,8 @@ To install dependencies on Debian or Ubuntu systems:
|
|||
|
||||
## OS X
|
||||
|
||||
Install Xcode 14.0 or newer.
|
||||
Install Xcode 16.4 or newer. Make sure macOS 15.5 platform
|
||||
is installed.
|
||||
|
||||
Install llvm and lld, version 19 from brew:
|
||||
brew install llvm@19 lld@19
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ buildvariants:
|
|||
expansions:
|
||||
compile_variant: *enterprise-macos-arm64
|
||||
test_flags: --excludeWithAnyTags=incompatible_with_macos,requires_gcm
|
||||
bazel_compile_flags: --developer_dir=/Applications/Xcode15.app
|
||||
bazel_compile_flags: >-
|
||||
--developer_dir=/Applications/Xcode15.app
|
||||
--use_apple_clang
|
||||
resmoke_jobs_max: 6
|
||||
tasks:
|
||||
- name: compile_test_serial_TG
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ buildvariants:
|
|||
bazel_compile_flags: >-
|
||||
--build_enterprise=False
|
||||
--developer_dir=/Applications/Xcode15.app
|
||||
--use_apple_clang
|
||||
resmoke_jobs_max: 6
|
||||
compile_variant: macos-arm64
|
||||
tasks:
|
||||
|
|
@ -45,7 +46,9 @@ buildvariants:
|
|||
push_bucket: downloads.10gen.com
|
||||
push_name: macos
|
||||
push_arch: arm64-enterprise
|
||||
bazel_compile_flags: --developer_dir=/Applications/Xcode15.app
|
||||
bazel_compile_flags: >-
|
||||
--developer_dir=/Applications/Xcode15.app
|
||||
--use_apple_clang
|
||||
resmoke_jobs_max: 6
|
||||
compile_variant: enterprise-macos-arm64
|
||||
tasks:
|
||||
|
|
@ -71,6 +74,7 @@ buildvariants:
|
|||
bazel_compile_flags: >-
|
||||
--build_enterprise=False
|
||||
--developer_dir=/Applications/Xcode15.app
|
||||
--use_apple_clang
|
||||
resmoke_jobs_max: 6
|
||||
compile_variant: macos
|
||||
tasks:
|
||||
|
|
@ -94,7 +98,9 @@ buildvariants:
|
|||
push_bucket: downloads.10gen.com
|
||||
push_name: macos
|
||||
push_arch: x86_64-enterprise
|
||||
bazel_compile_flags: --developer_dir=/Applications/Xcode15.app
|
||||
bazel_compile_flags: >-
|
||||
--developer_dir=/Applications/Xcode15.app
|
||||
--use_apple_clang
|
||||
resmoke_jobs_max: 6
|
||||
compile_variant: enterprise-macos
|
||||
tasks:
|
||||
|
|
@ -118,9 +124,7 @@ buildvariants:
|
|||
push_bucket: downloads.mongodb.org
|
||||
push_name: macos
|
||||
push_arch: arm64
|
||||
bazel_compile_flags: >-
|
||||
--build_enterprise=False
|
||||
--local_clang_compiler
|
||||
bazel_compile_flags: --build_enterprise=False
|
||||
resmoke_jobs_max: 6
|
||||
compile_variant: macos-arm64
|
||||
tasks:
|
||||
|
|
@ -144,9 +148,7 @@ buildvariants:
|
|||
push_bucket: downloads.mongodb.org
|
||||
push_name: macos
|
||||
push_arch: x86_64
|
||||
bazel_compile_flags: >-
|
||||
--build_enterprise=False
|
||||
--local_clang_compiler
|
||||
bazel_compile_flags: --build_enterprise=False
|
||||
resmoke_jobs_max: 6
|
||||
compile_variant: macos
|
||||
tasks:
|
||||
|
|
@ -171,7 +173,6 @@ buildvariants:
|
|||
push_bucket: downloads.10gen.com
|
||||
push_name: macos
|
||||
push_arch: x86_64-enterprise
|
||||
bazel_compile_flags: --local_clang_compiler
|
||||
resmoke_jobs_max: 6
|
||||
compile_variant: enterprise-macos
|
||||
tasks:
|
||||
|
|
@ -196,7 +197,6 @@ buildvariants:
|
|||
push_bucket: downloads.10gen.com
|
||||
push_name: macos
|
||||
push_arch: arm64-enterprise
|
||||
bazel_compile_flags: --local_clang_compiler
|
||||
resmoke_jobs_max: 6
|
||||
compile_variant: enterprise-macos-arm64
|
||||
tasks:
|
||||
|
|
|
|||
|
|
@ -341,6 +341,7 @@ buildvariants:
|
|||
--opt=on
|
||||
--build_enterprise=False
|
||||
--developer_dir=/Applications/Xcode15.app
|
||||
--use_apple_clang
|
||||
tasks:
|
||||
- name: compile_test_serial_TG
|
||||
- name: run_unit_tests_TG
|
||||
|
|
@ -368,6 +369,7 @@ buildvariants:
|
|||
--dbg=True
|
||||
--opt=on
|
||||
--developer_dir=/Applications/Xcode15.app
|
||||
--use_apple_clang
|
||||
resmoke_jobs_max: 6
|
||||
tasks:
|
||||
- name: compile_test_serial_TG
|
||||
|
|
@ -398,7 +400,6 @@ buildvariants:
|
|||
--dbg=True
|
||||
--opt=on
|
||||
--build_enterprise=False
|
||||
--local_clang_compiler
|
||||
tasks:
|
||||
- name: compile_test_serial_TG
|
||||
- name: run_unit_tests_TG
|
||||
|
|
@ -425,7 +426,6 @@ buildvariants:
|
|||
bazel_compile_flags: >-
|
||||
--dbg=True
|
||||
--opt=on
|
||||
--local_clang_compiler
|
||||
resmoke_jobs_max: 6
|
||||
tasks:
|
||||
- name: compile_test_serial_TG
|
||||
|
|
|
|||
Loading…
Reference in New Issue