diff options
30 files changed, 398 insertions, 47 deletions
diff --git a/SConstruct b/SConstruct index 1ccc0506d6c..171bdf27212 100644 --- a/SConstruct +++ b/SConstruct @@ -812,6 +812,7 @@ envDict = dict(BUILD_ROOT=buildDir, CONFIGURELOG=sconsDataDir.File('config.log'), INSTALL_DIR=installDir, CONFIG_HEADER_DEFINES={}, + LIBDEPS_TAG_EXPANSIONS=[], ) env = Environment(variables=env_vars, **envDict) @@ -1054,26 +1055,77 @@ if link_model.startswith("dynamic"): # Do the same for SharedObject env['BUILDERS']['Object'] = env['BUILDERS']['SharedObject'] - # TODO: Ideally, the conditions below should be based on a detection of what linker we are - # using, not the local OS, but I doubt very much that we will see the mach-o linker on - # anything other than Darwin, or a BFD/sun-esque linker elsewhere. + # TODO: Ideally, the conditions below should be based on a + # detection of what linker we are using, not the local OS, but I + # doubt very much that we will see the mach-o linker on anything + # other than Darwin, or a BFD/sun-esque linker elsewhere. - # On Darwin, we need to tell the linker that undefined symbols are resolved via dynamic - # lookup; otherwise we get build failures. On other unixes, we need to suppress as-needed - # behavior so that initializers are ensured present, even if there is no visible edge to - # the library in the symbol graph. + # On Darwin, we need to tell the linker that undefined symbols are + # resolved via dynamic lookup; otherwise we get build failures. On + # other unixes, we need to suppress as-needed behavior so that + # initializers are ensured present, even if there is no visible + # edge to the library in the symbol graph. # - # NOTE: The darwin linker flag is only needed because the library graph is not a DAG. Once - # the graph is a DAG, we will require all edges to be expressed, and we should drop the - # flag. When that happens, we should also add -z,defs flag on ELF platforms to ensure that - # missing symbols due to unnamed dependency edges result in link errors. + # NOTE: The darwin linker flag is only needed because the library + # graph is not a DAG. Once the graph is a DAG, we will require all + # edges to be expressed, and we should drop the flag. When that + # happens, we should also add -z,defs flag on ELF platforms to + # ensure that missing symbols due to unnamed dependency edges + # result in link errors. + # + # NOTE: The 'incomplete' tag can be applied to a library to + # indicate that it does not (or cannot) completely express all of + # its required link dependencies. This can occur for three + # reasons: + # + # - No unique provider for the symbol: Some symbols do not have a + # unique dependency that provides a definition, in which case it + # is impossible for the library to express a dependency edge to + # resolve the symbol + # + # - The library is part of a cycle: If library A depends on B, + # which depends on C, which depends on A, then it is impossible + # to express all three edges in SCons, since otherwise there is + # no way to sequence building the libraries. The cyclic + # libraries actually work at runtime, because some parent object + # links all of them. + # + # - The symbol is provided by an executable into which the library + # will be linked. The mongo::inShutdown symbol is a good + # example. + # + # All of these are defects in the linking model. In an effort to + # eliminate these issues, we have begun tagging those libraries + # that are affected, and requiring that all non-tagged libraries + # correctly express all dependencies. As we repair each defective + # library, we can remove the tag. When all the tags are removed + # the graph will be acyclic. + if env.TargetOSIs('osx'): - if link_model != "dynamic-strict": - env.AppendUnique(SHLINKFLAGS=["-Wl,-undefined,dynamic_lookup"]) + if link_model == "dynamic-strict": + # Darwin is strict by default + pass + else: + def libdeps_tags_expand_incomplete(source, target, env, for_signature): + # On darwin, since it is strict by default, we need to add a flag + # when libraries are tagged incomplete. + if 'incomplete' in target[0].get_env().get("LIBDEPS_TAGS", []): + return ["-Wl,-undefined,dynamic_lookup"] + return [] + env['LIBDEPS_TAG_EXPANSIONS'].append(libdeps_tags_expand_incomplete) else: env.AppendUnique(SHLINKFLAGS=["-Wl,--no-as-needed"]) if link_model == "dynamic-strict": env.AppendUnique(SHLINKFLAGS=["-Wl,-z,defs"]) + else: + # On BFD/gold linker environments, which are not strict by + # default, we need to add a flag when libraries are not + # tagged incomplete. + def libdeps_tags_expand_incomplete(source, target, env, for_signature): + if 'incomplete' not in target[0].get_env().get("LIBDEPS_TAGS", []): + return ["-Wl,-z,defs"] + return [] + env['LIBDEPS_TAG_EXPANSIONS'].append(libdeps_tags_expand_incomplete) if optBuild: env.SetConfigHeaderDefine("MONGO_CONFIG_OPTIMIZED_BUILD") diff --git a/site_scons/libdeps.py b/site_scons/libdeps.py index 257cce8f33c..78d39487780 100644 --- a/site_scons/libdeps.py +++ b/site_scons/libdeps.py @@ -125,7 +125,7 @@ def __get_syslibdeps(node): """ cached_var_name = syslibdeps_env_var + '_cached' if not hasattr(node.attributes, cached_var_name): - syslibdeps = [] + syslibdeps = node.get_env().Flatten(node.get_env().get(syslibdeps_env_var, [])) for lib in __get_libdeps(node): for syslib in node.get_env().Flatten(lib.get_env().get(syslibdeps_env_var, [])): if syslib: @@ -304,6 +304,12 @@ def shlibdeps_emitter(target, source, env): return target, source +def expand_libdeps_tags(source, target, env, for_signature): + results = [] + for expansion in env.get('LIBDEPS_TAG_EXPANSIONS', []): + results.append(expansion(source, target, env, for_signature)) + return results + def setup_environment(env, emitting_shared=False): """Set up the given build environment to do LIBDEPS tracking.""" @@ -312,6 +318,8 @@ def setup_environment(env, emitting_shared=False): except KeyError: env['_LIBDEPS'] = '$_LIBDEPS_LIBS' + env['_LIBDEPS_TAGS'] = expand_libdeps_tags + # TODO: remove this # this is a horrible horrible hack for # for 32-bit solaris @@ -335,7 +343,7 @@ def setup_environment(env, emitting_shared=False): env.Append( PROGEMITTER=libdeps_emitter, SHLIBEMITTER=libdeps_emitter) - env.Prepend(_LIBFLAGS=' $LINK_WHOLE_ARCHIVE_START $LINK_LIBGROUP_START $_LIBDEPS $LINK_LIBGROUP_END $LINK_WHOLE_ARCHIVE_END $_SYSLIBDEPS ') + env.Prepend(_LIBFLAGS=' $_LIBDEPS_TAGS $LINK_WHOLE_ARCHIVE_START $LINK_LIBGROUP_START $_LIBDEPS $LINK_LIBGROUP_END $LINK_WHOLE_ARCHIVE_END $_SYSLIBDEPS ') for builder_name in ('Program', 'SharedLibrary', 'LoadableModule'): try: update_scanner(env['BUILDERS'][builder_name]) diff --git a/src/mongo/SConscript b/src/mongo/SConscript index 947bd37f6bd..dca23295baf 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -371,7 +371,16 @@ if not has_option('noshell') and usemozjs: 'util/signal_handlers', 'linenoise_utf8', 'shell/mongojs', - ]) + ], + LIBDEPS_TAGS=[ + # Circular with shell_options below. It is unclear + # why this is split into two libraries, or even + # why these libraries exist at all, since it seems + # that the only thing that links them is the shell + # itself. + 'incomplete', + ], + ) # mongo shell options shell_core_env.Library("shell_options", ["shell/shell_options.cpp"], diff --git a/src/mongo/client/SConscript b/src/mongo/client/SConscript index 7029667ffc6..f8e130a76b8 100644 --- a/src/mongo/client/SConscript +++ b/src/mongo/client/SConscript @@ -139,7 +139,12 @@ env.Library( 'authentication', 'connection_string', 'read_preference', - ] + ], + LIBDEPS_TAGS=[ + # Depends on mongo::inShutdown + 'incomplete' + ], + ) env.Library( @@ -149,6 +154,7 @@ env.Library( ], LIBDEPS=[ 'clientdriver', + '$BUILD_DIR/mongo/db/auth/authcommon', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', ] ) @@ -168,7 +174,12 @@ env.Library( '$BUILD_DIR/mongo/rpc/protocol', '$BUILD_DIR/mongo/util/net/hostandport', 'connection_pool', - ] + ], + LIBDEPS_TAGS=[ + # Needs things from coredb in Command, but this would be circular through the + # libsharding_client + 'incomplete', + ], ) env.Library( @@ -234,6 +245,7 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/s/catalog/catalog_manager', + '$BUILD_DIR/mongo/s/coreshard', 'clientdriver', ], ) diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript index 7c776eb8baf..aad06eea5d9 100644 --- a/src/mongo/db/SConscript +++ b/src/mongo/db/SConscript @@ -341,6 +341,10 @@ env.Library( '$BUILD_DIR/mongo/util/concurrency/synchronization', 'range_arithmetic', ], + LIBDEPS_TAGS=[ + # Needs mongo::inShutdown + 'incomplete', + ] ) env.CppUnitTest( @@ -366,6 +370,8 @@ env.Library( ], LIBDEPS=[ "$BUILD_DIR/mongo/client/clientdriver", + "$BUILD_DIR/mongo/db/auth/authservercommon", + "$BUILD_DIR/mongo/db/coredb", "$BUILD_DIR/mongo/rpc/command_reply", "$BUILD_DIR/mongo/rpc/command_request", "$BUILD_DIR/mongo/rpc/metadata", @@ -375,6 +381,10 @@ env.Library( "$BUILD_DIR/mongo/util/signal_handlers", "auth/authorization_manager_global", ], + LIBDEPS_TAGS=[ + # Depends on Command::execCommand, which is not uniquely defined + 'incomplete', + ], ) env.Library( @@ -387,10 +397,15 @@ env.Library( ], LIBDEPS=[ "$BUILD_DIR/mongo/db/coredb", + "$BUILD_DIR/mongo/db/curop", "$BUILD_DIR/mongo/util/net/miniwebserver", "mongodandmongos", 'repl/repl_coordinator_global', ], + LIBDEPS_TAGS=[ + # Depends on symbols from serverOnlyFiles + 'incomplete', + ], ) # mongod options @@ -462,6 +477,10 @@ env.Library( '$BUILD_DIR/mongo/util/cmdline_utils/cmdline_utils', '$BUILD_DIR/mongo/util/foundation', '$BUILD_DIR/mongo/util/processinfo', + '$BUILD_DIR/mongo/s/client/sharding_client', + '$BUILD_DIR/mongo/s/write_ops/batch_write_types', + 'auth/authcommon', + 'auth/authorization_manager_global', 'auth/serverauth', 'commands/server_status_core', 'common', @@ -469,6 +488,7 @@ env.Library( 'index/key_generator', 'index_names', 'log_process_details', + 'lasterror', 'matcher/expressions', 'matcher/expressions_geo', 'matcher/expressions_text', @@ -478,6 +498,12 @@ env.Library( 'stats/counters', 'stats/timer_stats', ], + LIBDEPS_TAGS=[ + # Dependencies on Command::registerError and + # Command::execCommand, which are not uniquely defined. Also + # depends on mongo::exitCleanly. + 'incomplete', + ], ) diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript index d5c41e4c8fb..cba1d318fc5 100644 --- a/src/mongo/db/auth/SConscript +++ b/src/mongo/db/auth/SConscript @@ -76,6 +76,7 @@ env.Library('authservercommon', 'security_key.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/db/coredb', 'authcommon', 'authcore', 'authmocks', @@ -111,26 +112,45 @@ env.Library('saslauth', 'authmocks', # Wat? 'sasl_options', '$BUILD_DIR/mongo/crypto/scramauth', - '$BUILD_DIR/mongo/util/net/network']) + '$BUILD_DIR/mongo/util/net/network', + ], + LIBDEPS_TAGS=[ + # Depends on Commands::testCommandsEnabled, which is not uniquely defined + 'incomplete', + ], +) env.Library('authmongod', ['authz_manager_external_state_d.cpp', 'authz_session_external_state_d.cpp', 'auth_index_d.cpp', - 'impersonation_session.cpp'], - + 'impersonation_session.cpp' + ], LIBDEPS=[ 'authservercommon', '$BUILD_DIR/mongo/db/repl/repl_coordinator_global', '$BUILD_DIR/mongo/db/server_parameters', - ]) + ], + LIBDEPS_TAGS=[ + # Depends on files db_raii.cpp and catalog support files from serverOnlyFiles + 'incomplete', + ], +) env.Library('authmongos', ['authz_manager_external_state_s.cpp', 'authz_session_external_state_s.cpp', 'user_cache_invalidator_job.cpp'], - LIBDEPS=['authservercommon', - '$BUILD_DIR/mongo/s/catalog/dist_lock_manager']) + LIBDEPS=[ + 'authservercommon', + '$BUILD_DIR/mongo/s/catalog/dist_lock_manager', + '$BUILD_DIR/mongo/s/coreshard', + ], + LIBDEPS_TAGS=[ + # Depends on inShutdown + 'incomplete', + ], +) env.Library( target='authmocks', diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript index bf394c42cff..a624cf909e8 100644 --- a/src/mongo/db/commands/SConscript +++ b/src/mongo/db/commands/SConscript @@ -17,7 +17,11 @@ env.Library( target='killcursors_common', source=[ 'killcursors_common.cpp', - ] + ], + LIBDEPS=[ + "$BUILD_DIR/mongo/db/coredb", + '$BUILD_DIR/mongo/db/query/command_request_response', + ], ) env.CppUnitTest( diff --git a/src/mongo/db/exec/SConscript b/src/mongo/db/exec/SConscript index 8bc45e1971d..6749b635a34 100644 --- a/src/mongo/db/exec/SConscript +++ b/src/mongo/db/exec/SConscript @@ -79,8 +79,13 @@ env.Library( "scoped_timer", "working_set", "$BUILD_DIR/mongo/base", + "$BUILD_DIR/mongo/db/ops/update_driver", '$BUILD_DIR/third_party/s2/s2', ], + LIBDEPS_TAGS=[ + # A great number of undefined symbols in this library + 'incomplete', + ] ) env.CppUnitTest( diff --git a/src/mongo/db/index/SConscript b/src/mongo/db/index/SConscript index e12083be500..cf096712f11 100644 --- a/src/mongo/db/index/SConscript +++ b/src/mongo/db/index/SConscript @@ -51,6 +51,7 @@ env.Library( '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/db/geo/geometry', + '$BUILD_DIR/mongo/db/geo/geoparser', '$BUILD_DIR/mongo/db/mongohasher', '$BUILD_DIR/third_party/s2/s2', ] diff --git a/src/mongo/db/pipeline/SConscript b/src/mongo/db/pipeline/SConscript index f849620a5a9..d307503afc8 100644 --- a/src/mongo/db/pipeline/SConscript +++ b/src/mongo/db/pipeline/SConscript @@ -121,7 +121,13 @@ docSourceEnv.Library( '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/matcher/expressions', '$BUILD_DIR/third_party/shim_snappy', - ] + ], + LIBDEPS_TAGS=[ + # Inclusion of sorter.cpp causes a dependency on mongo::isMongos, + # which is not uniquely defined + 'incomplete' + ], + ) env.Library( diff --git a/src/mongo/db/query/SConscript b/src/mongo/db/query/SConscript index 8be967e440e..cc543afead5 100644 --- a/src/mongo/db/query/SConscript +++ b/src/mongo/db/query/SConscript @@ -51,8 +51,15 @@ env.Library( "internal_plans", "query_planner", "query_planner_test_lib", - "$BUILD_DIR/mongo/db/exec/exec" - ], + "$BUILD_DIR/mongo/db/curop", + "$BUILD_DIR/mongo/db/exec/exec", + "$BUILD_DIR/mongo/db/s/sharding", + ], + LIBDEPS_TAGS=[ + # Depends on files from serverOnlyFiles, and has many other + # missing dependencies. + 'incomplete', + ] ) # Shared mongod/mongos query code. @@ -146,6 +153,10 @@ env.Library( '$BUILD_DIR/mongo/db/exec/exec', '$BUILD_DIR/mongo/db/exec/working_set', ], + LIBDEPS_TAGS=[ + # Circular with the 'query' library in this directory + 'incomplete', + ], ) env.Library( diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript index 8cdcaefadc8..7aa851ce40a 100644 --- a/src/mongo/db/repl/SConscript +++ b/src/mongo/db/repl/SConscript @@ -21,9 +21,14 @@ env.Library( '$BUILD_DIR/mongo/executor/network_interface_factory', '$BUILD_DIR/mongo/executor/task_executor_interface', '$BUILD_DIR/mongo/executor/thread_pool_task_executor', + '$BUILD_DIR/mongo/db/repl/repl_coordinator_global', '$BUILD_DIR/mongo/util/concurrency/thread_pool', '$BUILD_DIR/mongo/util/fail_point', ], + LIBDEPS_TAGS=[ + # Depends on files from serverOnlyFiles + 'incomplete', + ], ) env.Library('repl_settings', @@ -106,6 +111,10 @@ env.Library( '$BUILD_DIR/mongo/db/query/internal_plans', '$BUILD_DIR/mongo/db/query/query', ], + LIBDEPS_TAGS=[ + # Depends on files like db_raii.cpp from serverOnlyFiles + 'incomplete', + ], ) env.Library( @@ -139,6 +148,10 @@ env.Library( 'roll_back_local_operations', 'rollback_source_impl', ], + LIBDEPS_TAGS=[ + # Depends on files in serverOnlyFiles, and has other unresolved symbols. + 'incomplete', + ] ) env.CppUnitTest( @@ -167,6 +180,11 @@ env.Library( '$BUILD_DIR/mongo/client/clientdriver', 'oplog_interface_remote', ], + LIBDEPS_TAGS=[ + # Depends on symbols that are not in a library, only in the serverOnlyFiles list. + 'incomplete' + ], + ) env.Library( @@ -182,6 +200,10 @@ env.Library( '$BUILD_DIR/mongo/util/concurrency/thread_pool', 'repl_coordinator_global', ], + LIBDEPS_TAGS=[ + # Many undefined symbols in sync_tail.cpp + 'incomplete' + ] ) env.CppUnitTest( @@ -443,7 +465,14 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base', + '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/coredb', + '$BUILD_DIR/mongo/db/repl/repl_coordinator_global', + 'replica_set_messages', + ], + LIBDEPS_TAGS=[ + # Depends on files in serverOnlyFiles + 'incomplete', ], ) @@ -596,7 +625,12 @@ env.Library(target='optime', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', - ]) + ], + LIBDEPS_TAGS=[ + # Circular with bson_extract library + 'incomplete', + ], +) env.Library( target='applier', diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript index a5f924738c5..452f7bd2943 100644 --- a/src/mongo/db/s/SConscript +++ b/src/mongo/db/s/SConscript @@ -32,7 +32,12 @@ env.Library( '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/s/sharding_initialization', - ] + ], + LIBDEPS_TAGS=[ + # Depends on symbols defined in files in serverOnlyFiles, and has + # many other missing dependencies. + 'incomplete', + ], ) env.Library( @@ -42,6 +47,8 @@ env.Library( 'set_shard_version_command.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/db/repl/repl_coordinator_global', + '$BUILD_DIR/mongo/s/serveronly', 'metadata', 'sharding', ] diff --git a/src/mongo/db/storage/SConscript b/src/mongo/db/storage/SConscript index ee4e8ae3198..a0abe218dbc 100644 --- a/src/mongo/db/storage/SConscript +++ b/src/mongo/db/storage/SConscript @@ -88,6 +88,11 @@ env.Library( '$BUILD_DIR/mongo/unittest/unittest', 'index_entry_comparison', ], + LIBDEPS_TAGS=[ + # Depends on newHarnessHelper, which does not have a unique definition + 'incomplete', + ], + ) env.Library( @@ -114,7 +119,11 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/unittest/unittest', '$BUILD_DIR/mongo/db/service_context', - ] + ], + LIBDEPS_TAGS=[ + # Depends on newHarnessHelper, which does not have a unique definition + 'incomplete', + ], ) env.Library( diff --git a/src/mongo/db/storage/kv/SConscript b/src/mongo/db/storage/kv/SConscript index 15635a09912..436c0151294 100644 --- a/src/mongo/db/storage/kv/SConscript +++ b/src/mongo/db/storage/kv/SConscript @@ -11,7 +11,12 @@ env.Library( '$BUILD_DIR/mongo/db/index/index_descriptor', '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/db/storage/bson_collection_catalog_entry', - ] + ], + LIBDEPS_TAGS=[ + # Depends on KVDatabaseCatalogEntry::getIndex, which does not have + # a unique definition. + 'incomplete', + ], ) # Should not be referenced outside this SConscript file. @@ -23,6 +28,10 @@ env.Library( '$BUILD_DIR/mongo/db/storage/bson_collection_catalog_entry', '$BUILD_DIR/mongo/db/storage/kv/kv_engine_core', ], + LIBDEPS_TAGS=[ + # Depends on KVDatabaseCatalogEntry::getIndex, which is not uniquely defined + 'incomplete', + ], ) # Should not be referenced outside this SConscript file. @@ -47,7 +56,11 @@ env.Library( 'kv_database_catalog_entry_core', 'kv_engine_core', 'kv_storage_engine', - ] + ], + LIBDEPS_TAGS=[ + # Depends on symbols from serverOnlyFiles + 'incomplete', + ], ) # Stubs out KVDatabaseCatalogEntry::getIndex() for testing. @@ -73,7 +86,12 @@ env.Library( '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/unittest/unittest', 'kv_engine_core', - ] + ], + LIBDEPS_TAGS=[ + # Depends on KVHarnessHelper::create which does not have a unique definition + 'incomplete', + ], + ) env.CppUnitTest( diff --git a/src/mongo/db/storage/mmap_v1/SConscript b/src/mongo/db/storage/mmap_v1/SConscript index d12321d6e15..ac16e926fa5 100644 --- a/src/mongo/db/storage/mmap_v1/SConscript +++ b/src/mongo/db/storage/mmap_v1/SConscript @@ -38,7 +38,11 @@ env.Library( 'compress', '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/storage/paths', - ] + ], + LIBDEPS_TAGS=[ + # Many undefined symbols + 'incomplete', + ], ) compressEnv = env.Clone() diff --git a/src/mongo/db/storage/wiredtiger/SConscript b/src/mongo/db/storage/wiredtiger/SConscript index 92f8f59258d..417221771bc 100644 --- a/src/mongo/db/storage/wiredtiger/SConscript +++ b/src/mongo/db/storage/wiredtiger/SConscript @@ -39,6 +39,11 @@ if wiredtiger: '$BUILD_DIR/third_party/shim_snappy', '$BUILD_DIR/third_party/shim_zlib', ], + LIBDEPS_TAGS=[ + # References WiredTigerKVEngine::initRsOplogBackgroundThread which does not have + # a unique definition. + 'incomplete', + ], ) wtEnv.Library( @@ -52,7 +57,13 @@ if wiredtiger: ], LIBDEPS=['storage_wiredtiger_core', '$BUILD_DIR/mongo/db/storage/kv/kv_engine', - ] + '$BUILD_DIR/mongo/db/storage/storage_engine_lock_file', + '$BUILD_DIR/mongo/db/storage/storage_engine_metadata', + ], + LIBDEPS_TAGS=[ + # Depends on symbols defined in serverOnlyfiles + 'incomplete', + ], ) wtEnv.Library( diff --git a/src/mongo/dbtests/SConscript b/src/mongo/dbtests/SConscript index dee82d6304d..f0e04da5cce 100644 --- a/src/mongo/dbtests/SConscript +++ b/src/mongo/dbtests/SConscript @@ -12,6 +12,12 @@ env.Library( '$BUILD_DIR/mongo/util/options_parser/options_parser_init', '$BUILD_DIR/mongo/unittest/unittest', ], + LIBDEPS_TAGS=[ + # Depends on default_test_dbpath from dbtests.cpp, and on + # storageGlobalParams from storage_options.cpp in + # serverOnlyFiles. + 'incomplete', + ], ) env.Library( @@ -21,9 +27,15 @@ env.Library( 'framework_options_init.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/s/coreshard', + '$BUILD_DIR/mongo/db/s/sharding', '$BUILD_DIR/mongo/unittest/unittest', 'framework_options', ], + LIBDEPS_TAGS=[ + # Depends on exitCleanly + 'incomplete', + ], ) env.Library( diff --git a/src/mongo/rpc/SConscript b/src/mongo/rpc/SConscript index 3b29ec5b00c..075fa5a3eca 100644 --- a/src/mongo/rpc/SConscript +++ b/src/mongo/rpc/SConscript @@ -25,6 +25,10 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/base', ], + LIBDEPS_TAGS=[ + # Depends on validation in a strange way right now + 'incomplete' + ], ) env.Library( @@ -72,6 +76,10 @@ env.Library( 'document_range', '$BUILD_DIR/mongo/util/net/network', ], + LIBDEPS_TAGS=[ + # Circular with rpc because it needs object_check.cpp + 'incomplete' + ], ) env.Library( @@ -103,6 +111,10 @@ env.Library( 'document_range', '$BUILD_DIR/mongo/util/net/network', ], + LIBDEPS_TAGS=[ + # Circular with rpc because it needs object_check.cpp + 'incomplete' + ], ) env.Library( diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript index 669586a8b4d..8de255b7b2d 100644 --- a/src/mongo/s/SConscript +++ b/src/mongo/s/SConscript @@ -22,6 +22,8 @@ env.Library( '$BUILD_DIR/mongo/executor/network_interface_factory', '$BUILD_DIR/mongo/executor/thread_pool_task_executor', '$BUILD_DIR/mongo/s/catalog/forwarding_catalog_manager', + 'client/sharding_connection_hook', + 'coreshard', ] ) @@ -100,6 +102,10 @@ env.Library( 'write_ops/cluster_write_op_conversion', '$BUILD_DIR/mongo/base', ], + LIBDEPS_TAGS=[ + # Circular with coreshard, below + 'incomplete', + ], ) env.CppUnitTest( @@ -130,6 +136,7 @@ env.Library( 'version_manager.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/db/coredb', '$BUILD_DIR/mongo/s/query/cluster_cursor_manager', 'catalog/forwarding_catalog_manager', 'catalog/catalog_types', @@ -137,7 +144,10 @@ env.Library( 'cluster_ops_impl', 'common', 'shard_util', - ] + ], + LIBDEPS_TAGS=[ + 'incomplete', + ], ) # This library is only used by the mongos execuable and any tests which require mongos runtime @@ -162,7 +172,11 @@ env.Library( '$BUILD_DIR/mongo/util/concurrency/task', 'write_ops/cluster_write_op', 'write_ops/cluster_write_op_conversion', - ] + ], + LIBDEPS_TAGS=[ + # Depends on inShutdown + 'incomplete', + ], ) env.CppUnitTest( @@ -189,6 +203,16 @@ env.Library( "distlock_test.cpp", ], LIBDEPS=[ - "$BUILD_DIR/mongo/executor/network_interface_factory" + "$BUILD_DIR/mongo/db/concurrency/lock_manager", + "$BUILD_DIR/mongo/db/query/query", + "$BUILD_DIR/mongo/db/range_deleter", + "$BUILD_DIR/mongo/db/s/metadata", + "$BUILD_DIR/mongo/db/s/sharding", + "$BUILD_DIR/mongo/executor/network_interface_factory", + "coreshard", + ], + LIBDEPS_TAGS=[ + # Depends on symbols from files in serverOnlyFiles + 'incomplete', ], ) diff --git a/src/mongo/s/catalog/SConscript b/src/mongo/s/catalog/SConscript index 88540276f5b..99fc1cb47af 100644 --- a/src/mongo/s/catalog/SConscript +++ b/src/mongo/s/catalog/SConscript @@ -53,11 +53,17 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/common', + '$BUILD_DIR/mongo/s/write_ops/batch_write_types', + '$BUILD_DIR/mongo/s/common', '$BUILD_DIR/mongo/s/catalog/catalog_types', '$BUILD_DIR/mongo/s/client/sharding_client', '$BUILD_DIR/mongo/s/shard_util', - '$BUILD_DIR/mongo/s/write_ops/batch_write_types', - ] + 'dist_lock_manager', + ], + LIBDEPS_TAGS=[ + # Circular with coreshard for mongo::grid and mongo::DBConfig. + 'incomplete', + ], ) env.Library( @@ -151,6 +157,7 @@ env.Library( '$BUILD_DIR/mongo/db/repl/read_concern_args', '$BUILD_DIR/mongo/rpc/command_status', '$BUILD_DIR/mongo/s/client/sharding_client', + '$BUILD_DIR/mongo/s/write_ops/batch_write_types', '$BUILD_DIR/mongo/util/net/hostandport', 'dist_lock_catalog_interface', ], diff --git a/src/mongo/s/catalog/legacy/SConscript b/src/mongo/s/catalog/legacy/SConscript index d805a6fd08c..01f04d22bf1 100644 --- a/src/mongo/s/catalog/legacy/SConscript +++ b/src/mongo/s/catalog/legacy/SConscript @@ -17,5 +17,9 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/s/catalog/catalog_manager', '$BUILD_DIR/mongo/s/catalog/dist_lock_manager', - ] + ], + LIBDEPS_TAGS=[ + # Depends on inShutdown + 'incomplete', + ], ) diff --git a/src/mongo/s/catalog/replset/SConscript b/src/mongo/s/catalog/replset/SConscript index df2e6037af6..d4e7e560a71 100644 --- a/src/mongo/s/catalog/replset/SConscript +++ b/src/mongo/s/catalog/replset/SConscript @@ -39,7 +39,11 @@ env.Library( '$BUILD_DIR/mongo/s/catalog/catalog_manager', '$BUILD_DIR/mongo/s/catalog/dist_lock_manager', '$BUILD_DIR/mongo/s/client/sharding_client', - ] + ], + LIBDEPS_TAGS=[ + # Depends on coreshard, but that would be circular + 'incomplete', + ], ) env.CppUnitTest( diff --git a/src/mongo/s/client/SConscript b/src/mongo/s/client/SConscript index c001ee25f9d..132045ffa48 100644 --- a/src/mongo/s/client/SConscript +++ b/src/mongo/s/client/SConscript @@ -16,7 +16,13 @@ env.Library( '$BUILD_DIR/mongo/client/remote_command_runner_impl', '$BUILD_DIR/mongo/client/remote_command_targeter', '$BUILD_DIR/mongo/rpc/metadata', - ] + ], + LIBDEPS_TAGS=[ + # Circular with both coreshard and coredb! Also relies on some + # symbols like usingAShardConnection that are not uniquely + # defined. + 'incomplete', + ], ) env.Library( @@ -30,7 +36,11 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/client/clientdriver', '$BUILD_DIR/mongo/s/coreshard', - ] + ], + LIBDEPS_TAGS=[ + # Depends on saveGLEStats, which is not uniquely defined + 'incomplete', + ], ) env.CppUnitTest( diff --git a/src/mongo/s/commands/SConscript b/src/mongo/s/commands/SConscript index a245dcfa34a..22ce62ed0a0 100644 --- a/src/mongo/s/commands/SConscript +++ b/src/mongo/s/commands/SConscript @@ -9,7 +9,9 @@ env.Library( 'cluster_get_shard_map_cmd.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/db/coredb', '$BUILD_DIR/mongo/s/client/sharding_client', + '$BUILD_DIR/mongo/s/coreshard', ] ) @@ -62,7 +64,10 @@ env.Library( 'run_on_all_shards_cmd.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/client/parallel', '$BUILD_DIR/mongo/db/pipeline/pipeline', - '$BUILD_DIR/mongo/db/commands/killcursors_common' + '$BUILD_DIR/mongo/db/commands/killcursors_common', + '$BUILD_DIR/mongo/s/coreshard', + '$BUILD_DIR/mongo/s/mongoscore', ] ) diff --git a/src/mongo/scripting/SConscript b/src/mongo/scripting/SConscript index e6bc59b5464..71416337fd0 100644 --- a/src/mongo/scripting/SConscript +++ b/src/mongo/scripting/SConscript @@ -19,6 +19,11 @@ env.Library( '$BUILD_DIR/mongo/util/foundation', '$BUILD_DIR/mongo/util/md5', ], + LIBDEPS_TAGS=[ + # Depends on mongo::createDirectClient, which is not uniquely defined + 'incomplete' + ], + ) env.Library( @@ -136,6 +141,11 @@ if usemozjs: '$BUILD_DIR/mongo/shell/mongojs', '$BUILD_DIR/mongo/db/service_context', ], + LIBDEPS_TAGS=[ + # Depends on haveLocalShardingInfo and createDirectClient, which are not + # uniquely defined. + 'incomplete', + ], ) else: env.Library( diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript index b932c45a325..01f6ea3ed1b 100644 --- a/src/mongo/util/SConscript +++ b/src/mongo/util/SConscript @@ -216,6 +216,9 @@ env.Library( 'concurrency/spin_lock', 'foundation', ], + LIBDEPS_TAGS=[ + 'incomplete' + ], ) env.CppUnitTest( @@ -368,6 +371,10 @@ env.Library( "$BUILD_DIR/mongo/db/service_context", "$BUILD_DIR/mongo/db/server_options_core", ], + LIBDEPS_TAGS=[ + # Depends on logProcessDetailsForLogRotate and exitCleanly + 'incomplete', + ] ) env.CppUnitTest( diff --git a/src/mongo/util/concurrency/SConscript b/src/mongo/util/concurrency/SConscript index c040a4c8bb2..cfa528d7b93 100644 --- a/src/mongo/util/concurrency/SConscript +++ b/src/mongo/util/concurrency/SConscript @@ -59,6 +59,10 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/util/background_job', ], + LIBDEPS_TAGS=[ + # Depends on inShutdown + 'incomplete', + ], ) env.Library( diff --git a/src/mongo/util/net/SConscript b/src/mongo/util/net/SConscript index f9f4d8d4daa..dfdeca9c352 100644 --- a/src/mongo/util/net/SConscript +++ b/src/mongo/util/net/SConscript @@ -44,6 +44,10 @@ env.Library( '$BUILD_DIR/mongo/util/options_parser/options_parser', 'hostandport', ], + LIBDEPS_TAGS=[ + # Depends on inShutdown + 'incomplete', + ], ) env.Library( @@ -76,6 +80,10 @@ env.Library( 'network', '$BUILD_DIR/mongo/db/stats/counters', ], + LIBDEPS_TAGS=[ + # Depends on inShutdown and dbexit + 'incomplete', + ], ) env.Library( diff --git a/src/third_party/mozjs-38/SConscript b/src/third_party/mozjs-38/SConscript index c94ee2fec48..32509fa4a2f 100644 --- a/src/third_party/mozjs-38/SConscript +++ b/src/third_party/mozjs-38/SConscript @@ -92,4 +92,11 @@ sources.extend(Glob('platform/' + env["TARGET_ARCH"] + "/" + env["TARGET_OS"] + # All of those unified sources come in from configure. The files don't # actually build individually anymore. -env.Library( "mozjs", sources ) +env.Library( + target="mozjs", + source=sources, + LIBDEPS_TAGS=[ + # Depends on allocation symbols defined elsewhere + 'incomplete' + ], +) |