-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
Copy pathBUILD.bazel
133 lines (116 loc) · 3.04 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//bazel/install_rules:install_rules.bzl", "mongo_install")
load("//bazel/toolchains:mongo_toolchain.bzl", "setup_mongo_toolchain_aliases")
package(
default_visibility = ["//visibility:public"],
)
exports_files([
"pyproject.toml",
"poetry.lock",
"symbols.orderfile",
])
npm_link_all_packages(name = "node_modules")
alias(
name = "format",
actual = "//bazel/format",
)
alias(
name = "codeowners",
actual = "//buildscripts:codeowners",
)
setup_mongo_toolchain_aliases()
# This rule makes it possible to set the clang-tidy configuration setting:
genrule(
name = "clang_tidy_config",
srcs = [
".clang-tidy.in",
],
outs = [".clang-tidy"],
# Note: we use sed to substitute the known good value `build/compiledb/mongo`; testing
# has confirmed that this is the correct value.
# We also use it to append a line to opt-in to warnings as errors.
cmd = """
cp $(location .clang-tidy.in) $@ && \
sed -i 's|@MONGO_BUILD_DIR@|$(RULEDIR)/src/mongo|g ; s|@MONGO_BRACKET_BUILD_DIR@|$(RULEDIR)/src/mongo|g ; $$aWarningsAsErrors: "*"' $@
""",
visibility = ["//visibility:public"],
)
refresh_compile_commands(
name = "compiledb",
exclude_external_sources = True,
exclude_headers = "all", # not using "all" adds headers as sources to compile_commands.json which is never what we want
tags = ["compiledb"],
targets = {
"//src/...": "",
},
)
mongo_install(
name = "wiredtiger",
srcs = [
"//src/third_party/wiredtiger:wt",
],
)
mongo_install(
name = "mongod",
srcs = [
"//src/mongo/db:mongod",
],
)
mongo_install(
name = "mongos",
srcs = [
"//src/mongo/s:mongos",
],
)
mongo_install(
name = "mongo",
srcs = [
"//src/mongo/shell:mongo",
],
)
mongo_install(
name = "core",
srcs = [],
deps = [
"mongod",
"mongos",
],
)
mongo_install(
name = "devcore",
srcs = [],
deps = [
"mongo",
"mongod",
"mongos",
],
)
mongo_install(
name = "mongotest",
srcs = [
"//src/mongo/db/query/query_tester:mongotest",
],
)
mongo_install(
name = "dist-test",
srcs = [
"//src/mongo/db:mongod",
"//src/mongo/db:mongotrafficreader",
"//src/mongo/db/query/optimizer:optimizer_gdb_test_program",
"//src/mongo/db/query/query_tester:mongotest",
"//src/mongo/db/query/search/mongotmock",
"//src/mongo/db/storage/key_string:ksdecode",
"//src/mongo/s:mongos",
"//src/mongo/shell:mongo",
"//src/mongo/tools/mongobridge_tool:mongobridge",
"//src/mongo/util:pretty_printer_test_program",
"//src/third_party/wiredtiger:wt",
] + select({
"@platforms//os:windows": ["@windows_sasl//:bins"],
"//conditions:default": [],
}),
deps = [
"//src/mongo/db/modules/enterprise:dist-test",
],
)