SERVER-97871 Move Remaining Dist-Test Binary Compiles over to Bazel (#29869)

GitOrigin-RevId: 173cf44ae6fe66003f9142cea48b01e4fc1169aa
This commit is contained in:
Andrew Bradshaw 2024-12-17 13:02:42 -08:00 committed by MongoDB Bot
parent 69c2f0ad43
commit e13a7975a7
25 changed files with 425 additions and 265 deletions

View File

@ -165,7 +165,7 @@ build:opt --//bazel/config:dbg=False
build:opt --//bazel/config:dbg_level=2
build:opt --//bazel/config:debug_symbols=True
build:opt --//bazel/config:separate_debug=False
build:opt --//bazel/config:compiler_type=clang
build:opt --//bazel/config:compiler_type=gcc
build:opt --//bazel/config:linkstatic=True
build:opt --//bazel/config:build_enterprise=True
build:opt --//bazel/config:release=False

View File

@ -6699,13 +6699,92 @@ if env.get("__NINJA_NO") != "1":
t = target[0]
suffix = getattr(t.attributes, "aib_effective_suffix", t.get_suffix())
bazel_node = env.File(
t.abspath.replace(
f"{env.Dir('#').abspath}/{env['BAZEL_OUT_DIR']}/src", env.Dir("$BUILD_DIR").path
)
proj_path = env.Dir("#src").abspath.replace("\\", "/")
build_path = env.Dir("$BUILD_DIR").abspath.replace("\\", "/")
bazel_path = os.path.join(env.Dir("#").abspath, env["BAZEL_OUT_DIR"] + "/src").replace(
"\\", "/"
)
prog_output = env.BazelAutoInstallSingleTarget(bazel_node, suffix, bazel_node)
new_path = t.abspath.replace("\\", "/").replace(proj_path, build_path)
new_path = new_path.replace(build_path, bazel_path)
bazel_node = env.File(new_path)
debug_files = []
debug_suffix = ""
# This was copied from separate_debug.py
if env.TargetOSIs("darwin"):
# There isn't a lot of great documentation about the structure of dSYM bundles.
# For general bundles, see:
#
# https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html
#
# But we expect to find two files in the bundle. An
# Info.plist file under Contents, and a file with the same
# name as the target under Contents/Resources/DWARF.
target0 = bazel_node
dsym_dir_name = target0.name + ".dSYM"
dsym_dir = env.Dir(dsym_dir_name, directory=target0.get_dir())
dwarf_sym_with_debug = os.path.join(
dsym_dir.abspath, f"Contents/Resources/DWARF/{target0.name}_shared_with_debug.dylib"
)
# this handles shared libs or program binaries
if os.path.exists(dwarf_sym_with_debug):
dwarf_sym_name = f"{target0.name}.dylib"
else:
dwarf_sym_with_debug = os.path.join(
dsym_dir.abspath, f"Contents/Resources/DWARF/{target0.name}_with_debug"
)
dwarf_sym_name = f"{target0.name}"
plist_file = env.File("Contents/Info.plist", directory=dsym_dir)
setattr(plist_file.attributes, "aib_effective_suffix", ".dSYM")
setattr(
plist_file.attributes,
"aib_additional_directory",
"{}/Contents".format(dsym_dir_name),
)
dwarf_dir = env.Dir("Contents/Resources/DWARF", directory=dsym_dir)
dwarf_file = env.File(dwarf_sym_with_debug, directory=dwarf_dir)
setattr(dwarf_file.attributes, "aib_effective_suffix", ".dSYM")
setattr(
dwarf_file.attributes,
"aib_additional_directory",
"{}/Contents/Resources/DWARF".format(dsym_dir_name),
)
setattr(dwarf_file.attributes, "aib_new_name", dwarf_sym_name)
debug_files.extend([plist_file, dwarf_file])
debug_suffix = ".dSYM"
elif env.TargetOSIs("posix"):
debug_suffix = env.subst("$SEPDBG_SUFFIX")
debug_file = env.File(f"{os.path.splitext(bazel_node.abspath)[0]}{debug_suffix}")
debug_files.append(debug_file)
elif env.TargetOSIs("windows"):
debug_suffix = ".pdb"
debug_file = env.File(f"{os.path.splitext(bazel_node.abspath)[0]}{debug_suffix}")
debug_files.append(debug_file)
else:
pass
for debug_file in debug_files:
setattr(debug_file.attributes, "debug_file_for", bazel_node)
setattr(bazel_node.attributes, "separate_debug_files", debug_files)
installed_prog = env.BazelAutoInstallSingleTarget(bazel_node, suffix, bazel_node)
installed_debugs = []
for debug_file in debug_files:
installed_debugs.append(
env.BazelAutoInstallSingleTarget(debug_file, debug_suffix, debug_file)
)
libs = []
debugs = []
@ -6732,9 +6811,13 @@ if env.get("__NINJA_NO") != "1":
)[0]
)
env.Depends(prog_output[0], libs)
if len(prog_output) == 2:
env.Depends(prog_output[1], debugs)
env.Depends(installed_prog, libs)
for installed_debug_file in installed_debugs:
env.Depends(installed_debug_file, debugs)
setattr(t.attributes, "AIB_INSTALLED_FILES", installed_prog)
return target, source
builder = env["BUILDERS"]["BazelProgram"]

View File

@ -238,13 +238,6 @@ def setup_args_parser():
help="Print an optimal order of target conversion for the bazel conversion.",
)
parser.add_argument(
"--bazel-order-core",
action="store_true",
default=False,
help="Print an optimal order of target conversion for the bazel conversion focused just on the core binaries.",
)
parser.add_argument(
"--indegree-one",
action="store_true",
@ -381,9 +374,6 @@ def main():
if args.bazel_order:
analysis.append(libdeps_analyzer.BazelOrder(libdeps_graph))
if args.bazel_order_core:
analysis.append(libdeps_analyzer.BazelOrderCore(libdeps_graph))
for analyzer_args in args.critical_edges:
analysis.append(
libdeps_analyzer.CriticalEdges(

View File

@ -710,54 +710,6 @@ class BazelOrder(Analyzer):
report[DependsReportTypes.BAZEL_ORDER.name] = self.run()
class BazelOrderCore(Analyzer):
"""Generate a topo sort order to covnert bazel targets."""
def __init__(self, dependency_graph):
"""Store graph and strip the nodes."""
super().__init__(dependency_graph)
@schema_check(schema_version=1)
def run(self):
"""Let networkx generate the list for us."""
order = []
mongod_graph = networkx.subgraph(
self._dependency_graph,
networkx.descendants(self._dependency_graph, "mongo/db/mongod") | {"mongo/db/mongod"},
)
mongos_graph = networkx.subgraph(
self._dependency_graph,
networkx.descendants(self._dependency_graph, "mongo/s/mongos") | {"mongo/s/mongos"},
)
mongo_graph = networkx.subgraph(
self._dependency_graph,
networkx.descendants(self._dependency_graph, "mongo/shell/mongo")
| {"mongo/shell/mongo"},
)
for node in networkx.lexicographical_topological_sort(
networkx.compose_all(
[
networkx.reverse_view(mongod_graph),
networkx.reverse_view(mongos_graph),
networkx.reverse_view(mongo_graph),
]
)
):
node_type = self._dependents_graph.nodes()[node].get(NodeProps.bin_type.name, "Unknown")
if node_type != "ThinTarget":
order.append({"type": node_type, "name": node})
return order
def report(self, report):
"""Add the symbol dependents list to the report."""
if DependsReportTypes.BAZEL_ORDER_CORE.name not in report:
report[DependsReportTypes.BAZEL_ORDER_CORE.name] = {}
report[DependsReportTypes.BAZEL_ORDER_CORE.name] = self.run()
class Efficiency(Analyzer):
"""Find efficiency of each public dependency originating from each node in a given set."""
@ -1231,12 +1183,6 @@ class GaPrettyPrinter(GaPrinter):
_bazel_order_print(
results, DependsReportTypes.BAZEL_ORDER.name, "Bazel Target Conversion Order"
)
if DependsReportTypes.BAZEL_ORDER_CORE.name in results:
_bazel_order_print(
results,
DependsReportTypes.BAZEL_ORDER_CORE.name,
"Bazel Core Target Conversion Order",
)
if LinterTypes.EFFICIENCY_LINT.name in results:
data = results[LinterTypes.EFFICIENCY_LINT.name]

View File

@ -72,7 +72,6 @@ class DependsReportTypes(Enum):
EFFICIENCY = auto()
BAZEL_CONV_CANDIDATES = auto()
BAZEL_ORDER = auto()
BAZEL_ORDER_CORE = auto()
class LinterTypes(Enum):

View File

@ -607,17 +607,6 @@ tasks:
content_type: text/plain
display_name: Bazel Target Conversions
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/bazel_order_core.txt
remote_file: ${project}/${build_variant}/${revision}/artifacts/bazel_order_core.txt.${build_id}-${task_name}.${execution}
bucket: mciuploads
permissions: public-read
content_type: text/plain
display_name: Bazel Target Conversions Core Binaries
- command: s3.put
params:
aws_key: ${aws_key}

View File

@ -11,7 +11,6 @@ GRAPH_FILE=$(find build -name "libdeps.graphml")
python buildscripts/libdeps/analyzer_unittests.py
python buildscripts/libdeps/gacli.py --graph-file $GRAPH_FILE > results.txt
python buildscripts/libdeps/gacli.py --graph-file $GRAPH_FILE --lint= --bazel-order > bazel_order.txt
python buildscripts/libdeps/gacli.py --graph-file $GRAPH_FILE --lint= --bazel-order-core > bazel_order_core.txt
gzip $GRAPH_FILE
mv $GRAPH_FILE.gz .
targets_converted=$(grep "Targets Converted:" bazel_order.txt | cut -d":" -f 2)

View File

@ -397,7 +397,12 @@ def auto_install_pseudobuilder(env, target, source, **kwargs):
aib_additional_directory = getattr(s.attributes, "aib_additional_directory", None)
if aib_additional_directory is not None:
target_for_source = env.Dir(aib_additional_directory, directory=target_for_source)
new_installed_files = env.Install(target=target_for_source, source=s)
aib_new_name = getattr(s.attributes, "aib_new_name", None)
if aib_new_name is not None:
install_file = env.File(aib_new_name, target_for_source)
new_installed_files = env.InstallAs(install_file, s)
else:
new_installed_files = env.Install(target=target_for_source, source=s)
setattr(s.attributes, INSTALLED_FILES, new_installed_files)
setattr(new_installed_files[0].attributes, "AIB_INSTALL_FROM", s)
installed_files.extend(new_installed_files)
@ -449,6 +454,9 @@ def auto_install_emitter(target, source, env):
if env.get("AIB_IGNORE", False):
continue
if t.has_builder() and t.get_builder().get_name(env) == "BazelProgram":
continue
# There is no API for determining if an Entry is operating in
# a SConf context. We obviously do not want to auto tag, and
# install conftest Programs. So we filter them out the only

View File

@ -640,7 +640,7 @@ def create_bazel_builder(builder: SCons.Builder.Builder) -> SCons.Builder.Builde
src_suffix=builder.src_suffix,
source_scanner=builder.source_scanner,
target_scanner=builder.target_scanner,
emitter=SCons.Builder.ListEmitter([builder.emitter, bazel_target_emitter]),
emitter=SCons.Builder.ListEmitter([bazel_target_emitter]),
)
@ -872,19 +872,19 @@ def timed_auto_install_bazel(env, libdep, shlib_suffix):
def auto_install_single_target(env, libdep, suffix, bazel_node):
auto_install_mapping = env["AIB_SUFFIX_MAP"].get(suffix)
if auto_install_mapping is not None:
env.AutoInstall(
target=auto_install_mapping.directory,
source=[bazel_node],
AIB_COMPONENT=env.get("AIB_COMPONENT", "AIB_DEFAULT_COMPONENT"),
AIB_ROLE=auto_install_mapping.default_role,
AIB_COMPONENTS_EXTRA=env.get("AIB_COMPONENTS_EXTRA", []),
)
auto_installed_libdep = env.GetAutoInstalledFiles(libdep)
auto_installed_bazel_node = env.GetAutoInstalledFiles(bazel_node)
env.AutoInstall(
target=auto_install_mapping.directory,
source=[bazel_node],
AIB_COMPONENT=env.get("AIB_COMPONENT", "AIB_DEFAULT_COMPONENT"),
AIB_ROLE=auto_install_mapping.default_role,
AIB_COMPONENTS_EXTRA=env.get("AIB_COMPONENTS_EXTRA", []),
)
auto_installed_libdep = env.GetAutoInstalledFiles(libdep)
auto_installed_bazel_node = env.GetAutoInstalledFiles(bazel_node)
if auto_installed_libdep[0] != auto_installed_bazel_node[0]:
env.Depends(auto_installed_libdep[0], auto_installed_bazel_node[0])
if auto_installed_libdep[0] != auto_installed_bazel_node[0]:
env.Depends(auto_installed_libdep[0], auto_installed_bazel_node[0])
return env.GetAutoInstalledFiles(bazel_node)
@ -919,20 +919,83 @@ def auto_install_bazel(env, libdep, shlib_suffix):
continue
bazel_node = env.File(f"#/{line}")
bazel_node_debug = env.File(f"#/{line}$SEPDBG_SUFFIX")
debug_files = []
debug_suffix = ""
# This was copied from separate_debug.py
if env.TargetOSIs("darwin"):
# There isn't a lot of great documentation about the structure of dSYM bundles.
# For general bundles, see:
#
# https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html
#
# But we expect to find two files in the bundle. An
# Info.plist file under Contents, and a file with the same
# name as the target under Contents/Resources/DWARF.
setattr(bazel_node_debug.attributes, "debug_file_for", bazel_node)
setattr(bazel_node.attributes, "separate_debug_files", [bazel_node_debug])
target0 = bazel_node
dsym_dir_name = target0.name + ".dSYM"
dsym_dir = env.Dir(f"#/{line}.dSYM")
dwarf_sym_with_debug = os.path.join(
dsym_dir.abspath, f"Contents/Resources/DWARF/{target0.name}_shared_with_debug.dylib"
)
# this handles shared libs or program binaries
if os.path.exists(dwarf_sym_with_debug):
dwarf_sym_name = f"{target0.name}.dylib"
else:
dwarf_sym_with_debug = os.path.join(
dsym_dir.abspath, f"Contents/Resources/DWARF/{target0.name}_with_debug"
)
dwarf_sym_name = f"{target0.name}"
plist_file = env.File("Contents/Info.plist", directory=dsym_dir)
setattr(plist_file.attributes, "aib_effective_suffix", ".dSYM")
setattr(
plist_file.attributes,
"aib_additional_directory",
"{}/Contents".format(dsym_dir_name),
)
dwarf_dir = env.Dir("Contents/Resources/DWARF", directory=dsym_dir)
dwarf_file = env.File(dwarf_sym_with_debug, directory=dwarf_dir)
setattr(dwarf_file.attributes, "aib_effective_suffix", ".dSYM")
setattr(
dwarf_file.attributes,
"aib_additional_directory",
"{}/Contents/Resources/DWARF".format(dsym_dir_name),
)
setattr(dwarf_file.attributes, "aib_new_name", dwarf_sym_name)
debug_files.extend([plist_file, dwarf_file])
debug_suffix = ".dSYM"
elif env.TargetOSIs("posix"):
debug_suffix = env.subst("$SEPDBG_SUFFIX")
debug_file = env.File(f"#/{line}{debug_suffix}")
debug_files.append(debug_file)
elif env.TargetOSIs("windows"):
debug_suffix = ".pdb"
debug_file = env.File(f"#/{line}{debug_suffix}")
debug_files.append(debug_file)
else:
pass
for debug_file in debug_files:
setattr(debug_file.attributes, "debug_file_for", bazel_node)
setattr(bazel_node.attributes, "separate_debug_files", debug_files)
auto_install_single_target(env, bazel_libdep, shlib_suffix, bazel_node)
if env.GetAutoInstalledFiles(bazel_libdep):
auto_install_single_target(
env,
getattr(bazel_libdep.attributes, "separate_debug_files")[0],
env.subst("$SEPDBG_SUFFIX"),
bazel_node_debug,
)
for debug_file in debug_files:
auto_install_single_target(
env,
getattr(bazel_libdep.attributes, "separate_debug_files")[0],
debug_suffix,
debug_file,
)
return env.GetAutoInstalledFiles(libdep)

View File

@ -51,6 +51,9 @@ def build_pretty_printer_test(env, target, **kwargs):
if env.GetOption("ninja") != "disabled":
return []
if env.GetOption("link-model") == "dynamic-sdk":
return []
gdb_bin = None
if env.get("GDB"):
gdb_bin = env.get("GDB")

View File

@ -1,4 +1,4 @@
load("//bazel:mongo_src_rules.bzl", "idl_generator", "mongo_cc_library", "mongo_cc_unit_test")
load("//bazel:mongo_src_rules.bzl", "idl_generator", "mongo_cc_binary", "mongo_cc_library", "mongo_cc_unit_test")
package(default_visibility = ["//visibility:public"])

View File

@ -1,4 +1,4 @@
load("//bazel:mongo_src_rules.bzl", "mongo_cc_library", "mongo_cc_unit_test")
load("//bazel:mongo_src_rules.bzl", "mongo_cc_binary", "mongo_cc_library", "mongo_cc_unit_test")
package(default_visibility = ["//visibility:public"])
@ -49,3 +49,19 @@ mongo_cc_unit_test(
"//src/mongo/db/exec/sbe:query_sbe", # needed to register extended type destruction for MakeObjSpec :(
],
)
mongo_cc_binary(
name = "optimizer_gdb_test_program",
srcs = [
"optimizer_gdb_test_program.cpp",
"//src/mongo/db/exec/sbe/abt:abt_unit_test_literals.h",
],
tags = [
"dist_test",
],
deps = [
"//src/mongo/db:service_context_non_d",
"//src/mongo/db:service_context_test_fixture",
"//src/mongo/db/exec/sbe:abt_unit_test_utils",
],
)

View File

@ -20,16 +20,9 @@ env.CppUnitTest(
LIBDEPS=[],
)
optimizer_gdb_test_program = env.Program(
optimizer_gdb_test_program = env.BazelProgram(
target="optimizer_gdb_test_program",
source=[
"optimizer_gdb_test_program.cpp",
],
LIBDEPS=[
"$BUILD_DIR/mongo/db/exec/sbe/abt_unit_test_utils",
"$BUILD_DIR/mongo/db/service_context_non_d",
"$BUILD_DIR/mongo/db/service_context_test_fixture",
],
source=[],
AIB_COMPONENT="pretty-printer-tests",
AIB_COMPONENTS_EXTRA=["dist-test"],
)

View File

@ -0,0 +1,43 @@
load("//bazel:mongo_src_rules.bzl", "mongo_cc_binary", "mongo_cc_library")
package(default_visibility = ["//visibility:public"])
mongo_cc_library(
name = "mongotest_core",
srcs = [
"command_helpers.cpp",
"file_helpers.cpp",
"test.cpp",
"testfile.cpp",
],
hdrs = [
"command_helpers.h",
"file_helpers.h",
"test.h",
"testfile.h",
],
deps = [
"//src/mongo:base",
"//src/mongo/client:clientdriver_network",
"//src/mongo/db:common",
"//src/mongo/db/query/util:jparse_util",
"//src/mongo/rpc:message",
"//src/mongo/shell:shell_utils",
"//src/mongo/transport:transport_layer_manager",
],
)
mongo_cc_binary(
name = "mongotest",
srcs = [
"main.cpp",
"mock_version_info.h",
],
tags = [
"devcore",
"dist_test",
],
deps = [
"mongotest_core",
],
)

View File

@ -9,31 +9,10 @@ env.AppendUnique(
"mongo/platform/basic.h",
],
)
env.Library(
target="mongotest_core",
source=[
"command_helpers.cpp",
"file_helpers.cpp",
"test.cpp",
"testfile.cpp",
],
LIBDEPS=[
"$BUILD_DIR/mongo/base",
"$BUILD_DIR/mongo/client/clientdriver_network",
"$BUILD_DIR/mongo/db/common",
"$BUILD_DIR/mongo/db/query/util/jparse_util",
"$BUILD_DIR/mongo/rpc/message",
"$BUILD_DIR/mongo/shell/shell_utils",
"$BUILD_DIR/mongo/transport/transport_layer_manager",
],
)
mongoTest = env.Program(
mongoTest = env.BazelProgram(
target="mongotest",
source=["main.cpp"],
LIBDEPS=[
"mongotest_core",
],
source=[],
AIB_COMPONENT="mongotest",
AIB_COMPONENTS_EXTRA=[
"devcore",

View File

@ -1,4 +1,4 @@
load("//bazel:mongo_src_rules.bzl", "mongo_cc_library")
load("//bazel:mongo_src_rules.bzl", "mongo_cc_binary", "mongo_cc_library")
package(default_visibility = ["//visibility:public"])
@ -8,3 +8,46 @@ exports_files(
"*.cpp",
]),
)
mongo_cc_library(
name = "mongotmock_core",
srcs = [
"mongotmock_buildinfo.cpp",
"mongotmock_commands.cpp",
"mongotmock_ismaster.cpp",
"mongotmock_options_init.cpp",
"mongotmock_state.cpp",
],
hdrs = [
"mongotmock_state.h",
],
deps = [
"//src/mongo/db:api_parameters",
"//src/mongo/db:server_options_servers",
"//src/mongo/db:wire_version",
"//src/mongo/db/auth:authmocks",
"//src/mongo/db/auth:authserver",
"//src/mongo/db/commands:buildinfo_common",
"//src/mongo/db/commands:core",
"//src/mongo/db/commands:test_commands_enabled",
"//src/mongo/db/pipeline:sharded_agg_helpers",
"//src/mongo/db/query:command_request_response",
"//src/mongo/db/query/search:search_index_common",
"//src/mongo/util:version_impl",
],
)
mongo_cc_binary(
name = "mongotmock",
srcs = [
"mongotmock_main_shim.cpp",
],
tags = [
"dist_test",
],
deps = [
"mongotmock_core",
"//src/mongo/db/query:plan_executor",
"//src/mongo/util/cryptd:mongocryptd_core",
],
)

View File

@ -4,41 +4,9 @@ Import("env")
env = env.Clone()
env.Library(
target="mongotmock_core",
source=[
"mongotmock_buildinfo.cpp",
"mongotmock_commands.cpp",
"mongotmock_ismaster.cpp",
"mongotmock_options_init.cpp",
"mongotmock_state.cpp",
],
LIBDEPS_PRIVATE=[
"$BUILD_DIR/mongo/db/api_parameters",
"$BUILD_DIR/mongo/db/auth/authmocks",
"$BUILD_DIR/mongo/db/auth/authserver",
"$BUILD_DIR/mongo/db/commands/buildinfo_common",
"$BUILD_DIR/mongo/db/commands/core",
"$BUILD_DIR/mongo/db/commands/test_commands_enabled",
"$BUILD_DIR/mongo/db/pipeline/sharded_agg_helpers",
"$BUILD_DIR/mongo/db/query/command_request_response",
"$BUILD_DIR/mongo/db/query/search/search_index_common",
"$BUILD_DIR/mongo/db/server_options_servers",
"$BUILD_DIR/mongo/db/wire_version",
"$BUILD_DIR/mongo/util/version_impl",
],
)
mongotmock = env.Program(
mongotmock = env.BazelProgram(
target="mongotmock",
source=[
"mongotmock_main_shim.cpp",
],
LIBDEPS=[
"$BUILD_DIR/mongo/db/query/plan_executor",
"$BUILD_DIR/mongo/util/cryptd/mongocryptd_core",
"mongotmock_core",
],
source=[],
AIB_COMPONENT="mongotmock",
AIB_COMPONENTS_EXTRA=["dist-test"],
)

View File

@ -1,4 +1,4 @@
load("//bazel:mongo_src_rules.bzl", "mongo_cc_library", "mongo_cc_unit_test")
load("//bazel:mongo_src_rules.bzl", "mongo_cc_binary", "mongo_cc_library", "mongo_cc_unit_test")
package(default_visibility = ["//visibility:public"])
@ -34,3 +34,18 @@ mongo_cc_unit_test(
"key_string",
],
)
mongo_cc_binary(
name = "ksdecode",
srcs = [
"key_string_decode.cpp",
],
tags = [
"dist_test",
],
deps = [
"key_string",
"//src/mongo/db:server_base",
"//src/mongo/util/options_parser",
],
)

View File

@ -13,16 +13,9 @@ env.Benchmark(
],
)
ksdecode = env.Program(
ksdecode = env.BazelProgram(
target="ksdecode",
source=[
"key_string_decode.cpp",
],
LIBDEPS=[
"$BUILD_DIR/mongo/db/server_base",
"$BUILD_DIR/mongo/util/options_parser/options_parser",
"key_string",
],
source=[],
AIB_COMPONENT="ksdecode",
AIB_COMPONENTS_EXTRA=[
"dist-test",

View File

@ -1,4 +1,4 @@
load("//bazel:mongo_src_rules.bzl", "idl_generator", "mongo_cc_library")
load("//bazel:mongo_src_rules.bzl", "idl_generator", "mongo_cc_binary", "mongo_cc_library")
package(default_visibility = ["//visibility:public"])
@ -16,3 +16,32 @@ idl_generator(
"//src/mongo/db:basic_types_gen",
],
)
mongo_cc_binary(
name = "mongobridge",
srcs = [
"bridge.cpp",
"bridge_commands.cpp",
"bridge_commands.h",
"mongobridge_options.cpp",
"mongobridge_options.h",
"mongobridge_options_gen",
"mongobridge_options_init.cpp",
],
tags = [
"dist_test",
],
deps = [
"//src/mongo/db:dbmessage",
"//src/mongo/db:service_context_non_d",
"//src/mongo/rpc",
"//src/mongo/transport:message_compressor",
"//src/mongo/transport:message_compressor_options_server",
"//src/mongo/transport:service_executor",
"//src/mongo/transport:session_manager",
"//src/mongo/transport:transport_layer_manager",
"//src/mongo/util:signal_handlers",
"//src/mongo/util/net:network",
"//src/mongo/util/options_parser:options_parser_init",
],
)

View File

@ -5,27 +5,8 @@ env = env.Clone()
yamlEnv = env.Clone()
yamlEnv.InjectThirdParty(libraries=["yaml"])
mongobridge = env.Program(
mongobridge = env.BazelProgram(
target="mongobridge",
source=[
"bridge.cpp",
"bridge_commands.cpp",
"mongobridge_options.cpp",
"mongobridge_options_gen.cpp",
"mongobridge_options_init.cpp",
],
LIBDEPS=[
"$BUILD_DIR/mongo/db/dbmessage",
"$BUILD_DIR/mongo/db/service_context_non_d",
"$BUILD_DIR/mongo/rpc/rpc",
"$BUILD_DIR/mongo/transport/message_compressor",
"$BUILD_DIR/mongo/transport/message_compressor_options_server",
"$BUILD_DIR/mongo/transport/service_executor",
"$BUILD_DIR/mongo/transport/session_manager",
"$BUILD_DIR/mongo/transport/transport_layer_manager",
"$BUILD_DIR/mongo/util/net/network",
"$BUILD_DIR/mongo/util/options_parser/options_parser_init",
"$BUILD_DIR/mongo/util/signal_handlers",
],
source=[],
AIB_COMPONENT="dist-test",
)

View File

@ -1,4 +1,4 @@
load("//bazel:mongo_src_rules.bzl", "MONGO_GLOBAL_COPTS", "MONGO_GLOBAL_DEFINES", "MONGO_GLOBAL_LINKFLAGS", "idl_generator", "mongo_cc_library", "mongo_cc_unit_test")
load("//bazel:mongo_src_rules.bzl", "MONGO_GLOBAL_COPTS", "MONGO_GLOBAL_DEFINES", "MONGO_GLOBAL_LINKFLAGS", "idl_generator", "mongo_cc_binary", "mongo_cc_library", "mongo_cc_unit_test")
load("//bazel/config:generate_config_header.bzl", "generate_config_header")
load("//bazel/config:render_template.bzl", "render_template")
@ -832,6 +832,30 @@ mongo_cc_unit_test(
],
)
mongo_cc_binary(
name = "pretty_printer_test_program",
srcs = [
"pretty_printer_test_program.cpp",
"//src/mongo/db:cluster_role.h",
"//src/mongo/db:database_name.h",
"//src/mongo/db:database_name_reserved.def.h",
"//src/mongo/db:namespace_string.h",
"//src/mongo/db:namespace_string_reserved.def.h",
"//src/mongo/db:server_options.h",
"//src/mongo/db:tenant_id.h",
"//src/mongo/db/auth:cluster_auth_mode.h",
"//src/mongo/db/repl:optime.h",
"//src/mongo/util/net:cidr.h",
"//src/mongo/util/version:releases.h",
],
tags = [
"dist_test",
],
deps = [
"//src/mongo:base",
],
)
mongo_cc_unit_test(
name = "versioned_value_test",
srcs = [

View File

@ -35,7 +35,6 @@ env.SConscript(
must_exist=1,
dirs=[
"concurrency",
"cryptd",
"immutable",
"net",
"options_parser",
@ -342,14 +341,9 @@ env.Benchmark(
CONSOLIDATED_TARGET="first_half_bm",
)
pretty_printer_test_program = env.Program(
pretty_printer_test_program = env.BazelProgram(
target="pretty_printer_test_program",
source=[
"pretty_printer_test_program.cpp",
],
LIBDEPS=[
"$BUILD_DIR/mongo/base",
],
source=[],
AIB_COMPONENT="pretty-printer-tests",
AIB_COMPONENTS_EXTRA=["dist-test"],
)

View File

@ -16,3 +16,51 @@ idl_generator(
"//src/mongo/db:basic_types_gen",
],
)
mongo_cc_library(
name = "mongocryptd_core",
srcs = [
"cryptd_main.cpp",
"cryptd_options.cpp",
"cryptd_options_gen",
"cryptd_options_init.cpp",
"cryptd_service_entry_point.cpp",
"cryptd_watchdog.cpp",
],
hdrs = [
"cryptd_options.h",
"cryptd_service_entry_point.h",
"cryptd_watchdog.h",
],
deps = [
"//src/mongo/db:commands",
"//src/mongo/db:dbmessage",
"//src/mongo/db:server_options_servers",
"//src/mongo/db:serverinit",
"//src/mongo/db:service_context_non_d",
"//src/mongo/db:validate_api_parameters",
"//src/mongo/db/query/query_stats",
"//src/mongo/db/repl:repl_coordinator_interface",
"//src/mongo/db/storage:storage_engine_lock_file",
"//src/mongo/executor:network_interface_factory",
"//src/mongo/rpc",
"//src/mongo/s:grid",
"//src/mongo/transport:message_compressor",
"//src/mongo/transport:service_executor",
"//src/mongo/transport:session_manager",
"//src/mongo/transport:transport_layer",
"//src/mongo/transport:transport_layer_manager",
"//src/mongo/util:fail_point",
"//src/mongo/util:ntservice",
"//src/mongo/util:signal_handlers",
"//src/mongo/util:testing_options",
"//src/mongo/util:version_impl",
"//src/mongo/util/concurrency:spin_lock",
"//src/mongo/util/net:network",
"//src/mongo/util/options_parser:options_parser_init",
"//src/mongo/watchdog",
] + select({
"@platforms//os:windows": ["//src/mongo/db:windows_options"],
"//conditions:default": [],
}),
)

View File

@ -1,46 +0,0 @@
# -*- mode: python -*-
Import("env")
env = env.Clone()
env.Library(
target="mongocryptd_core",
source=[
"cryptd_main.cpp",
"cryptd_options.cpp",
"cryptd_options_init.cpp",
"cryptd_service_entry_point.cpp",
"cryptd_watchdog.cpp",
"cryptd_options_gen.cpp",
],
LIBDEPS_PRIVATE=[
"$BUILD_DIR/mongo/db/commands",
"$BUILD_DIR/mongo/db/dbmessage",
"$BUILD_DIR/mongo/db/query/query_stats/query_stats",
"$BUILD_DIR/mongo/db/repl/repl_coordinator_interface",
"$BUILD_DIR/mongo/db/server_options_servers",
"$BUILD_DIR/mongo/db/serverinit",
"$BUILD_DIR/mongo/db/service_context_non_d",
"$BUILD_DIR/mongo/db/storage/storage_engine_lock_file",
"$BUILD_DIR/mongo/db/validate_api_parameters",
"$BUILD_DIR/mongo/db/windows_options" if env.TargetOSIs("windows") else [],
"$BUILD_DIR/mongo/executor/network_interface_factory",
"$BUILD_DIR/mongo/rpc/rpc",
"$BUILD_DIR/mongo/s/grid",
"$BUILD_DIR/mongo/transport/message_compressor",
"$BUILD_DIR/mongo/transport/service_executor",
"$BUILD_DIR/mongo/transport/session_manager",
"$BUILD_DIR/mongo/transport/transport_layer",
"$BUILD_DIR/mongo/transport/transport_layer_manager",
"$BUILD_DIR/mongo/util/concurrency/spin_lock",
"$BUILD_DIR/mongo/util/fail_point",
"$BUILD_DIR/mongo/util/net/network",
"$BUILD_DIR/mongo/util/ntservice",
"$BUILD_DIR/mongo/util/options_parser/options_parser_init",
"$BUILD_DIR/mongo/util/signal_handlers",
"$BUILD_DIR/mongo/util/testing_options",
"$BUILD_DIR/mongo/util/version_impl",
"$BUILD_DIR/mongo/watchdog/watchdog",
],
)