summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2020-07-23 21:39:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-23 21:52:22 +0000
commitd986854f5ec4fda16d22baab2d380b202626661f (patch)
treee477ddeb82864d951a3a94cadfc76709cf78730d /src
parent2af311b7cbd17ecdddef919acac8d22f96391686 (diff)
downloadmongo-d986854f5ec4fda16d22baab2d380b202626661f.tar.gz
SERVER-48638 Added LibdepsLinter to enforce LIBDEPS rules
Diffstat (limited to 'src')
-rw-r--r--src/mongo/client/SConscript1
-rw-r--r--src/mongo/db/SConscript7
-rw-r--r--src/mongo/db/commands/SConscript4
-rw-r--r--src/mongo/db/pipeline/SConscript1
-rw-r--r--src/mongo/db/pipeline/process_interface/SConscript8
-rw-r--r--src/mongo/db/repl/SConscript61
-rw-r--r--src/mongo/db/s/SConscript2
-rw-r--r--src/mongo/db/storage/SConscript22
-rw-r--r--src/mongo/db/storage/wiredtiger/SConscript28
-rw-r--r--src/mongo/embedded/mongo_embedded/SConscript2
-rw-r--r--src/mongo/util/SConscript3
-rw-r--r--src/third_party/SConscript8
12 files changed, 74 insertions, 73 deletions
diff --git a/src/mongo/client/SConscript b/src/mongo/client/SConscript
index cd921a2c966..bb8f4e1fdbc 100644
--- a/src/mongo/client/SConscript
+++ b/src/mongo/client/SConscript
@@ -255,7 +255,6 @@ env.Library(
'$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/executor/egress_tag_closer_manager',
'$BUILD_DIR/mongo/transport/message_compressor',
- '$BUILD_DIR/mongo/util/net/ssl_manager',
],
)
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index 8c7d21009d2..75538f4e0e5 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -328,7 +328,6 @@ env.Library(
"$BUILD_DIR/mongo/util/net/ssl_manager",
"$BUILD_DIR/mongo/util/net/ssl_parameters_auth",
"auth/authorization_manager_global",
- "serverinit",
],
)
@@ -2017,7 +2016,6 @@ env.Library(
'$BUILD_DIR/mongo/client/clientdriver_minimal',
'$BUILD_DIR/mongo/s/grid',
'$BUILD_DIR/mongo/s/sessions_collection_sharded',
- '$BUILD_DIR/mongo/s/sessions_collection_sharded',
'$BUILD_DIR/mongo/scripting/scripting',
'$BUILD_DIR/mongo/transport/service_entry_point',
'$BUILD_DIR/mongo/transport/transport_layer_manager',
@@ -2275,11 +2273,10 @@ asioEnv.CppIntegrationTest(
'exhaust_cursor_currentop_integration_test.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/executor/network_interface_fixture',
- '$BUILD_DIR/mongo/transport/transport_layer_egress_init',
'$BUILD_DIR/mongo/client/clientdriver_network',
- '$BUILD_DIR/mongo/transport/transport_layer_egress_init',
+ '$BUILD_DIR/mongo/executor/network_interface_fixture',
'$BUILD_DIR/mongo/rpc/protocol',
+ '$BUILD_DIR/mongo/transport/transport_layer_egress_init',
'$BUILD_DIR/mongo/util/version_impl',
],
)
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index 91b360c276a..a93cc18d824 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -575,10 +575,8 @@ env.CppUnitTest(
LIBDEPS=[
'$BUILD_DIR/mongo/db/auth/authmocks',
'$BUILD_DIR/mongo/db/query/query_test_service_context',
- 'map_reduce_agg',
- ],
- LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/storage/two_phase_index_build_knobs_idl',
+ 'map_reduce_agg',
],
)
diff --git a/src/mongo/db/pipeline/SConscript b/src/mongo/db/pipeline/SConscript
index f5de186ff0c..9995e700367 100644
--- a/src/mongo/db/pipeline/SConscript
+++ b/src/mongo/db/pipeline/SConscript
@@ -67,7 +67,6 @@ env.Library(
'variables.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/query/query_knobs',
'$BUILD_DIR/mongo/db/exec/document_value/document_value',
'$BUILD_DIR/mongo/db/query/collation/collator_factory_interface',
'$BUILD_DIR/mongo/db/query/datetime/date_time_support',
diff --git a/src/mongo/db/pipeline/process_interface/SConscript b/src/mongo/db/pipeline/process_interface/SConscript
index 5c74b6f7999..2c1e4404ce8 100644
--- a/src/mongo/db/pipeline/process_interface/SConscript
+++ b/src/mongo/db/pipeline/process_interface/SConscript
@@ -20,10 +20,10 @@ env.Library(
'common_process_interface.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/auth/auth',
- '$BUILD_DIR/mongo/db/generic_cursor',
+ '$BUILD_DIR/mongo/db/auth/auth',
+ '$BUILD_DIR/mongo/db/generic_cursor',
'$BUILD_DIR/mongo/db/pipeline/field_path',
- '$BUILD_DIR/mongo/s/sharding_router_api',
+ '$BUILD_DIR/mongo/s/sharding_router_api',
],
)
@@ -50,7 +50,6 @@ env.Library(
'$BUILD_DIR/mongo/db/index_builds_coordinator_mongod',
'$BUILD_DIR/mongo/db/session_catalog',
'$BUILD_DIR/mongo/db/storage/backup_cursor_hooks',
- '$BUILD_DIR/mongo/db/transaction',
'$BUILD_DIR/mongo/scripting/scripting_common',
],
)
@@ -105,7 +104,6 @@ env.Library(
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/session_catalog',
- '$BUILD_DIR/mongo/db/pipeline/sharded_agg_helpers',
],
)
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript
index 24856ef92c2..e26a7752475 100644
--- a/src/mongo/db/repl/SConscript
+++ b/src/mongo/db/repl/SConscript
@@ -633,36 +633,39 @@ env.Library(
],
)
-env.Library('member_data',
- [
- 'member_data.cpp',
- ],
- LIBDEPS=[
- 'replica_set_messages',
- ])
+env.Library(
+ target='member_data',
+ source=[
+ 'member_data.cpp',
+ ],
+ LIBDEPS=[
+ 'replica_set_messages',
+ ]
+)
-env.Library('topology_coordinator',
- [
- 'heartbeat_response_action.cpp',
- 'topology_coordinator.cpp',
- env.Idlc('topology_coordinator.idl')[0],
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/db/audit',
- '$BUILD_DIR/mongo/rpc/metadata',
- '$BUILD_DIR/mongo/util/fail_point',
- 'isself',
- 'member_data',
- 'replica_set_messages',
- 'repl_settings',
- 'repl_coordinator_interface',
- ],
- LIBDEPS_PRIVATE=[
- 'repl_server_parameters',
- '$BUILD_DIR/mongo/db/catalog/commit_quorum_options',
- '$BUILD_DIR/mongo/idl/server_parameter',
- 'repl_server_parameters',
- ])
+env.Library(
+ target='topology_coordinator',
+ source=[
+ 'heartbeat_response_action.cpp',
+ 'topology_coordinator.cpp',
+ env.Idlc('topology_coordinator.idl')[0],
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/db/audit',
+ '$BUILD_DIR/mongo/rpc/metadata',
+ '$BUILD_DIR/mongo/util/fail_point',
+ 'isself',
+ 'member_data',
+ 'replica_set_messages',
+ 'repl_settings',
+ 'repl_coordinator_interface',
+ ],
+ LIBDEPS_PRIVATE=[
+ 'repl_server_parameters',
+ '$BUILD_DIR/mongo/db/catalog/commit_quorum_options',
+ '$BUILD_DIR/mongo/idl/server_parameter',
+ ]
+)
env.Library(
target='repl_coordinator_impl',
diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript
index 5f4c6b0c4e5..3a40eadc5b6 100644
--- a/src/mongo/db/s/SConscript
+++ b/src/mongo/db/s/SConscript
@@ -408,7 +408,7 @@ env.CppUnitTest(
'type_shard_identity_test.cpp',
'vector_clock_shard_server_test.cpp',
],
- LIBDEPS_PRIVATE=[
+ LIBDEPS=[
'$BUILD_DIR/mongo/db/auth/authmocks',
'$BUILD_DIR/mongo/db/keys_collection_client_direct',
'$BUILD_DIR/mongo/db/logical_session_cache_impl',
diff --git a/src/mongo/db/storage/SConscript b/src/mongo/db/storage/SConscript
index c356b6a3279..5384d1852c3 100644
--- a/src/mongo/db/storage/SConscript
+++ b/src/mongo/db/storage/SConscript
@@ -180,16 +180,21 @@ env.Library(
env.Library(
target='encryption_hooks',
- source= [
+ source=[
'encryption_hooks.cpp',
- ],
- LIBDEPS= ['$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/service_context'],
+ ],
+ LIBDEPS= [
+ '$BUILD_DIR/mongo/base',
+ '$BUILD_DIR/mongo/db/service_context'
+ ],
LIBDEPS_DEPENDENTS=[
'$BUILD_DIR/mongo/mongod_initializers',
'$BUILD_DIR/mongo/mongos_initializers',
- ],
- )
+ ],
+ LIBDEPS_TAGS=[
+ 'lint-allow-nonprivate-on-deps-dependents',
+ 'lint-allow-bidirectional-edges',
+ ])
env.Library(
target='backup_cursor_hooks',
@@ -203,6 +208,10 @@ env.Library(
LIBDEPS_DEPENDENTS=[
'$BUILD_DIR/mongo/mongod_initializers',
],
+ LIBDEPS_TAGS=[
+ 'lint-allow-nonprivate-on-deps-dependents',
+ 'lint-allow-bidirectional-edges',
+ ]
)
env.Library(
@@ -463,7 +472,6 @@ env.CppUnitTest(
'kv/kv_drop_pending_ident_reaper',
'storage_engine_lock_file',
'storage_engine_metadata',
- 'storage_repair_observer',
],
)
diff --git a/src/mongo/db/storage/wiredtiger/SConscript b/src/mongo/db/storage/wiredtiger/SConscript
index b724602f239..115f6661bd0 100644
--- a/src/mongo/db/storage/wiredtiger/SConscript
+++ b/src/mongo/db/storage/wiredtiger/SConscript
@@ -22,7 +22,10 @@ env.Library(
'$BUILD_DIR/mongo/mongod_initializers',
'$BUILD_DIR/mongo/mongos_initializers',
],
-
+ LIBDEPS_TAGS=[
+ 'lint-allow-nonprivate-on-deps-dependents',
+ 'lint-allow-bidirectional-edges',
+ ],
)
if wiredtiger:
@@ -51,7 +54,7 @@ if wiredtiger:
'wiredtiger_size_storer.cpp',
'wiredtiger_util.cpp',
env.Idlc('wiredtiger_parameters.idl')[0],
- ],
+ ],
LIBDEPS= [
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/bson/dotted_path_support',
@@ -82,7 +85,7 @@ if wiredtiger:
'$BUILD_DIR/third_party/shim_wiredtiger',
'$BUILD_DIR/third_party/shim_zlib',
'storage_wiredtiger_customization_hooks',
- ],
+ ],
LIBDEPS_PRIVATE= [
'oplog_stone_parameters',
'$BUILD_DIR/mongo/db/db_raii',
@@ -91,8 +94,8 @@ if wiredtiger:
'$BUILD_DIR/mongo/db/snapshot_window_options',
'$BUILD_DIR/mongo/db/storage/storage_repair_observer',
'$BUILD_DIR/mongo/util/options_parser/options_parser',
- ],
- )
+ ],
+ )
wtEnv.Library(
target='storage_wiredtiger',
@@ -129,8 +132,10 @@ if wiredtiger:
'wiredtiger_util_test.cpp',
],
LIBDEPS=[
- 'storage_wiredtiger_core',
'$BUILD_DIR/mongo/db/auth/authmocks',
+ '$BUILD_DIR/mongo/db/index/index_access_methods',
+ '$BUILD_DIR/mongo/db/repl/replmocks',
+ '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/service_context_d',
'$BUILD_DIR/mongo/db/service_context_test_fixture',
@@ -142,13 +147,6 @@ if wiredtiger:
'$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger',
'$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger_core',
'$BUILD_DIR/mongo/util/clock_source_mock',
- ],
- LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/auth/authmocks',
- '$BUILD_DIR/mongo/db/index/index_access_methods',
- '$BUILD_DIR/mongo/db/repl/replmocks',
- '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
- '$BUILD_DIR/mongo/db/service_context_test_fixture',
]
)
@@ -200,8 +198,6 @@ if wiredtiger:
LIBDEPS=[
'additional_wiredtiger_index_tests',
'additional_wiredtiger_record_store_tests',
- ],
- LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/auth/authmocks',
'$BUILD_DIR/mongo/db/repl/replmocks',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
@@ -218,8 +214,6 @@ if wiredtiger:
LIBDEPS=[
'additional_wiredtiger_index_tests',
'additional_wiredtiger_record_store_tests',
- ],
- LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/auth/authmocks',
'$BUILD_DIR/mongo/db/repl/replmocks',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
diff --git a/src/mongo/embedded/mongo_embedded/SConscript b/src/mongo/embedded/mongo_embedded/SConscript
index 1295f389557..28c8b80066f 100644
--- a/src/mongo/embedded/mongo_embedded/SConscript
+++ b/src/mongo/embedded/mongo_embedded/SConscript
@@ -89,7 +89,7 @@ if get_option('link-model') != 'dynamic-sdk':
'mongo_embedded_test.cpp',
env.Idlc('mongo_embedded_test.idl')[0],
],
- LIBDEPS_PRIVATE=[
+ LIBDEPS=[
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/server_options_core',
diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript
index 426166a40df..5e316098bc2 100644
--- a/src/mongo/util/SConscript
+++ b/src/mongo/util/SConscript
@@ -326,6 +326,9 @@ if env['MONGO_ALLOCATOR'] in ['tcmalloc', 'tcmalloc-experimental']:
'$BUILD_DIR/mongo/mongos_initializers',
'$BUILD_DIR/mongo/mongod_initializers',
],
+ LIBDEPS_TAGS=[
+ 'lint-allow-nonprivate-on-deps-dependents',
+ ]
)
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
index 081b68fb820..f56bcd4f42c 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -229,15 +229,17 @@ for builder_name in ('Program', 'SharedLibrary', 'LoadableModule', 'StaticLibrar
# OverrideEnvironment, since if you didn't pass any kw args
# into your builder call, you just reuse the env you were
# called with. That could mean that we see the same
- # envirnoment here multiple times. But that is really OK,
+ # environment here multiple times. But that is really OK,
# since the operation we are performing would be performed on
# all of them anyway. The flag serves as a way to disable the
# auto-injection for the handful of libraries where we must do
# so to avoid forming a cycle.
if not env.get('DISABLE_ALLOCATOR_SHIM_INJECTION', False):
lds = env.get('LIBDEPS', [])
- lds.append('$BUILD_DIR/third_party/shim_allocator')
- env['LIBDEPS'] = lds
+ shim_allocator = '$BUILD_DIR/third_party/shim_allocator'
+ if shim_allocator not in lds:
+ lds.append(shim_allocator)
+ env['LIBDEPS'] = lds
return target, source