# -*- mode: python -*- Import( [ "env", "get_option", "have_sasl_lib", "has_option", "version_extra", "version_parts", "wiredtiger", ] ) env = env.Clone() # Ideally 's2' would be scoped narrowly but it is spammed in all over the place by # db/geo unfortunately. env.InjectThirdParty( libraries=[ "s2", ] ) def shouldBuildGRPC(myEnv): return myEnv.TargetOSIs("linux") and myEnv["ENABLE_GRPC_BUILD"] env.SConscript( must_exist=1, dirs=[ "admission", "auth", "catalog", "commands", "concurrency", "exec", "fts", "ftdc", "geo", "process_health", "index", "matcher", "op_observer", "pipeline", "query", "repl", "s", "serverless", "session", "sorter", "stats", "storage", "timeseries", "transaction", "update", "views", ], exports=[ "env", ], ) env.CppUnitTest( target="server_base_test", source=[ "$BUILD_DIR/mongo/util/database_name_util_test.cpp", "$BUILD_DIR/mongo/util/namespace_string_util_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/server_base", ], ) env.Library( target="global_index", source=[ "global_index.cpp", ], LIBDEPS_PRIVATE=[ "catalog/collection_crud", "catalog/collection_options", "concurrency/exception_util", "dbhelpers", "index_builds_coordinator_interface", "query_exec", "server_base", "session/logical_session_id_helpers", "shard_role", "storage/key_string", "transaction/transaction", ], ) env.Benchmark( target="profile_filter_bm", source=[ "profile_filter_bm.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/commands/profile_common", "$BUILD_DIR/mongo/util/processinfo", "profile_filter", ], ) if env.TargetOSIs("windows"): env.Library( target="windows_options", source=[ "windows_options_gen.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/util/options_parser/options_parser", ], ) env.Library( target="serverinit", source=[ "initialize_server_global_state.cpp", "initialize_server_global_state_gen.cpp", "server_options_init.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/audit", "$BUILD_DIR/mongo/db/server_base", "$BUILD_DIR/mongo/util/processinfo", "$BUILD_DIR/mongo/util/signal_handlers", ], ) env.Library( target="change_stream_options_manager", source=[ "change_stream_options_manager.cpp", "change_stream_options_parameter_gen.cpp", ], LIBDEPS_PRIVATE=[ "change_stream_options", "change_stream_serverless_helpers", "repl/repl_coordinator_interface", "repl/repl_settings", "server_base", "service_context", ], ) env.Library( target="change_streams_cluster_parameter", source=[ "change_streams_cluster_parameter_gen.cpp", "change_streams_cluster_parameter.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/idl/cluster_server_parameter", "change_stream_serverless_helpers", "repl/repl_coordinator_interface", "repl/repl_settings", "server_base", ], ) env.Library( target="set_change_stream_state_coordinator", source=[ "set_change_stream_state_coordinator.cpp", "set_change_stream_state_coordinator_gen.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/change_stream_change_collection_manager", "$BUILD_DIR/mongo/db/change_stream_pre_images_collection_manager", "$BUILD_DIR/mongo/db/change_stream_serverless_helpers", "$BUILD_DIR/mongo/db/change_stream_state", "$BUILD_DIR/mongo/db/dbdirectclient", "$BUILD_DIR/mongo/db/repl/primary_only_service", "$BUILD_DIR/mongo/db/repl/repl_coordinator_interface", "$BUILD_DIR/mongo/db/repl/wait_for_majority_service", "$BUILD_DIR/mongo/idl/idl_parser", ], ) env.Library( target="change_stream_serverless_helpers", source=[ "change_stream_serverless_helpers.cpp", ], LIBDEPS_PRIVATE=[ "catalog/collection_catalog", "global_settings", "query/query_knobs", "server_base", ], ) env.Library( target="change_stream_change_collection_manager", source=[ "change_collection_truncate_markers.cpp", "change_stream_change_collection_manager.cpp", ], LIBDEPS_PRIVATE=[ "catalog/catalog_helpers", "catalog/collection_crud", "catalog/collection_options", "change_stream_serverless_helpers", "change_streams_cluster_parameter", "concurrency/exception_util", "dbhelpers", "record_id_helpers", "server_feature_flags", "service_context", ], ) env.Library( target="change_collection_expired_change_remover", source=[ "change_collection_expired_documents_remover.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/change_stream_change_collection_manager", "$BUILD_DIR/mongo/db/change_stream_serverless_helpers", "$BUILD_DIR/mongo/db/change_streams_cluster_parameter", "$BUILD_DIR/mongo/db/query_exec", "$BUILD_DIR/mongo/db/server_feature_flags", "$BUILD_DIR/mongo/util/periodic_runner", ], ) env.Library( target="change_stream_pre_image_util", source=[ "change_stream_pre_image_util.cpp", ], LIBDEPS_PRIVATE=[ "change_stream_options_manager", "change_stream_serverless_helpers", "concurrency/exception_util", "pipeline/change_stream_preimage", "query_exec", "record_id_helpers", "server_base", ], ) env.Library( target="change_stream_pre_images_collection_manager", source=[ "change_stream_pre_images_collection_manager.cpp", "change_stream_pre_images_tenant_truncate_markers.cpp", "change_stream_pre_images_truncate_manager.cpp", "change_stream_pre_images_truncate_markers_per_nsUUID.cpp", ], LIBDEPS=[ "pipeline/change_stream_preimage", ], LIBDEPS_PRIVATE=[ "catalog/catalog_helpers", "catalog/collection_crud", "catalog/collection_options", "change_stream_options_manager", "change_stream_pre_image_util", "change_stream_serverless_helpers", "concurrency/exception_util", "query_exec", "record_id_helpers", "repl/storage_interface", "server_base", "server_feature_flags", "storage/storage_options", ], ) env.CppUnitTest( target="change_stream_pre_images_manager_test", source=[ "change_stream_pre_images_remover_test.cpp", "change_stream_pre_images_truncate_manager_test.cpp", "change_stream_pre_images_truncate_markers_per_nsUUID_test.cpp", ], LIBDEPS=[ "catalog/catalog_test_fixture", "catalog/collection_catalog", "catalog/collection_crud", "change_stream_options", "change_stream_options_manager", "change_stream_pre_image_util", "change_stream_pre_images_collection_manager", "change_stream_serverless_helpers", "change_streams_cluster_parameter", "op_observer/op_observer", "op_observer/op_observer_impl", "op_observer/operation_logger_impl", "shard_role", "storage/record_store_base", ], ) env.Library( target="read_write_concern_defaults_mock", source=[ "read_write_concern_defaults_cache_lookup_mock.cpp", ], LIBDEPS=[ "read_write_concern_defaults", ], ) env.CppUnitTest( target="default_baton_test", source=[ "default_baton_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/base", "$BUILD_DIR/mongo/db/service_context_non_d", "$BUILD_DIR/mongo/util/clock_source_mock", "service_context", "service_context_test_fixture", ], ) env.CppUnitTest( target="prepare_conflict_tracker_test", source=[ "prepare_conflict_tracker_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/unittest/unittest", "prepare_conflict_tracker", ], ) env.Library( target="mirror_maestro", source=[ "mirror_maestro.cpp", "mirror_maestro_gen.cpp", "mirroring_sampler.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/executor/task_executor_interface", "$BUILD_DIR/mongo/rpc/message", "$BUILD_DIR/mongo/util/net/network", "client_out_of_line_executor", "service_context", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/bson/util/bson_extract", "$BUILD_DIR/mongo/db/auth/security_token_auth", "$BUILD_DIR/mongo/executor/network_interface_factory", "$BUILD_DIR/mongo/executor/thread_pool_task_executor", "$BUILD_DIR/mongo/util/concurrency/thread_pool", "commands", "commands/server_status_core", "repl/repl_coordinator_interface", "repl/repl_settings", "repl/replica_set_messages", "repl/topology_version_observer", "server_base", ], ) env.CppUnitTest( target="client_out_of_line_executor_test", source=[ "client_out_of_line_executor_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/transport/transport_layer_common", "client_out_of_line_executor", "concurrency/lock_manager", ], ) env.CppUnitTest( target="mongod_options_test", source=[ "mongod_options_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/util/options_parser/options_parser", "concurrency/lock_manager", "mongod_options", "server_base", ], ) env.Library( target="shard_role_api", source=[ "catalog/collection_operation_source.cpp", "direct_shard_client_tracker.cpp", "dump_lock_manager_impl.cpp", "replica_set_endpoint_sharding_state.cpp", "replica_set_endpoint_util.cpp", "s/collection_metadata.cpp", "s/collection_sharding_state.cpp", "s/database_sharding_state.cpp", "s/global_user_write_block_state.cpp", "s/operation_sharding_state.cpp", "s/range_arithmetic.cpp", "s/replica_set_endpoint_feature_flag.cpp", "s/scoped_collection_metadata.cpp", "s/shard_filtering_util.cpp", "s/shard_key_index_util.cpp", "s/sharding_api_d_params_gen.cpp", "s/sharding_migration_critical_section.cpp", "s/sharding_statistics.cpp", "s/sharding_write_router.cpp", "s/transaction_coordinator_worker_curop_repository.cpp", "transaction_resources.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/admission/execution_admission_context", "$BUILD_DIR/mongo/s/grid", "concurrency/lock_manager", "shard_role_api_stor_ex", "storage/write_unit_of_work", "views/views", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/util/concurrency/spin_lock", "server_base", "server_feature_flags", "write_block_bypass", ], ) env.Library( target="shard_role", source=[ "catalog/catalog_helper.cpp", "catalog/collection_uuid_mismatch.cpp", "catalog/collection_yield_restore.cpp", "catalog_raii.cpp", "db_raii.cpp", "direct_connection_util.cpp", "shard_role.cpp", ], LIBDEPS=[ "catalog/collection_catalog", "catalog/database_holder", "shard_role_api", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/util/concurrency/spin_lock", "catalog/collection_uuid_mismatch_info", "catalog/local_oplog_info", "multitenancy", "server_base", "stats/top", "storage/capped_snapshots", "storage/snapshot_helper", "storage/storage_options", ], ) env.CppUnitTest( target="replica_set_endpoint_test", source=[ "direct_shard_client_tracker_test.cpp", "replica_set_endpoint_sharding_state_test.cpp", "replica_set_endpoint_test_fixture.cpp", "replica_set_endpoint_util_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/rpc/message", "$BUILD_DIR/mongo/transport/transport_layer_mock", "auth/authmocks", "commands", "commands_test_example", "repl/replmocks", "s/sharding_catalog_manager", "service_context_d_test_fixture", "shard_role_api", ], ) env.Library( target="fle_crud", source=[ "commands/fle2_get_count_info_command_gen.cpp", "fle_crud.cpp", "query/fle/encrypted_predicate.cpp", "query/fle/equality_predicate.cpp", "query/fle/query_rewriter.cpp", "query/fle/range_predicate.cpp", "query/fle/range_validator.cpp", "query/fle/server_rewrite.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/crypto/encrypted_field_config", "pipeline/pipeline", "query/command_request_response", "query/write_ops/write_ops_parsers", "transaction/transaction_api", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/crypto/fle_crypto", "$BUILD_DIR/mongo/executor/inline_executor", "$BUILD_DIR/mongo/executor/task_executor_pool", "$BUILD_DIR/mongo/s/sharding_router_api", "$BUILD_DIR/mongo/util/concurrency/spin_lock", "dbdirectclient", "query/collation/collator_factory_interface", "query/query_request", "query_expressions", "session/logical_session_id", ], ) env.Library( target="fle_crud_mongod", source=[ "fle_crud_mongod.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/crypto/fle_crypto", "$BUILD_DIR/mongo/executor/inline_executor", "$BUILD_DIR/mongo/executor/network_interface_factory", "$BUILD_DIR/mongo/executor/task_executor_pool", "$BUILD_DIR/mongo/executor/thread_pool_task_executor", "$BUILD_DIR/mongo/util/concurrency/thread_pool", "concurrency/exception_util", "fle_crud", "query/query_request", "record_id_helpers", "repl/repl_coordinator_interface", "session/logical_session_id", "session/session_catalog_mongod", "shard_role", "transaction/transaction", ], ) env.Library( target="fle_mocks", source=[ "fle_query_interface_mock.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/crypto/fle_crypto", "$BUILD_DIR/mongo/db/query/write_ops/write_ops", "$BUILD_DIR/mongo/db/repl/storage_interface_impl", "fle_crud", "fle_crud_mongod", ], ) env.Library( target="cluster_transaction_api", source=[ "cluster_transaction_api.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/session/logical_session_id", "$BUILD_DIR/mongo/db/session/logical_session_id_helpers", "$BUILD_DIR/mongo/db/transaction/transaction_api", "$BUILD_DIR/mongo/rpc/rpc", "$BUILD_DIR/mongo/s/startup_initialization", "service_context", "shared_request_handling", ], ) env.Library( target="dbdirectclient", source=[ "dbdirectclient.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/client/clientdriver_minimal", "not_primary_error_tracker", "query/write_ops/write_ops_parsers", ], LIBDEPS_PRIVATE=[ "repl/repl_coordinator_interface", "repl/repl_settings", "shard_role", ], ) env.Library( target="dbhelpers", source=[ "dbhelpers.cpp", ], LIBDEPS=[ "query_exec", ], LIBDEPS_PRIVATE=[ "catalog/collection_crud", "commands/server_status_core", "index/index_access_method", "query/write_ops/write_ops", "record_id_helpers", "shard_role", ], ) env.Library( target="system_index", source=[ "system_index.cpp", ], LIBDEPS=[ "catalog/index_key_validate", "catalog/multi_index_block", "exec/scoped_timer", "index_builds_coordinator_interface", "shard_role", ], ) env.Library( target="service_context_d", source=[ "service_entry_point_rs_endpoint.cpp", "service_entry_point_shard_role.cpp", "transaction_resources_init_mongod.cpp", ], LIBDEPS=[ "service_context", "storage/storage_engine_common", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/base", "$BUILD_DIR/mongo/s/query_analysis_sampler", "$BUILD_DIR/mongo/s/sharding_router_api", "$BUILD_DIR/mongo/s/startup_initialization", "$BUILD_DIR/mongo/transport/service_executor", "admission/ingress_admission_control", "audit", "auth/auth", "auth/auth_umc", "auth/authprivilege", "auth/security_token_auth", "auth/user_acquisition_stats", "command_can_run_here", "commands/fsync_locked", "commands/server_status_core", "commands/txn_cmd_request", "curop_metrics", "default_max_time_ms_cluster_parameter", "multitenancy", "not_primary_error_tracker", "profile_collection", "read_concern_d_impl", "repl/repl_server_parameters", "repl/replica_set_messages", "repl/tenant_migration_access_blocker", "rw_concern_d", "s/sharding_runtime_d", "server_base", "server_feature_flags", "session/session_catalog_mongod", "shared_request_handling", "stats/api_version_metrics", "stats/counters", "stats/read_preference_metrics", "stats/resource_consumption_metrics", "stats/server_read_concern_write_concern_metrics", "stats/top", "storage/storage_engine_lock_file", "storage/storage_engine_metadata", "storage/storage_options", "transaction/transaction", "validate_api_parameters", "write_block_bypass", ], ) env.Library( target="service_context_non_d", source=[ "transaction_resources_init_non_mongod.cpp", ], LIBDEPS=[ "service_context", ], LIBDEPS_PRIVATE=[ "shard_role_api", ], ) env.Library( target="index_builds_coordinator_mongod", source=[ "index_builds_coordinator_mongod.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/modules/enterprise/src/audit/audit_enterprise" if "audit" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/util/concurrency/thread_pool", "index_builds_coordinator_interface", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/executor/task_executor_interface", "catalog/collection_catalog", "catalog/index_build_entry_idl", "index_build_entry_helpers", "repl/tenant_migration_access_blocker", "resumable_index_builds_idl", "s/forwardable_operation_metadata", "shard_role", "storage/two_phase_index_build_knobs_idl", ], ) env.Library( target="index_builds_coordinator_interface", source=[ "index_builds_coordinator.cpp", "repl_index_build_state.cpp", "active_index_builds.cpp", ], LIBDEPS=[ "catalog/commit_quorum_options", "catalog/index_builds_manager", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/storage/durable_catalog", "$BUILD_DIR/mongo/executor/task_executor_interface", "$BUILD_DIR/mongo/util/fail_point", "catalog/collection_catalog", "catalog/index_build_entry_idl", "catalog/index_build_oplog_entry", "catalog/multi_index_block", "concurrency/exception_util", "dbhelpers", "index_build_entry_helpers", "repl/cloner_utils", "repl/repl_coordinator_interface", "repl/tenant_migration_access_blocker", "repl/timestamp_block", "resumable_index_builds_idl", "server_base", "shard_role", "storage/disk_space_util", "storage/encryption_hooks", "storage/storage_options", "storage/storage_util", "storage/two_phase_index_build_knobs_idl", ], ) env.Library( target="index_builds_coordinator_mock", source=["index_builds_coordinator_mock.cpp"], LIBDEPS=[ "index_builds_coordinator_interface", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/executor/task_executor_interface", "catalog/collection_catalog", "catalog/index_build_entry_idl", "index_build_entry_helpers", "repl/tenant_migration_access_blocker", "resumable_index_builds_idl", "s/forwardable_operation_metadata", "shard_role", "storage/two_phase_index_build_knobs_idl", ], ) env.Library( target="index_build_entry_helpers", source=[ "index_build_entry_helpers.cpp", ], LIBDEPS_PRIVATE=[ "catalog/collection_crud", "catalog/commit_quorum_options", "catalog/index_build_entry_idl", "catalog/local_oplog_info", "concurrency/exception_util", "dbhelpers", "server_base", "service_context", "shard_role", ], ) env.Library( target="cloner", source=[ "cloner.cpp", "cloner_gen.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/client/authentication", "catalog/collection_crud", "catalog/collection_options", "catalog/multi_index_block", "commands/list_collections_filter", "concurrency/exception_util", "dbdirectclient", "index_builds_coordinator_interface", "multitenancy", "query/write_ops/write_ops", "repl/isself", "server_base", "shard_role", ], ) env.Library( target="profile_collection", source=[ "profile_collection.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/util/concurrency/spin_lock", "catalog/collection_crud", "catalog/collection_options", "concurrency/exception_util", "shard_role", "stats/resource_consumption_metrics", ], ) env.Library( target="rw_concern_d", source=[ "read_concern.cpp", "write_concern.cpp", ], LIBDEPS=[ "query/query_stats/query_stats", "read_write_concern_defaults", "repl/speculative_majority_read_info", "stats/timer_stats", ], LIBDEPS_PRIVATE=[ "commands/server_status_core", "repl/repl_coordinator_interface", "repl/repl_server_parameters", "repl/repl_settings", "shard_role", "shared_request_handling", "storage/storage_control", ], ) env.Library( target="read_concern_d_impl", source=[ "read_concern_mongod.cpp", "read_concern_mongod_gen.cpp", ], LIBDEPS_PRIVATE=[ "concurrency/exception_util", "repl/repl_coordinator_interface", "repl/speculative_majority_read_info", "repl/tenant_migration_access_blocker", "server_base", "shard_role", ], ) env.Library( target="rebuild_indexes", source=[ "rebuild_indexes.cpp", ], LIBDEPS_PRIVATE=[ "catalog/collection_catalog", "catalog/index_key_validate", "index_builds_coordinator_interface", "server_base", "shard_role", "shard_role_api", ], ) env.Library( target="ttl_d", source=[ "ttl.cpp", "ttl_gen.cpp", ], LIBDEPS_PRIVATE=[ "catalog/catalog_helpers", "catalog/index_key_validate", "coll_mod_command_idl", "commands/fsync_locked", "commands/server_status_core", "index_commands_idl", "query/write_ops/write_ops", "query_exec", "record_id_helpers", "repl/replica_set_aware_service", "repl/tenant_migration_access_blocker", "s/sharding_runtime_d", "server_base", "service_context", "shard_role", "ttl_collection_cache", ], ) env.Library( target="shard_filterer", source=[ "exec/shard_filterer_impl.cpp", ], LIBDEPS_PRIVATE=[ "exec/working_set", "shard_role_api", ], ) env.Library( target="working_set_common", source=[ "exec/working_set_common.cpp", ], LIBDEPS_PRIVATE=[ "catalog/health_log_interface", "exec/working_set", "index/index_access_method", "server_base", "storage/execution_context", "storage/key_string", ], ) env.Library( target="write_stage_common", source=[ "exec/write_stage_common.cpp", ], LIBDEPS_PRIVATE=[ "exec/document_value/document_value", "exec/working_set", "server_base", "shard_filterer", "shard_role_api", "working_set_common", ], ) execEnv = env.Clone() execEnv.InjectThirdParty(libraries=["snappy"]) execEnv.Library( target="query_exec", source=[ "clientcursor.cpp", "cursor_manager.cpp", "exec/and_hash.cpp", "exec/and_sorted.cpp", "exec/batched_delete_stage.cpp", "exec/batched_delete_stage_gen.cpp", "exec/batched_delete_stage_buffer.cpp", "exec/cached_plan.cpp", "exec/collection_scan.cpp", "exec/count.cpp", "exec/count_scan.cpp", "exec/delete_stage.cpp", "exec/distinct_scan.cpp", "exec/eof.cpp", "exec/express/express_plan.cpp", "exec/fetch.cpp", "exec/geo_near.cpp", "exec/idhack.cpp", "exec/index_scan.cpp", "exec/limit.cpp", "exec/merge_sort.cpp", "exec/mock_stage.cpp", "exec/multi_iterator.cpp", "exec/multi_plan.cpp", "exec/near.cpp", "exec/or.cpp", "exec/plan_cache_util.cpp", "exec/plan_stage.cpp", "exec/projection.cpp", "exec/queued_data_stage.cpp", "exec/record_store_fast_count.cpp", "exec/recordid_deduplicator.cpp", "exec/requires_collection_stage.cpp", "exec/requires_index_stage.cpp", "exec/return_key.cpp", "exec/sample_from_timeseries_bucket.cpp", "exec/shard_filter.cpp", "exec/skip.cpp", "exec/sort.cpp", "exec/sort_key_generator.cpp", "exec/spool.cpp", "exec/subplan.cpp", "exec/text_match.cpp", "exec/text_or.cpp", "exec/timeseries_modify.cpp", "exec/timeseries_upsert.cpp", "exec/trial_period_utils.cpp", "exec/trial_stage.cpp", "exec/unpack_timeseries_bucket.cpp", "exec/update_stage.cpp", "exec/upsert_stage.cpp", "pipeline/document_source_cursor.cpp", "pipeline/document_source_geo_near_cursor.cpp", "pipeline/pipeline_d.cpp", "pipeline/plan_executor_pipeline.cpp", "pipeline/plan_explainer_pipeline.cpp", "pipeline/sbe_pushdown.cpp", "query/all_indices_required_checker.cpp", "query/bind_input_params.cpp", "query/classic_runtime_planner/cached_planner.cpp", "query/classic_runtime_planner/idhack_planner.cpp", "query/classic_runtime_planner/multi_planner.cpp", "query/classic_runtime_planner/planner_interface.cpp", "query/classic_runtime_planner/single_solution_passthrough_planner.cpp", "query/classic_runtime_planner/sub_planner.cpp", "query/classic_runtime_planner_for_sbe/cached_planner.cpp", "query/classic_runtime_planner_for_sbe/multi_planner.cpp", "query/classic_runtime_planner_for_sbe/planner_interface.cpp", "query/classic_runtime_planner_for_sbe/single_solution_passthrough_planner.cpp", "query/classic_runtime_planner_for_sbe/sub_planner.cpp", "query/stage_builder/classic_stage_builder.cpp", "query/write_ops/parsed_delete.cpp", "query/write_ops/parsed_update.cpp", "query/write_ops/update_result.cpp", "query/explain.cpp", "query/find.cpp", "query/get_executor.cpp", "query/internal_plans.cpp", "query/plan_executor_express.cpp", "query/plan_executor_factory.cpp", "query/plan_executor_impl.cpp", "query/plan_executor_sbe.cpp", "query/plan_explainer_express.cpp", "query/plan_explainer_factory.cpp", "query/plan_explainer_impl.cpp", "query/plan_explainer_sbe.cpp", "query/plan_insert_listener.cpp", "query/plan_ranker.cpp", "query/plan_yield_policy_impl.cpp", "query/plan_yield_policy_sbe.cpp", "query/query_planner_params.cpp", "query/sbe_plan_ranker.cpp", "query/sbe_trial_runtime_executor.cpp", "query/shard_filterer_factory_impl.cpp", "query/stage_builder/sbe/abt_holder_impl.cpp", "query/stage_builder/sbe/analysis.cpp", "query/stage_builder/sbe/builder.cpp", "query/stage_builder/sbe/builder_data.cpp", "query/stage_builder/sbe/builder_state.cpp", "query/stage_builder/sbe/expression_const_eval.cpp", "query/stage_builder/sbe/gen_abt_helpers.cpp", "query/stage_builder/sbe/gen_accumulator.cpp", "query/stage_builder/sbe/gen_coll_scan.cpp", "query/stage_builder/sbe/gen_expression.cpp", "query/stage_builder/sbe/gen_filter.cpp", "query/stage_builder/sbe/gen_group.cpp", "query/stage_builder/sbe/gen_helpers.cpp", "query/stage_builder/sbe/gen_index_scan.cpp", "query/stage_builder/sbe/gen_lookup.cpp", "query/stage_builder/sbe/gen_projection.cpp", "query/stage_builder/sbe/gen_ts.cpp", "query/stage_builder/sbe/gen_window_function.cpp", "query/stage_builder/sbe/sbexpr.cpp", "query/stage_builder/sbe/sbexpr_helpers.cpp", "query/stage_builder/sbe/type_checker.cpp", "query/stage_builder/sbe/type_signature.cpp", "query/stage_builder/sbe/vectorizer.cpp", "query/stage_builder/stage_builder_util.cpp", "query/wildcard_multikey_paths.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/scripting/scripting", "$BUILD_DIR/mongo/util/background_job", "$BUILD_DIR/mongo/util/elapsed_tracker", "$BUILD_DIR/mongo/util/field_set", "$BUILD_DIR/third_party/croaring/croaring", "$BUILD_DIR/third_party/s2/s2", "audit", "auth/auth_checks", "catalog/collection_query_info", "commands", "cursor_server_params", "dbdirectclient", "disk_use_options_idl", "exec/projection_executor", "exec/sbe/query_sbe_stages", "exec/sbe/query_sbe_storage", "exec/scoped_timer", "exec/sort_executor", "exec/working_set", "fts/base_fts", "matcher/expressions_mongod_only", "pipeline/pipeline", "query/bson/dotted_path_support", "query/plan_cache/query_plan_cache", "query/plan_executor", "query/plan_yield_policy", "query/query_common", "query/query_planner", "query/query_settings/query_settings", "query/write_ops/delete_request_idl", "query/write_ops/parsed_update", "session/logical_session_cache", "shard_filterer", "shard_role", "shared_request_handling", "stats/latency_server_stats", "stats/serveronly_stats", "update/update_driver", ], LIBDEPS_PRIVATE=[ "catalog/collection_crud", "catalog/database_holder", "catalog/health_log_interface", "catalog/local_oplog_info", "commands/server_status_core", "concurrency/exception_util", "curop_failpoint_helpers", "exec/sbe/query_sbe_abt", "internal_transactions_feature_flag", "not_primary_error_tracker", "pipeline/abt_translation", "pipeline/change_stream_pipeline", "pipeline/document_source_internal_apply_oplog_update", "pipeline/pipeline_visitor", "query/optimizer/optimizer_rewrites", "record_id_helpers", "repl/repl_coordinator_interface", "repl/wait_for_majority_service", "server_base", "session/kill_sessions", "sorter/sorter_base", "sorter/sorter_stats", "stats/resource_consumption_metrics", "storage/record_store_base", "storage/storage_options", "timeseries/bucket_catalog/bucket_catalog", "timeseries/timeseries_conversion_util", "timeseries/timeseries_options", "timeseries/timeseries_write_util", "working_set_common", "write_stage_common", ], ) env.Library( target="query_expressions", source=[ "matcher/doc_validation_error.cpp", "matcher/doc_validation_util.cpp", "matcher/expression.cpp", "matcher/expression_algo.cpp", "matcher/expression_array.cpp", "matcher/expression_bitset_tree_converter.cpp", "matcher/expression_expr.cpp", "matcher/expression_geo.cpp", "matcher/expression_geo_serializer.cpp", "matcher/expression_hasher.cpp", "matcher/expression_internal_bucket_geo_within.cpp", "matcher/expression_leaf.cpp", "matcher/expression_parameterization.cpp", "matcher/expression_parser.cpp", "matcher/expression_restorer.cpp", "matcher/expression_simplifier.cpp", "matcher/expression_text_base.cpp", "matcher/expression_text_noop.cpp", "matcher/expression_tree.cpp", "matcher/expression_where_base.cpp", "matcher/expression_where_noop.cpp", "matcher/expression_with_placeholder.cpp", "matcher/extensions_callback.cpp", "matcher/extensions_callback_noop.cpp", "matcher/implicit_validator.cpp", "matcher/in_list_data.cpp", "matcher/match_details.cpp", "matcher/match_expression_dependencies.cpp", "matcher/match_expression_util.cpp", "matcher/matchable.cpp", "matcher/matcher.cpp", "matcher/matcher_type_set.cpp", "matcher/rewrite_expr.cpp", "matcher/schema/encrypt_schema_gen.cpp", "matcher/schema/encrypt_schema_types.cpp", "matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp", "matcher/schema/expression_internal_schema_allowed_properties.cpp", "matcher/schema/expression_internal_schema_cond.cpp", "matcher/schema/expression_internal_schema_eq.cpp", "matcher/schema/expression_internal_schema_fmod.cpp", "matcher/schema/expression_internal_schema_match_array_index.cpp", "matcher/schema/expression_internal_schema_num_array_items.cpp", "matcher/schema/expression_internal_schema_num_properties.cpp", "matcher/schema/expression_internal_schema_object_match.cpp", "matcher/schema/expression_internal_schema_root_doc_eq.cpp", "matcher/schema/expression_internal_schema_str_length.cpp", "matcher/schema/expression_internal_schema_unique_items.cpp", "matcher/schema/expression_internal_schema_xor.cpp", "matcher/schema/json_pointer.cpp", "matcher/schema/json_schema_parser.cpp", "pipeline/expression.cpp", "pipeline/expression_context.cpp", "pipeline/expression_dependencies.cpp", "pipeline/expression_function.cpp", "pipeline/expression_js_emit.cpp", "pipeline/expression_let.cpp", "pipeline/expression_parser_gen.cpp", "pipeline/expression_test_api_version.cpp", "pipeline/expression_trigonometric.cpp", "pipeline/javascript_execution.cpp", "pipeline/make_js_function.cpp", "pipeline/monotonic_expression.cpp", "pipeline/name_expression.cpp", "pipeline/variables.cpp", "query/query_shape/cmd_with_let_shape.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/bson/util/bson_extract", "$BUILD_DIR/mongo/crypto/fle_crypto", "$BUILD_DIR/mongo/db/query/str_trim_utils", "$BUILD_DIR/mongo/db/query/substr_utils", "$BUILD_DIR/mongo/scripting/scripting", "$BUILD_DIR/mongo/scripting/scripting_common", "$BUILD_DIR/mongo/util/pcre_util", "$BUILD_DIR/mongo/util/pcre_wrapper", "$BUILD_DIR/mongo/util/summation", "commands/test_commands_enabled", "common", "exec/document_value/document_value", "fts/fts_query_noop", "geo/geometry", "geo/geoparser", "matcher/path", "pipeline/aggregation_request_helper", "pipeline/dependencies", "pipeline/variable_validation", "query/boolean_simplification/boolean_simplification", "query/bson/dotted_path_support", "query/collation/collator_factory_interface", "query/collation/collator_interface", "query/datetime/date_time_support", "query/query_knob_configuration", "query/query_knobs", "query/query_settings/query_settings", "query/query_shape/query_shape_common", "sbe_values", "stats/counters", "update/pattern_cmp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/query/random_utils", "$BUILD_DIR/mongo/util/elapsed_tracker", "curop_failpoint_helpers", "mongohasher", "server_base", "service_context", "vector_clock", ], ) env.Library( target="startup_recovery", source=[ "repair.cpp", "startup_recovery.cpp", ], LIBDEPS_PRIVATE=[ "catalog/catalog_helpers", "catalog/collection_catalog", "catalog/collection_validation", "catalog/database_holder", "catalog/document_validation", "catalog/index_key_validate", "catalog/local_oplog_info", "catalog/multi_index_block", "change_stream_pre_image_util", "change_stream_serverless_helpers", "commands/mongod_fcv", "concurrency/exception_util", "dbdirectclient", "dbhelpers", "index_builds_coordinator_interface", "multitenancy", "rebuild_indexes", "record_id_helpers", "repl/oplog", "repl/repl_settings", "rw_concern_d", "server_feature_flags", "storage/storage_options", "storage/storage_repair_observer", "storage/storage_util", "timeseries/timeseries_extended_range", "vector_clock", ], ) env.Library( target="periodic_runner_job_abort_expired_transactions", source=[ "periodic_runner_job_abort_expired_transactions.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/session/kill_sessions_local", "$BUILD_DIR/mongo/db/transaction/transaction", "$BUILD_DIR/mongo/util/periodic_runner", ], ) env.Library( target="rs_local_client", source=[ "rs_local_client.cpp", ], LIBDEPS_PRIVATE=[ "concurrency/lock_manager", "dbdirectclient", "repl/repl_coordinator_interface", "rw_concern_d", ], ) env.Library( target="keys_collection_util", source=[ "keys_collection_util.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/concurrency/exception_util", "dbhelpers", "keys_collection_document", "shard_role", ], ) env.Library( target="keys_collection_client_direct", source=[ "keys_collection_client_direct.cpp", ], LIBDEPS=[ "keys_collection_document", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/s/catalog/sharding_catalog_client", "$BUILD_DIR/mongo/s/client/shard_interface", "rs_local_client", "server_base", ], ) env.Library( target="vector_clock_mongod", source=[ "s/topology_time_ticker.cpp", "vector_clock_mongod.cpp", ], LIBDEPS=[ "vector_clock_mutable", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/s/grid", "concurrency/lock_manager", "dbdirectclient", "repl/replica_set_aware_service", "rw_concern_d", "server_base", ], ) env.Library( target="vector_clock_trivial", source=[ "vector_clock_trivial.cpp", ], LIBDEPS=[ "vector_clock_mutable", ], ) # This library is the base class for tests which require the presence of ServiceContext. However it # does not perform any default initialisation of the relevant services, such as lockers and # transaction resources, so any test which directly references it must perform its own # initialisation. # # If a test requires the presence of a storage engine, it should use the # service_context_d_test_fixture below directly. env.Library( target="service_context_test_fixture", source=[ "service_context_test_fixture.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/client/clientdriver_network", "$BUILD_DIR/mongo/transport/session_manager", "$BUILD_DIR/mongo/unittest/unittest", "service_context", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/auth/authmocks", "$BUILD_DIR/mongo/db/query/query_settings/manager", "$BUILD_DIR/mongo/util/clock_source_mock", ], ) env.Library( target="service_context_d_test_fixture", source=[ "service_context_d_test_fixture.cpp", ], LIBDEPS=[ "service_context_test_fixture", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/util/clock_source_mock", "$BUILD_DIR/mongo/util/periodic_runner_factory", "auth/auth_impl_internal", "catalog/catalog_impl", "commands/mongod", "index_builds_coordinator_mongod", "op_observer/op_observer", "s/sharding_runtime_d", "service_context_d", "storage/devnull/storage_devnull", "storage/storage_control", "storage/storage_options", "storage/wiredtiger/storage_wiredtiger", ], ) asioEnv = env.Clone() asioEnv.InjectThirdParty("asio") env.Program( target="mongotrafficreader", source=[ "traffic_reader_main.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/base", "$BUILD_DIR/mongo/rpc/message", "$BUILD_DIR/mongo/util/signal_handlers", "concurrency/lock_manager", "traffic_reader", ], ) env.Library( target="mongod_initializers", source=[ # NOTE: If you add an additional source file here, please delete # the file db/mongod_initializers.cpp. "mongod_initializers.cpp", ], LIBDEPS_PRIVATE=[ # NOTE: If you need to add a static or mongo initializer to mongod startup, # please add that library here, as a private library dependency. "$BUILD_DIR/mongo/db/modules/enterprise/kmip_configuration" if "MONGO_ENTERPRISE_FEATURES" in env and ( "encryptdb" in env["MONGO_ENTERPRISE_FEATURES"] or "audit" in env["MONGO_ENTERPRISE_FEATURES"] ) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/audit/audit_configuration" if "audit" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/audit/audit_mongod_proxy" if "audit" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/encryptdb/encryption_key_manager_aux" if "encryptdb" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/fcbis/file_copy_based_initial_syncer" if "fcbis" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/fips/fips_mode_server" if "fips" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/hot_backups/backup_docs_needed_bounds" if "hot_backups" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/hot_backups/hot_backups" if "hot_backups" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/inmemory/storage_inmemory" if "inmemory" in env.get("MONGO_ENTERPRISE_FEATURES", []) and wiredtiger else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/ldap/ldap_manager_init" if "ldap" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/ldap/ldap_options_mongod" if "ldap" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/magic_restore/magic_restore" if "magic_restore" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/queryable/queryable_wt/queryable_wt" if "queryable" in env.get("MONGO_ENTERPRISE_FEATURES", []) and wiredtiger else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/sasl/auth_delay" if "sasl" in env.get("MONGO_ENTERPRISE_FEATURES", []) and have_sasl_lib else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/sasl/authz_manager_factory_external" if "sasl" in env.get("MONGO_ENTERPRISE_FEATURES", []) and have_sasl_lib else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/sasl/mongosaslservercommon" if "sasl" in env.get("MONGO_ENTERPRISE_FEATURES", []) and have_sasl_lib else "", "$BUILD_DIR/mongo/db/modules/enterprise/src/streams/commands/streams_commands" if "streams" in env.get("MONGO_ENTERPRISE_FEATURES", []) and env.ShouldBuildStreams() else "", "$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger" if wiredtiger else "", "$BUILD_DIR/mongo/executor/async_rpc_error_info", "$BUILD_DIR/mongo/executor/network_interface_factory", "$BUILD_DIR/mongo/rpc/rpc", "$BUILD_DIR/mongo/s/commands/cluster_commands", "$BUILD_DIR/mongo/s/commands/sharded_cluster_commands", "$BUILD_DIR/mongo/s/commands/sharded_cluster_sharding_commands", "$BUILD_DIR/mongo/scripting/scripting_server", "$BUILD_DIR/mongo/transport/grpc/grpc_transport_server_options" if shouldBuildGRPC(env) else [], "$BUILD_DIR/mongo/transport/message_compressor_options_server", "$BUILD_DIR/mongo/transport/session_manager", "$BUILD_DIR/mongo/transport/transport_layer_manager", "$BUILD_DIR/mongo/util/clock_sources", "$BUILD_DIR/mongo/util/elapsed_tracker", "$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/periodic_runner_factory", "$BUILD_DIR/mongo/util/pin_code_segments" if env.TargetOSIs("linux") else [], "$BUILD_DIR/mongo/util/tcmalloc_set_parameter" if env["MONGO_ALLOCATOR"] in ["tcmalloc-google", "tcmalloc-gperf"] else "", "$BUILD_DIR/mongo/util/testing_options", "$BUILD_DIR/mongo/util/tracing_profiler/tracing_profiler" if get_option("use-tracing-profiler") == "on" else [], "$BUILD_DIR/mongo/util/version_impl", "$BUILD_DIR/mongo/watchdog/watchdog_mongod", "$BUILD_DIR/third_party/snappy/snappy", "admission/queues_server_status_section", "auth/auth_op_observer", "auth/authserver", "catalog/catalog_impl", "catalog/collection_options", "catalog/document_validation", "catalog/health_log_interface", "catalog/index_key_validate", "collection_index_usage_tracker", "commands/mongod", "commands/mongod_fcv", "commands/server_status_servers", "common", "concurrency/flow_control_ticketholder", "curop_metrics", "dbdirectclient", "dbhelpers", "default_max_time_ms_cluster_parameter", "exec/working_set", "feature_compatibility_version_metrics", "ftdc/ftdc_mongod", "fts/ftsmongod", "index/index_access_method", "index_builds_coordinator_mongod", "keys_collection_client_direct", "logical_time_metadata_hook", "matcher/expressions_mongod_only", "mirror_maestro", "mongod_options", "mongod_options_init", "periodic_runner_job_abort_expired_transactions", "pipeline/aggregation", "pipeline/process_interface/mongod_process_interface_factory", "profile_collection", "query/bson/dotted_path_support", "query_exec", "read_concern_d_impl", "read_write_concern_defaults", "repl/oplog_application", "repl/oplog_buffer_blocking_queue", "repl/oplog_buffer_collection", "repl/oplog_buffer_proxy", "repl/repl_coordinator_impl", "repl/repl_set_commands", "repl/repl_settings", "repl/replica_set_aware_service", "repl/serveronly_repl", "repl/storage_interface_impl", "repl/topology_coordinator", "rw_concern_d", "serverless/shard_split_commands", "session/kill_sessions_local", "session/service_liaison_mongod", "session/sessions_collection_rs", "shard_role", "startup_warnings_mongod", "stats/change_collection_server_status", "stats/counters", "stats/latency_server_stats", "stats/serveronly_stats", "stats/top", "storage/backup_cursor_hooks", "storage/devnull/storage_devnull", "storage/encryption_hooks", "storage/flow_control", "storage/flow_control_parameters", "storage/storage_control", "storage/storage_engine_lock_file", "storage/storage_engine_metadata", "storage/storage_init_d", "storage/storage_options", "system_index", "timeseries/bucket_compression_failure", "traffic_recorder", "ttl_collection_cache", "ttl_d", "update/update_driver", "update_index_data", "windows_options" if env.TargetOSIs("windows") else [], ], LIBDEPS=[ # NOTE: This list must remain empty. Please only add to LIBDEPS_PRIVATE ], ) env.Library( target="mongod_main", source=[ "mongod_main.cpp", "logical_session_cache_factory_mongod.cpp", "read_write_concern_defaults_cache_lookup_mongod.cpp", ], LIBDEPS_PRIVATE=[ # NOTE: Do not add new libdeps (public or private) here unless required by the linker to # satisfy symbol dependencies from the files listed above in `sources`. If you need to add a # library to inject a static or mongo initializer to mongod, please add that library as a # private libdep of mongod_initializers. "$BUILD_DIR/mongo/client/clientdriver_minimal", "$BUILD_DIR/mongo/db/auth/user_cache_invalidator", "$BUILD_DIR/mongo/db/modules/enterprise/src/audit/audit_enterprise" if "audit" in env.get("MONGO_ENTERPRISE_FEATURES", []) else "", "$BUILD_DIR/mongo/idl/cluster_server_parameter", "$BUILD_DIR/mongo/idl/cluster_server_parameter_initializer", "$BUILD_DIR/mongo/idl/cluster_server_parameter_op_observer", "$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl", "$BUILD_DIR/mongo/s/resource_yielders", "$BUILD_DIR/mongo/s/sessions_collection_sharded", "$BUILD_DIR/mongo/s/sharding_initialization", "$BUILD_DIR/mongo/s/startup_initialization", "$BUILD_DIR/mongo/scripting/scripting", "$BUILD_DIR/mongo/transport/ingress_handshake_metrics", "$BUILD_DIR/mongo/transport/service_executor", "$BUILD_DIR/mongo/transport/session_manager", "$BUILD_DIR/mongo/transport/transport_layer_manager", "$BUILD_DIR/mongo/util/allocator_thread", "$BUILD_DIR/mongo/util/cmdline_utils/cmdline_utils", "$BUILD_DIR/mongo/util/concurrency/thread_pool", "$BUILD_DIR/mongo/util/net/http_client_impl", "$BUILD_DIR/mongo/util/net/ssl_manager", "$BUILD_DIR/mongo/util/periodic_runner_factory", "$BUILD_DIR/mongo/util/signal_handlers", "$BUILD_DIR/mongo/util/tracing_profiler/tracing_profiler" if get_option("use-tracing-profiler") == "on" else [], "$BUILD_DIR/mongo/watchdog/watchdog_mongod", "admission/execution_control", "auth/auth_op_observer", "catalog/catalog_helpers", "catalog/catalog_impl", "catalog/collection_crud", "catalog/health_log", "catalog/health_log_interface", "change_collection_expired_change_remover", "change_stream_change_collection_manager", "change_stream_options_manager", "change_streams_cluster_parameter", "commands/mongod", "commands/mongod_fsync", "commands/test_commands", "concurrency/flow_control_ticketholder", "fle_crud_mongod", "ftdc/ftdc_mongod", "index/index_access_method", "index_builds_coordinator_mongod", "keys_collection_client_direct", "log_process_details", "mirror_maestro", "mongod_initializers", "mongod_options", "op_observer/change_stream_pre_images_op_observer", "op_observer/fallback_op_observer", "op_observer/fcv_op_observer", "op_observer/find_and_modify_images_op_observer", "op_observer/op_observer", "op_observer/op_observer_impl", "op_observer/operation_logger_impl", "op_observer/operation_logger_transaction_proxy", "op_observer/user_write_block_mode_op_observer", "periodic_runner_job_abort_expired_transactions", "pipeline/change_stream_expired_pre_image_remover", "pipeline/process_interface/mongod_process_interface_factory", "query/query_settings/manager", "query/stats/stats", "repl/drop_pending_collection_reaper", "repl/initial_syncer", "repl/repl_coordinator_impl", "repl/replication_recovery", "repl/serveronly_repl", "repl/shard_merge_recipient_service", "repl/storage_interface_impl", "repl/tenant_migration_donor_service", "repl/tenant_migration_recipient_service", "repl/topology_coordinator", "repl/wait_for_majority_service", "s/query_analysis_writer", "s/sessions_collection_config_server", "s/sharding_commands_d", "s/sharding_runtime_d", "serverinit", "serverless/shard_split_donor_service", "service_context_d", "session/kill_sessions_local", "session/kill_sessions_remote", "session/service_liaison_mongod", "session/session_catalog_mongod", "session/sessions_collection_rs", "set_change_stream_state_coordinator", "shard_role", "startup_recovery", "startup_warnings_mongod", "storage/backup_cursor_hooks", "storage/disk_space_monitor", "storage/flow_control", "storage/flow_control_parameters", "storage/oplog_cap_maintainer_thread", "storage/storage_control", "system_index", "timeseries/timeseries_op_observer", "ttl_d", "vector_clock", ], LIBDEPS_TAGS=[ # NOTE: This library must not link publicly. Please only add to LIBDEPS_PRIVATE "lint-no-public-deps", ], ) if env.TargetOSIs("windows"): generatedDbManifest = env.Substfile( "mongod.manifest.in", SUBST_DICT=[ ("@mongo_version_major@", version_parts[0]), ("@mongo_version_minor@", version_parts[1]), ("@mongo_version_patch@", version_parts[2]), ("@mongo_version_extra@", version_parts[3]), ("@mongo_version_extra_str@", version_extra), ], ) env.Alias("generated-sources", generatedDbManifest) env.Depends("mongod.res", generatedDbManifest) env.Program( target="mongod", source=[ "mongod.cpp", ] + env.WindowsResourceFile("mongod.rc"), LIBDEPS=[ # NOTE: Do not add new libdeps (public or private) here unless required by the linker to # satisfy symbol dependencies from the files listed above in `sources`. If you need to add a # library to inject a static or mongo initializer to mongod, please add that library as a # private libdep of mongod_initializers. "mongod_main", "server_base", ], AIB_COMPONENT="mongod", AIB_COMPONENTS_EXTRA=[ "core", "default", "devcore", "dist", "dist-test", "integration-tests", "serverless", "serverless-test", "servers", ], SYSLIBDEPS=env.get("MONGO_LDAP_LIB", []), ) env.Library( target="op_msg_fuzzer_fixture", source=[ "op_msg_fuzzer_fixture.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/transport/transport_layer_mock", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/rpc/rpc", "$BUILD_DIR/mongo/transport/session_manager", "$BUILD_DIR/mongo/unittest/unittest", "$BUILD_DIR/mongo/util/periodic_runner_factory", "auth/auth", "auth/authmocks", "catalog/catalog_impl", "catalog/database_holder", "op_observer/op_observer", "repl/replmocks", "s/sharding_runtime_d", "server_base", "service_context_d", "stats/top", "storage/storage_control", "storage/storage_options", "storage/wiredtiger/storage_wiredtiger", ], ) # TODO(SERVER-45266) This could be part of db_unittest_test but it needs to mutate # storageGlobalParams. env.CppUnitTest( target="op_msg_fuzzer_fixture_test", source=[ "op_msg_fuzzer_fixture_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/rpc/rpc", "op_msg_fuzzer_fixture", "server_base", ], ) env.Library( target="commands_test_example", source=[ "commands_test_example_gen.cpp", ], LIBDEPS_PRIVATE=[ "commands", "server_base", ], ) envWithAsio = env.Clone() envWithAsio.InjectThirdParty(libraries=["asio"]) if wiredtiger: envWithAsio.CppUnitTest( target="db_base_test", source=[ "error_labels_test.cpp", "field_parser_test.cpp", "field_ref_set_test.cpp", "field_ref_test.cpp", "hasher_test.cpp", "namespace_string_test.cpp", "operation_id_test.cpp", "record_id_test.cpp", "server_options_test.cpp", "shard_id_test.cpp", "startup_warnings_mongod_thp_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/util/fail_point", "commands", "error_labels", "mongohasher", "pipeline/aggregation_request_helper", "pipeline/change_stream_pipeline", "record_id_helpers", "server_options_base", "server_options_servers", "service_context_test_fixture", "startup_warnings_mongod", ], ) envWithAsio.CppUnitTest( target="change_collection_test", source=[ "change_collection_expired_change_remover_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/util/clock_source_mock", "catalog/catalog_test_fixture", "change_collection_expired_change_remover", "change_stream_change_collection_manager", "change_stream_serverless_helpers", "change_streams_cluster_parameter", "pipeline/change_stream_expired_pre_image_remover", "query_exec", "record_id_helpers", "repl/read_concern_args", "server_base", "shard_role", "startup_recovery", ], ) envWithAsio.CppUnitTest( target="command_test", source=[ "bulk_write_shard_test.cpp", "commands_test.cpp", "curop_test.cpp", "curop_stats_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/prepare_conflict_tracker", "$BUILD_DIR/mongo/transport/transport_layer_mock", "auth/auth", "auth/authmocks", "catalog/catalog_helpers", "commands", "commands/query_cmd/bulk_write_command", "commands/query_cmd/bulk_write_parser", "commands_test_example", "query/query_test_service_context", "s/shard_server_test_fixture", "service_context_test_fixture", "shard_role_api", ], ) envWithAsio.CppUnitTest( target="fle_test", source=[ "fle_crud_test.cpp", "query/fle/encrypted_predicate_test_fixtures.cpp", "query/fle/equality_predicate_test.cpp", "query/fle/query_rewriter_test.cpp", "query/fle/range_predicate_test.cpp", "query/fle/range_validator_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/crypto/aead_encryption", "$BUILD_DIR/mongo/crypto/encrypted_field_config", "$BUILD_DIR/mongo/crypto/fle_crypto", "$BUILD_DIR/mongo/shell/kms_idl", "catalog/collection_options", "fle_crud", "fle_mocks", "query/query_test_service_context", "query/write_ops/write_ops", "query_expressions", "repl/repl_coordinator_interface", "repl/replmocks", "repl/storage_interface_impl", "service_context_d_test_fixture", "service_context_test_fixture", ], ) envWithAsio.CppUnitTest( target="index_build_test", source=[ "global_index_test.cpp", "index_build_entry_helpers_test.cpp", "index_builds_coordinator_mongod_test.cpp", "index_builds_coordinator_test.cpp", ], LIBDEPS=[ "catalog/catalog_test_fixture", "catalog/collection_crud", "catalog/index_build_entry_idl", "global_index", "index_build_entry_helpers", "index_builds_coordinator_mongod", "query_exec", "repl/replmocks", "repl/storage_interface_impl", "server_base", "service_context_d_test_fixture", "service_context_test_fixture", "shard_role", ], ) envWithAsio.CppUnitTest( target="operation_test", source=[ "cancelable_operation_context_test.cpp", "client_context_test.cpp", "client_strand_test.cpp", "dbdirectclient_test.cpp", "dbmessage_test.cpp", "mirroring_sampler_test.cpp", "operation_context_test.cpp", "operation_cpu_timer_test.cpp", "operation_time_tracker_test.cpp", "persistent_task_store_test.cpp", "resource_yielder_test.cpp", "thread_client_test.cpp", "wire_version_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/transport/transport_layer_mock", "$BUILD_DIR/mongo/util/concurrency/thread_pool", "catalog/catalog_test_fixture", "commands", "dbdirectclient", "mirror_maestro", "operation_time_tracker", "repl/replmocks", "rw_concern_d", "service_context", "service_context_d_test_fixture", "service_context_test_fixture", "shard_role", "stats/counters", ], ) envWithAsio.CppUnitTest( target="query_test", source=[ "collection_index_usage_tracker_test.cpp", "cursor_manager_test.cpp", "keypattern_test.cpp", "multi_key_path_tracker_test.cpp", "update_index_data_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/client/read_preference", "$BUILD_DIR/mongo/util/clock_source_mock", "collection_index_usage_tracker", "index/index_access_method", "query_exec", "service_context", "service_context_non_d", "service_context_test_fixture", "update_index_data", ], ) envWithAsio.CppUnitTest( target="read_write_concern_test", source=[ "read_write_concern_provenance_test.cpp", "write_concern_test.cpp", "write_concern_options_test.cpp", ], LIBDEPS=[ "repl/repl_settings", "repl/replmocks", "rw_concern_d", "service_context_test_fixture", ], ) envWithAsio.CppUnitTest( target="session_test", source=[ "service_liaison_mock.cpp", "session/internal_session_pool_test.cpp", "session/internal_transactions_reap_service_test.cpp", "session/kill_sessions_local_test.cpp", "session/logical_session_cache_test.cpp", "session/logical_session_id_test.cpp", "session/session_catalog_mongod_test.cpp", "session/session_catalog_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/executor/async_timer_mock", "$BUILD_DIR/mongo/transport/transport_layer_mock", "$BUILD_DIR/mongo/util/clock_source_mock", "$BUILD_DIR/mongo/util/periodic_runner_factory", "auth/auth", "auth/authmocks", "dbdirectclient", "repl/image_collection_entry", "repl/oplog", "repl/repl_settings", "repl/replica_set_aware_service", "repl/replmocks", "repl/storage_interface_impl", "service_context_d_test_fixture", "session/kill_sessions_local", "session/logical_session_cache_impl", "session/logical_session_id_helpers", "session/session_catalog_mongod", "session/sessions_collection", "session/sessions_collection_mock", "shared_request_handling", "transaction/transaction", ], ) envWithAsio.CppUnitTest( target="shard_role_test", source=[ "d_concurrency_test.cpp", "database_name_test.cpp", "db_raii_multi_collection_test.cpp", "db_raii_test.cpp", "shard_role_test.cpp", "catalog_raii_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/util/concurrency/ticketholder", "$BUILD_DIR/mongo/util/progress_meter", "admission/ticketholder_manager", "catalog/catalog_test_fixture", "catalog/collection_crud", "catalog/collection_uuid_mismatch_info", "catalog/database_holder", "concurrency/exception_util", "query_exec", "s/shard_server_test_fixture", "s/sharding_runtime_d", "shard_role", ], ) envWithAsio.CppUnitTest( target="ttl_test", source=[ "ttl_collection_cache_test.cpp", "ttl_test.cpp", ], LIBDEPS=[ "dbdirectclient", "index_build_entry_helpers", "index_builds_coordinator_mongod", "repl/replmocks", "service_context_d_test_fixture", "shard_role", "ttl_collection_cache", "ttl_d", ], ) envWithAsio.CppUnitTest( target="vector_clock_test", source=[ "keys_collection_document_test.cpp", "logical_time_test.cpp", "read_write_concern_defaults_test.cpp", "time_proof_service_test.cpp", "vector_clock_mongod_test.cpp", "vector_clock_test.cpp", "vector_clock_test_fixture.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/util/clock_source_mock", "keys_collection_client_direct", "keys_collection_document", "op_observer/op_observer", "op_observer/op_observer_impl", "op_observer/operation_logger_impl", "read_write_concern_defaults_mock", "s/shard_server_test_fixture", "signed_logical_time", "vector_clock", "vector_clock_mutable", ], ) # These unit tests rely on the config_server_test_fixture, which # globally alters the state of the system to be in config server # mode. The other tests are not compatible with that setting. envWithAsio.CppUnitTest( target="db_unittest_with_config_server_test_fixture_test", source=[ "key_generator_update_test.cpp", "keys_collection_cache_test.cpp", "keys_collection_manager_sharding_test.cpp", "logical_time_validator_test.cpp", ], LIBDEPS=[ "auth/authmocks", "keys_collection_client_direct", "s/config_server_test_fixture", "vector_clock", ], ) asioEnv.CppIntegrationTest( target="db_integration_test", source=[ "nesting_depth_test.cpp", "exhaust_cursor_currentop_integration_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/client/clientdriver_network", "$BUILD_DIR/mongo/executor/network_interface_fixture", "$BUILD_DIR/mongo/rpc/message", "$BUILD_DIR/mongo/transport/transport_layer_egress_init", "$BUILD_DIR/mongo/util/version_impl", ], ) env.CppLibfuzzerTest( target="op_msg_fuzzer", source=[ "op_msg_fuzzer.cpp", ], LIBDEPS=[ "op_msg_fuzzer_fixture", "server_base", ], ) env.Benchmark( target="commands_bm", source=[ "commands_bm.cpp", ], LIBDEPS=[ "server_base", ], ) env.Benchmark( target="operation_cpu_timer_bm", source=[ "operation_cpu_timer_bm.cpp", ], LIBDEPS=[ "service_context_non_d", "shard_role_api", ], ) env.Benchmark( target="d_concurrency_bm", source=[ "d_concurrency_bm.cpp", ], LIBDEPS=[ "service_context_non_d", "shard_role_api", ], ) env.Benchmark( target="service_entry_point_shard_role_bm", source=[ "service_entry_point_shard_role_bm.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/util/periodic_runner_factory", "auth/authserver", "catalog/catalog_impl", "commands/standalone", "dbdirectclient", "index_builds_coordinator_mongod", "mongod_options_init", "op_observer/op_observer", "read_write_concern_defaults_mock", "repl/replmocks", "repl/storage_interface_impl", "s/sharding_runtime_d", "server_base", "service_context_d", "storage/storage_control", "storage/wiredtiger/storage_wiredtiger", "vector_clock_mongod", ], ) env.Benchmark( target="namespace_string_bm", source=[ "namespace_string_bm.cpp", ], LIBDEPS=[ "server_base", ], ) env.Benchmark( target="collection_acquisition_bm", source=[ "collection_acquisition_bm.cpp", ], LIBDEPS=[ "repl/replmocks", "service_context_d_test_fixture", "shard_role", "shard_role_api", ], ) bmEnv = env.Clone() bmEnv.InjectThirdParty(libraries=["benchmark"]) bmEnv.Library( target="bonsai_query_bm_fixture", source=[ "bonsai_query_bm_fixture.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/base", "$BUILD_DIR/third_party/benchmark/benchmark", ], )