Co-authored-by: Andrew Bradshaw <andrew.bradshaw@mongodb.com> GitOrigin-RevId: ba0a73f930f7120fa0fecef4611f43e00d2f0b91
398 lines
13 KiB
Plaintext
398 lines
13 KiB
Plaintext
# Apple cc toolchain needs to be loaded before regular cc toolchain or else Apple will just use regular cc toolchain
|
|
bazel_dep(name = "apple_support", version = "1.17.1", repo_name = "build_bazel_apple_support")
|
|
bazel_dep(name = "bazel_features", version = "1.37.0")
|
|
|
|
bazel_features_deps = use_extension("//bazel:bzlmod.bzl", "bazel_features_deps")
|
|
use_repo(bazel_features_deps, "bazel_features_globals", "bazel_features_version")
|
|
|
|
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
|
|
|
|
http_archive(
|
|
name = "bazel_clang_tidy",
|
|
integrity = "sha256-PLwbo3dS1ZgeuSiaUctGRIU/O3ScB64+U2mEsN7fgtA=",
|
|
strip_prefix = "bazel_clang_tidy-1.7",
|
|
urls = [
|
|
# Implements retry by relisting each url multiple times to be used as a failover.
|
|
# TODO(SERVER-86719): Re-implement http_archive to allow sleeping between retries
|
|
"https://github.com/mongodb-forks/bazel_clang_tidy/archive/refs/tags/v1.7.tar.gz",
|
|
] * 5,
|
|
)
|
|
|
|
# TODO(SERVER-107519): Get these binaries from an actual pipeline build and not locally produced binaries
|
|
http_archive(
|
|
name = "bolt_binaries",
|
|
build_file_content = """
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
filegroup(
|
|
name = "merge-fdata",
|
|
srcs = ["bolt/bin/merge-fdata"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "bolt",
|
|
srcs = ["bolt/bin/llvm-bolt"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "perf2bolt",
|
|
srcs = ["bolt/bin/perf2bolt"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "perf",
|
|
srcs = ["bolt/bin/perf"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "libbolt_rt_instr",
|
|
srcs = ["bolt/lib/libbolt_rt_instr.a"],
|
|
)
|
|
""",
|
|
sha256 = "7de026eb0f82d1d113ce323d70cd35070b3d40cfea0c8f55c303c111a63feda3",
|
|
urls = [
|
|
"https://mdb-build-public.s3.us-east-1.amazonaws.com/andrew_pgo_scratch/bolt_perf_rseqbugfix2.tar.gz",
|
|
] * 5,
|
|
)
|
|
|
|
http_file(
|
|
name = "mozjs_wasm",
|
|
downloaded_file_path = "mozjs_wasm_api.wasm",
|
|
sha256 = "3d5a780b657fdfe66cc2f45f141e9e89e9bcb5ab7a1c90f0fb4778b5c0080b15",
|
|
urls = [
|
|
# Implements retry by relisting each url multiple times to be used as a failover.
|
|
# TODO(SERVER-86719): Re-implement http_archive to allow sleeping between retries
|
|
"https://mdb-build-public.s3.us-east-1.amazonaws.com/wasm_scratch/mozjs_wasm_api.wasm",
|
|
] * 5,
|
|
)
|
|
|
|
http_file(
|
|
name = "spidermonkey_wasip2_dist",
|
|
downloaded_file_path = "spidermonkey-wasip2-release.tar.gz",
|
|
sha256 = "f528e5730721559781aef47d355079da63185588bb14ebb6bf5266d4aa5e3eb0",
|
|
urls = [
|
|
# Implements retry by relisting each url multiple times to be used as a failover.
|
|
# TODO(SERVER-86719): Re-implement http_archive to allow sleeping between retries
|
|
"https://mdb-build-public.s3.us-east-1.amazonaws.com/wasm_scratch/spidermonkey-wasip2-release.tar.gz",
|
|
] * 5,
|
|
)
|
|
|
|
# SourceGraph indexer
|
|
http_file(
|
|
name = "scip-clang",
|
|
executable = True,
|
|
sha256 = "9fc7d1c309f8adee1b8663efa802efa7363ef22ee06f4711117535e406690689",
|
|
urls = [
|
|
# Implements retry by relisting each url multiple times to be used as a failover.
|
|
# TODO(SERVER-86719): Re-implement http_archive to allow sleeping between retries
|
|
"https://github.com/sourcegraph/scip-clang/releases/download/v0.3.2/scip-clang-x86_64-linux",
|
|
] * 5,
|
|
)
|
|
|
|
# SourceGraph CLI
|
|
http_file(
|
|
name = "scip-src",
|
|
executable = True,
|
|
sha256 = "eb3d627c4dad56b9f5d06634b90384104db065d410c4b338fa5e6558be4f3ad9",
|
|
urls = [
|
|
# Implements retry by relisting each url multiple times to be used as a failover.
|
|
# TODO(SERVER-86719): Re-implement http_archive to allow sleeping between retries
|
|
"https://github.com/sourcegraph/src-cli/releases/download/6.4.0/src_linux_amd64",
|
|
] * 5,
|
|
)
|
|
|
|
bazel_dep(name = "rules_cc", version = "0.2.10")
|
|
bazel_dep(name = "platforms", version = "0.0.11")
|
|
single_version_override(
|
|
module_name = "platforms",
|
|
version = "0.0.11",
|
|
)
|
|
|
|
# TODO move over from WORKSPACE
|
|
# buf does not support s390x
|
|
#bazel_dep(name = "aspect_rules_lint", version = "1.1.0")
|
|
#single_version_override(
|
|
# module_name = "aspect_rules_lint",
|
|
# version = "1.1.0",
|
|
#)
|
|
|
|
bazel_dep(name = "rules_multirun", version = "0.9.0")
|
|
bazel_dep(name = "aspect_bazel_lib", version = "2.13.0")
|
|
single_version_override(
|
|
module_name = "aspect_bazel_lib",
|
|
version = "2.13.0",
|
|
)
|
|
|
|
bazel_dep(name = "aspect_rules_js", version = "2.1.3")
|
|
single_version_override(
|
|
module_name = "aspect_rules_js",
|
|
version = "2.1.3",
|
|
)
|
|
|
|
bazel_dep(name = "rules_nodejs", version = "6.3.0")
|
|
single_version_override(
|
|
module_name = "rules_nodejs",
|
|
version = "6.3.0",
|
|
)
|
|
|
|
bazel_dep(name = "rules_poetry", version = "")
|
|
git_override(
|
|
module_name = "rules_poetry",
|
|
commit = "092d43107d13e711ac4ac92050d8b570bcc8ef43",
|
|
patches = ["//bazel/rules_poetry:rules_poetry.patch"],
|
|
remote = "https://github.com/mongodb-forks/rules_poetry",
|
|
)
|
|
|
|
#
|
|
## We need skylib to be able to use config_setting_group in rule_poetry below
|
|
## https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md#selectsconfig_setting_group
|
|
bazel_dep(name = "bazel_skylib", version = "1.9.0")
|
|
bazel_dep(name = "rules_pkg", version = "1.2.0")
|
|
bazel_dep(name = "abseil-cpp", version = "20250512.1", repo_name = "com_google_absl")
|
|
local_path_override(
|
|
module_name = "abseil-cpp",
|
|
path = "src/third_party/abseil-cpp/dist",
|
|
)
|
|
|
|
bazel_dep(name = "protobuf", version = "31.1", repo_name = "com_google_protobuf")
|
|
local_path_override(
|
|
module_name = "protobuf",
|
|
path = "src/third_party/protobuf/dist",
|
|
)
|
|
|
|
bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
|
|
local_path_override(
|
|
module_name = "googletest",
|
|
path = "src/third_party/googletest",
|
|
)
|
|
|
|
bazel_dep(name = "grpc", version = "1.74.1", repo_name = "com_github_grpc_grpc")
|
|
local_path_override(
|
|
module_name = "grpc",
|
|
path = "src/third_party/grpc/dist",
|
|
)
|
|
|
|
bazel_dep(name = "boringssl", version = "")
|
|
local_path_override(
|
|
module_name = "boringssl",
|
|
path = "src/third_party/boringssl_replacement",
|
|
)
|
|
|
|
bazel_dep(name = "c-ares", version = "1.27.0")
|
|
local_path_override(
|
|
module_name = "c-ares",
|
|
path = "src/third_party/cares",
|
|
)
|
|
|
|
bazel_dep(name = "re2", version = "2025-08-12")
|
|
local_path_override(
|
|
module_name = "re2",
|
|
path = "src/third_party/re2/dist",
|
|
)
|
|
|
|
bazel_dep(name = "zlib", version = "1.3.1")
|
|
local_path_override(
|
|
module_name = "zlib",
|
|
path = "src/third_party/zlib",
|
|
)
|
|
|
|
# When updating fuzztest run the following command
|
|
# bazel run @fuzztest//bazel:setup_configs > bazelrc.fuzztest
|
|
bazel_dep(name = "fuzztest", version = "20250805.0")
|
|
local_path_override(
|
|
module_name = "fuzztest",
|
|
path = "src/third_party/fuzztest/dist",
|
|
)
|
|
|
|
bazel_dep(name = "rules_python", version = "1.8.5")
|
|
|
|
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
|
|
single_version_override(
|
|
module_name = "buildifier_prebuilt",
|
|
version = "6.4.0",
|
|
)
|
|
|
|
bazel_dep(name = "prometheus-cpp", version = "1.3.0", repo_name = "com_github_jupp0r_prometheus_cpp")
|
|
local_path_override(
|
|
module_name = "prometheus-cpp",
|
|
path = "src/third_party/prometheus-cpp/dist",
|
|
)
|
|
|
|
bazel_dep(name = "rules_multitool", version = "0.4.0")
|
|
|
|
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
|
|
multitool.hub(lockfile = "//tools/lint:multitool.lock.json")
|
|
use_repo(multitool, "multitool")
|
|
|
|
# TODO port over from WORKSPACE
|
|
# currently breaks pyright
|
|
##node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
|
|
##node.toolchain(node_version = "18.20.4")
|
|
|
|
##
|
|
##npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
|
|
##npm.npm_translate_lock(
|
|
## name = "npm",
|
|
## npmrc = "//:.npmrc",
|
|
## pnpm_lock = "//:pnpm-lock.yaml",
|
|
## verify_node_modules_ignored = "//:.bazelignore",
|
|
##)
|
|
##use_repo(npm, "npm")
|
|
##
|
|
##pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
|
|
##use_repo(pnpm, "pnpm")
|
|
#
|
|
setup_local_config_platform = use_repo_rule("//bazel/platforms:local_config_platform.bzl", "setup_local_config_platform")
|
|
|
|
setup_local_config_platform(name = "internal_platforms_do_not_use")
|
|
|
|
register_execution_platforms("@internal_platforms_do_not_use//host:host")
|
|
|
|
# TODO port over from WORKSPACE
|
|
# cannot be moved without changing the path or creating a symlink
|
|
# to _main~setup_mongo_toolchains~mongo_toolchain_v4 and _main~setup_mongo_toolchains~mongo_toolchain_v5
|
|
##setup_mongo_toolchains_extension = use_extension("//bazel/toolchains:mongo_toolchain.bzl", "setup_mongo_toolchains_extension")
|
|
##use_repo(
|
|
## setup_mongo_toolchains_extension,
|
|
## "mongo_toolchain_v4",
|
|
## "mongo_toolchain_v5",
|
|
##)
|
|
#
|
|
setup_mongo_apple_toolchains_extension = use_extension("//bazel/toolchains/cc/mongo_apple:mongo_apple_toolchain.bzl", "setup_mongo_apple_toolchain_extension")
|
|
use_repo(setup_mongo_apple_toolchains_extension, "mongo_apple_toolchain")
|
|
|
|
register_toolchains(
|
|
"@mongo_apple_toolchain//...",
|
|
)
|
|
|
|
setup_mongo_python_toolchains = use_extension("//bazel:bzlmod.bzl", "setup_mongo_python_toolchains")
|
|
use_repo(
|
|
setup_mongo_python_toolchains,
|
|
"py_host",
|
|
"py_linux_arm64",
|
|
"py_linux_ppc64le",
|
|
"py_linux_s390x",
|
|
"py_linux_x86_64",
|
|
"py_macos_arm64",
|
|
"py_macos_x86_64",
|
|
"py_windows_x86_64",
|
|
)
|
|
|
|
register_toolchains(
|
|
"@py_linux_arm64//:python_toolchain",
|
|
"@py_linux_ppc64le//:python_toolchain",
|
|
"@py_linux_s390x//:python_toolchain",
|
|
"@py_linux_x86_64//:python_toolchain",
|
|
"@py_macos_arm64//:python_toolchain",
|
|
"@py_macos_x86_64//:python_toolchain",
|
|
"@py_windows_x86_64//:python_toolchain",
|
|
)
|
|
|
|
# broken on windows currently
|
|
setup_local_host_values = use_repo_rule("//bazel/platforms:local_host_values.bzl", "setup_local_host_values")
|
|
|
|
setup_local_host_values(name = "local_host_values")
|
|
|
|
setup_evergreen_variables = use_repo_rule("//bazel/repository_rules:evergreen_variables.bzl", "setup_evergreen_variables")
|
|
|
|
setup_evergreen_variables(name = "evergreen_variables")
|
|
|
|
setup_pgo_data = use_repo_rule("//bazel/repository_rules:pgo_data.bzl", "setup_pgo_data")
|
|
|
|
setup_pgo_data(name = "pgo_data")
|
|
|
|
setup_bolt_data = use_repo_rule("//bazel/repository_rules:bolt_data.bzl", "setup_bolt_data")
|
|
|
|
setup_bolt_data(name = "bolt_data")
|
|
|
|
mothra_repository = use_repo_rule("//bazel/repository_rules:mothra.bzl", "mothra_repository")
|
|
|
|
# This repository is created in CI setup or by manually cloning the 10gen/mothra repo to ./mothra.
|
|
# If the directory doesn't exist, a stub with empty teams will be created.
|
|
mothra_repository(name = "mothra")
|
|
|
|
setup_mongo_windows_toolchains_extension = use_extension("//bazel/toolchains/cc/mongo_windows:mongo_toolchain.bzl", "setup_mongo_windows_toolchain_extension")
|
|
use_repo(setup_mongo_windows_toolchains_extension, "mongo_windows_toolchain")
|
|
|
|
register_toolchains("@mongo_windows_toolchain//...")
|
|
|
|
###################### RUST DEPS ######################
|
|
bazel_dep(name = "rules_rust", version = "0.68.1")
|
|
|
|
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
|
|
rust.toolchain(
|
|
edition = "2024",
|
|
versions = ["nightly/2025-12-11"],
|
|
)
|
|
|
|
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
|
|
crate.spec(
|
|
package = "wasmtime",
|
|
version = "40.0.2",
|
|
)
|
|
crate.spec(
|
|
features = [
|
|
"cranelift",
|
|
"component-model",
|
|
"async",
|
|
"wasi",
|
|
],
|
|
package = "wasmtime-c-api-impl",
|
|
version = "40.0.2",
|
|
)
|
|
|
|
# We partially custom build wasmtime_c because otherwise it tries to use cmake
|
|
# to create generate conf.h
|
|
crate.annotation(
|
|
additive_build_file = "//src/third_party/wasmtime:BUILD.bazel.wasmtime",
|
|
crate = "wasmtime-c-api-impl",
|
|
extra_aliased_targets = {"wasmtime_c": "wasmtime_c"},
|
|
gen_build_script = "off",
|
|
)
|
|
crate.spec(
|
|
package = "zstd-sys",
|
|
version = "2.0.16+zstd.1.5.7",
|
|
)
|
|
|
|
# Bindgen uses libclang to parse code so it needs to know the path to libclang
|
|
crate.annotation_select(
|
|
build_script_data = [
|
|
"@@mongo_toolchain_v5//:libclang",
|
|
],
|
|
build_script_env = {
|
|
"LIBCLANG_PATH": "$(execpath @@mongo_toolchain_v5//:libclang)",
|
|
"BINDGEN_EXTRA_CLANG_ARGS": "-isystem$${pwd}/external/mongo_toolchain_v5/stow/llvm-v5/lib/clang/19/include",
|
|
},
|
|
crate = "zstd-sys",
|
|
repositories = ["crates"],
|
|
triples = [
|
|
"aarch64-unknown-linux-gnu",
|
|
"x86_64-unknown-linux-gnu",
|
|
"powerpc-unknown-linux-gnu",
|
|
"s390x-unknown-linux-gnu",
|
|
],
|
|
)
|
|
crate.from_specs()
|
|
use_repo(crate, "crates")
|
|
#################### END RUST DEPS ####################
|
|
|
|
wasi_deps = use_repo_rule(
|
|
"//bazel/toolchains/cc/mongo_wasm/toolchain:wasi_repo.bzl",
|
|
"setup_wasi_deps",
|
|
)
|
|
|
|
wasi_deps(name = "wasi_sdk")
|
|
|
|
spidermonkey_repo = use_repo_rule(
|
|
"//src/mongo/scripting/mozjs/wasm:spidermonkey_repo.bzl",
|
|
"spidermonkey_repository",
|
|
)
|
|
|
|
spidermonkey_repo(
|
|
name = "spidermonkey",
|
|
repository_file = "//src/mongo/scripting/mozjs/wasm/spider-monkey:spider-monkey-repository",
|
|
version_file = "//src/mongo/scripting/mozjs/wasm/spider-monkey:spider-monkey-version",
|
|
)
|