# -*- mode: python -*- Import("env") Import("has_option") env = env.Clone() env.Library( target="test_commands_enabled", source=[ "test_commands_enabled.cpp", 'test_commands_enabled.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/idl/server_parameter', "server_status_core", ] ) env.Library( target='server_status_core', source=[ 'server_status_internal.cpp', 'server_status_metric.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ] ) env.Library( target='server_status', source=[ 'server_status.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/server_options_core', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/util/net/http_client', '$BUILD_DIR/mongo/util/processinfo', 'server_status_core', ], LIBDEPS_TYPEINFO=[ '$BUILD_DIR/mongo/rpc/rpc', ] ) env.Library( target='server_status_servers', source=[ 'server_status_servers.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/transport/message_compressor', '$BUILD_DIR/mongo/transport/service_executor', '$BUILD_DIR/mongo/util/net/ssl_manager', 'server_status', 'server_status_core', ], ) env.Library( target="write_commands_common", source=[ "write_commands/write_commands_common.cpp", ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/ops/write_ops_parsers', ], ) env.Library( target="feature_compatibility_parsers", source=[ "feature_compatibility_version_parser.cpp", 'feature_compatibility_version_document.idl', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/namespace_string', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/idl/idl_parser', ], ) # Commands available in every process that executes commands env.Library( target='core', source=[ 'end_sessions_command.cpp', 'fail_point_cmd.cpp', 'find_and_modify_common.cpp', 'generic.cpp', 'hashcmd.cpp', 'kill_all_sessions_by_pattern_command.cpp', 'kill_all_sessions_command.cpp', 'kill_sessions_command.cpp', 'parameters.cpp', 'parse_log_component_settings.cpp', 'refresh_logical_session_cache_now.cpp', 'refresh_sessions_command.cpp', 'rename_collection_common.cpp', 'start_session_command.cpp', 'update_metrics.cpp', 'parameters.idl', 'sessions_commands.idl', 'generic.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/bson/mutable/mutable_bson', '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/kill_sessions', '$BUILD_DIR/mongo/db/logical_session_cache', '$BUILD_DIR/mongo/db/logical_session_cache_impl', '$BUILD_DIR/mongo/db/logical_session_id', '$BUILD_DIR/mongo/db/logical_session_id_helpers', '$BUILD_DIR/mongo/db/mongohasher', '$BUILD_DIR/mongo/db/server_options_core', '$BUILD_DIR/mongo/idl/basic_types', '$BUILD_DIR/mongo/idl/server_parameter', '$BUILD_DIR/mongo/rpc/protocol', 'test_commands_enabled', ], ) # Commands available in all mongodb server processes (mongod, mongos, etc.) env.Library( target='servers', source=[ 'conn_pool_stats.cpp', 'conn_pool_sync.cpp', 'connection_status.cpp', 'drop_connections_command.cpp', 'rotate_certificates_command.cpp', 'generic_servers.cpp', 'isself.cpp', 'logical_session_server_status_section.cpp', 'mr_common.cpp', 'reap_logical_session_cache_now.cpp', 'test_api_version_2_commands.cpp', 'test_deprecation_command.cpp', 'traffic_recording_cmds.cpp', 'user_management_commands_common.cpp', 'drop_connections.idl', 'rotate_certificates.idl', 'rwc_defaults_commands.idl', 'user_management_commands.idl', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/read_write_concern_defaults', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/client/clientdriver_minimal', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/log_process_details', '$BUILD_DIR/mongo/db/logical_session_cache', '$BUILD_DIR/mongo/db/logical_session_cache_impl', '$BUILD_DIR/mongo/db/logical_session_id', '$BUILD_DIR/mongo/db/logical_session_id_helpers', '$BUILD_DIR/mongo/db/pipeline/pipeline', '$BUILD_DIR/mongo/db/repl/isself', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/session_catalog', '$BUILD_DIR/mongo/db/shared_request_handling', '$BUILD_DIR/mongo/db/traffic_recorder', '$BUILD_DIR/mongo/executor/egress_tag_closer_manager', '$BUILD_DIR/mongo/executor/task_executor_pool', '$BUILD_DIR/mongo/rpc/client_metadata', '$BUILD_DIR/mongo/s/coreshard', '$BUILD_DIR/mongo/scripting/scripting_common', '$BUILD_DIR/mongo/util/net/ssl_manager', '$BUILD_DIR/mongo/util/ntservice', 'authentication_commands', 'core', 'feature_compatibility_parsers', 'server_status', 'test_commands_enabled', ] ) env.Library( target="authentication_commands", source=[ 'authentication_commands.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/audit', '$BUILD_DIR/mongo/db/auth/sasl_options', '$BUILD_DIR/mongo/db/auth/user_document_parser', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/rpc/client_metadata', '$BUILD_DIR/mongo/util/net/ssl_manager', 'test_commands_enabled', ] ) env.Library( target="mongod_fsync", source=[ "fsync.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception', '$BUILD_DIR/mongo/db/curop', '$BUILD_DIR/mongo/db/storage/backup_cursor_hooks', 'fsync_locked', ] ) env.Library( target="mongod_fcv", source=[ "feature_compatibility_version.cpp", 'feature_compatibility_version.idl', ], LIBDEPS=[ 'feature_compatibility_parsers', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog_raii', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/repl/repl_settings', '$BUILD_DIR/mongo/idl/server_parameter', ], ) env.Library( target='fsync_locked', source=[ 'fsync_locked.cpp', ], LIBDEPS=[ ], ) env.Library( target='list_databases_command', source=[ 'list_databases.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/idl/idl_parser', ], ) env.Library( target='create_command', source=[ 'create.idl', 'create_command_validation.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/timeseries/timeseries_idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/catalog/collection_options_idl', '$BUILD_DIR/mongo/idl/basic_types', '$BUILD_DIR/mongo/idl/idl_parser', ], ) # Commands that are present in both mongod and embedded env.Library( target="standalone", source=[ "count_cmd.cpp", "create_indexes.cpp", "current_op.cpp", "dbcommands.cpp", "distinct.cpp", "drop_indexes.cpp", "explain_cmd.cpp", "find_and_modify.cpp", "find_cmd.cpp", "get_last_error.cpp", "getmore_cmd.cpp", "http_client.cpp", 'http_client.idl', "index_filter_commands.cpp", "kill_op.cpp", "killcursors_cmd.cpp", "killoperations_cmd.cpp", "lock_info.cpp", "list_collections.cpp", "list_databases.cpp", "list_indexes.cpp", "pipeline_command.cpp", "plan_cache_clear_command.cpp", "plan_cache_commands.cpp", "rename_collection_cmd.cpp", "run_aggregate.cpp", "sleep_command.cpp", "validate.cpp", "whats_my_sni_command.cpp", "write_commands/write_commands.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/catalog/collection_catalog_helper', '$BUILD_DIR/mongo/db/catalog/collection_query_info', '$BUILD_DIR/mongo/db/catalog/collection_validation', '$BUILD_DIR/mongo/db/catalog/database_holder', '$BUILD_DIR/mongo/db/catalog/index_key_validate', '$BUILD_DIR/mongo/db/catalog/multi_index_block', '$BUILD_DIR/mongo/db/command_can_run_here', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception', '$BUILD_DIR/mongo/db/curop_failpoint_helpers', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/db/ops/write_ops_exec', '$BUILD_DIR/mongo/db/pipeline/process_interface/mongo_process_interface', '$BUILD_DIR/mongo/db/query/command_request_response', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/db/repl/replica_set_messages', '$BUILD_DIR/mongo/db/repl/tenant_migration_donor', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/db/stats/server_read_concern_write_concern_metrics', '$BUILD_DIR/mongo/db/storage/storage_engine_common', "$BUILD_DIR/mongo/db/storage/two_phase_index_build_knobs_idl", '$BUILD_DIR/mongo/db/timeseries/bucket_catalog', '$BUILD_DIR/mongo/db/transaction', '$BUILD_DIR/mongo/db/views/views_mongod', '$BUILD_DIR/mongo/executor/async_request_executor', '$BUILD_DIR/mongo/idl/feature_flag', '$BUILD_DIR/mongo/util/log_and_backoff', '$BUILD_DIR/mongo/util/net/http_client', 'core', 'create_command', 'current_op_common', 'fsync_locked', 'kill_common', 'list_collections_filter', 'list_databases_command', 'rename_collection_idl', 'test_commands_enabled', 'write_commands_common', ], ) # Commands required by the shell to connect env.Library( target="shell_protocol", source=[ "test_commands.cpp", "whats_my_uri_cmd.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/commands', 'test_commands_enabled', ], ) env.Library( target='set_index_commit_quorum_idl', source=[ 'set_index_commit_quorum.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/commit_quorum_options', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/idl/idl_parser', ], ) env.Library( target='rename_collection_idl', source=[ 'rename_collection.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/idl/idl_parser', ], ) env.Library( target='set_feature_compatibility_version_idl', source=[ 'set_feature_compatibility_version.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/idl/idl_parser', 'feature_compatibility_parsers', ], ) env.Library( target='shutdown_idl', source=[ 'shutdown.cpp', 'shutdown.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/idl/idl_parser', '$BUILD_DIR/mongo/util/fail_point', ], ) # Commands that should only be present in mongod env.Library( target="mongod", source=[ "apply_ops_cmd.cpp", "collection_to_capped.cpp", "compact.cpp", "cpuload.cpp", "dbcheck.cpp", "dbcommands_d.cpp", "dbhash.cpp", "driverHelpers.cpp", "internal_rename_if_options_and_indexes_match_cmd.cpp", "map_reduce_command.cpp", "oplog_application_checks.cpp", "oplog_note.cpp", 'read_write_concern_defaults_server_status.cpp', "resharding_test_commands.cpp", "resharding_test_commands.idl", "resize_oplog.cpp", "resize_oplog.idl", 'rwc_defaults_commands.cpp', "set_feature_compatibility_version_command.cpp", "set_index_commit_quorum_command.cpp", "sharded_index_consistency_server_status.cpp", "shutdown_d.cpp", "snapshot_management.cpp", "tenant_migration_donor_cmds.cpp", "tenant_migration_recipient_cmds.cpp", "top_command.cpp", "txn_cmds.cpp", "user_management_commands.cpp", "vote_commit_index_build_command.cpp", 'internal_rename_if_options_and_indexes_match.idl', 'vote_commit_index_build.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver_minimal', '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/auth/builtin_roles', '$BUILD_DIR/mongo/db/auth/sasl_options', '$BUILD_DIR/mongo/db/auth/user', '$BUILD_DIR/mongo/db/auth/user_document_parser', '$BUILD_DIR/mongo/db/catalog/catalog_control', '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/catalog/collection_catalog_helper', '$BUILD_DIR/mongo/db/catalog/index_key_validate', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/curop_failpoint_helpers', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/exec/sbe_cmd', '$BUILD_DIR/mongo/db/exec/stagedebug_cmd', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/db/pipeline/pipeline', '$BUILD_DIR/mongo/db/pipeline/process_interface/mongo_process_interface', '$BUILD_DIR/mongo/db/repl/dbcheck', '$BUILD_DIR/mongo/db/repl/oplog', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/repl/repl_server_parameters', '$BUILD_DIR/mongo/db/repl/tenant_migration_donor_service', '$BUILD_DIR/mongo/db/repl/tenant_migration_recipient_service', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/db/s/sharding_runtime_d', '$BUILD_DIR/mongo/db/server_options_core', '$BUILD_DIR/mongo/idl/idl_parser', '$BUILD_DIR/mongo/util/net/ssl_manager', 'core', 'kill_common', 'map_reduce_agg', 'mongod_fcv', 'mongod_fsync', 'profile_common', 'server_status', 'servers', 'set_feature_compatibility_version_idl', 'set_index_commit_quorum_idl', 'shell_protocol', 'shutdown_idl', 'standalone', 'tenant_migration_cmds_request', 'test_commands_enabled', 'txn_cmd_request', ], ) env.Library( target='kill_common', source=[ 'killcursors_common.cpp', 'kill_op_cmd_base.cpp', 'kill_operations.idl', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/audit', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/operation_killer', '$BUILD_DIR/mongo/db/query/command_request_response', ], ) env.Library( target='current_op_common', source=[ 'current_op_common.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/db/pipeline/aggregation_request', '$BUILD_DIR/mongo/db/query/command_request_response', '$BUILD_DIR/mongo/db/service_context', 'test_commands_enabled' ], ) env.Library( target='profile_common', source=[ 'profile_common.cpp', 'profile.idl', '$BUILD_DIR/mongo/db/profile_filter_impl.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/curop', '$BUILD_DIR/mongo/db/matcher/expressions', '$BUILD_DIR/mongo/db/server_options_core', ], ) env.Library( target="list_collections_filter", source=[ 'list_collections_filter.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ], ) env.Library( target='tenant_migration_cmds_request', source=[ 'tenant_migration_donor_cmds.idl', 'tenant_migration_recipient_cmds.idl', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/connection_string', '$BUILD_DIR/mongo/client/read_preference', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/repl/tenant_migration_state_machine_idl', '$BUILD_DIR/mongo/idl/idl_parser', ] ) env.Library( target='txn_cmd_request', source=[ "txn_cmds.idl", "txn_two_phase_commit_cmds.idl", ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/idl/idl_parser', ] ) env.Library( target='map_reduce_parser', source=[ 'map_reduce_out_options.cpp', 'map_reduce.idl', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/write_concern_options', '$BUILD_DIR/mongo/idl/idl_parser', ] ) env.Library( target='map_reduce_agg', source=[ 'map_reduce_agg.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands/servers', '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/index/index_access_methods', '$BUILD_DIR/mongo/db/pipeline/process_interface/mongo_process_interface', '$BUILD_DIR/mongo/db/pipeline/process_interface/mongod_process_interface_factory', '$BUILD_DIR/mongo/db/query/map_reduce_output_format', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/idl/idl_parser', 'map_reduce_parser' ] ) env.CppUnitTest( target="map_reduce_agg_test", source=[ "map_reduce_agg_test.cpp", "map_reduce_parse_test.cpp", ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/query/query_test_service_context', '$BUILD_DIR/mongo/db/storage/two_phase_index_build_knobs_idl', 'map_reduce_agg', ], ) env.CppUnitTest( target="command_mirroring_test", source=[ 'command_mirroring_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', '$BUILD_DIR/mongo/db/commands/standalone', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/unittest/unittest', ], ) env.CppUnitTest( target="async_command_execution_test", source=[ "async_command_execution_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/base", "$BUILD_DIR/mongo/db/auth/authmocks", "$BUILD_DIR/mongo/db/auth/authorization_manager_global", "$BUILD_DIR/mongo/db/commands", "$BUILD_DIR/mongo/db/commands/standalone", "$BUILD_DIR/mongo/db/service_context_test_fixture", "$BUILD_DIR/mongo/unittest/unittest", "$BUILD_DIR/mongo/util/version_impl", ], ) env.CppUnitTest( target="db_commands_test", source=[ "index_filter_commands_test.cpp", "list_collections_filter_test.cpp", "mr_test.cpp", "parse_log_component_settings_test.cpp", "plan_cache_commands_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/auth/authmocks", "$BUILD_DIR/mongo/db/commands/list_collections_filter", "$BUILD_DIR/mongo/db/query/query_planner", "$BUILD_DIR/mongo/db/query/query_test_service_context", "$BUILD_DIR/mongo/db/repl/drop_pending_collection_reaper", "$BUILD_DIR/mongo/db/repl/replmocks", "$BUILD_DIR/mongo/db/repl/storage_interface_impl", "$BUILD_DIR/mongo/db/service_context_d", "$BUILD_DIR/mongo/db/service_context_d_test_fixture", '$BUILD_DIR/mongo/idl/idl_parser', "core", "mongod", "servers", "standalone", ], )