diff options
author | Mathew Robinson <chasinglogic@gmail.com> | 2020-01-06 15:47:18 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-13 15:21:41 +0000 |
commit | 12b63497b80c46f31cb1ece3a23887e50a129504 (patch) | |
tree | 449a7f9bea146eadeceb6a00c2a39eda27577fa1 /SConstruct | |
parent | f31bc89f66632b2d521be2d076dc23f94ff663eb (diff) | |
download | mongo-12b63497b80c46f31cb1ece3a23887e50a129504.tar.gz |
SERVER-45301 Not all expected aliases are present in the ninja generator output
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 93 |
1 files changed, 46 insertions, 47 deletions
diff --git a/SConstruct b/SConstruct index 7331ef04e42..6d00e2799a5 100644 --- a/SConstruct +++ b/SConstruct @@ -3755,33 +3755,6 @@ env["NINJA_SYNTAX"] = "#site_scons/third_party/ninja_syntax.py" env.Tool('ccache') env.Tool('icecream') -resmoke_config = env.Substfile( - target="#resmoke.ini", - source="buildscripts/resmoke.ini.in", - SUBST_DICT={ - "@install_dir@": "$PREFIX_BINDIR" if get_option("install-mode") == "hygienic" else env.Dir("#").abspath, - } -) - -# Substfile does a poor job of detecting if it needs to rebuild a -# file. Since this file is cheap to generate we make it always build -# because it's better to spend the < 1 second generating it than -# having a developer waste time debugging why they're running the -# wrong binaries from Resmoke. -# -# This doesn't make this file always generate, it only generates if -# the below Depends wiring have changed. Basically it skips SCons' -# Deciders -env.AlwaysBuild(resmoke_config) -if get_option("install-mode") == "hygienic": - # We only need to change the config if PREFIX_BINDIR has changed - # since Resmoke's installDir flag points here. - env.Depends(env.Dir("$PREFIX_BINDIR"), resmoke_config) -else: - # This depends really isn't true but it's the only reliable way - # for non-hygienic builds to make sure this file is made. - env.Depends(env.Dir("$BUILD_DIR"), resmoke_config) - if get_option('ninja') == 'true': ninja_builder = Tool("ninja") ninja_builder.generate(env) @@ -3804,7 +3777,6 @@ if get_option('ninja') == 'true': source=[ env.Alias("install-all-meta"), env.Alias("test-execution-aliases"), - resmoke_config, ], ) else: @@ -3813,7 +3785,6 @@ if get_option('ninja') == 'true': source=[ env.Alias("all"), env.Alias("test-execution-aliases"), - resmoke_config, ], ) @@ -3862,7 +3833,7 @@ if get_option('ninja') == 'true': def ninja_test_list_builder(env, node): - test_files = env["MONGO_TEST_REGISTRY"][node.path] + test_files = [test_file.path for test_file in env["MONGO_TEST_REGISTRY"][node.path]] files = "\\n".join(test_files) return { "outputs": node.get_path(), @@ -3889,8 +3860,14 @@ if get_option('install-mode') == 'hygienic': if get_option('separate-debug') == "on" or env.TargetOSIs("windows"): env.Tool('separate_debug') - env["AIB_TARBALL_SUFFIX"] = "tgz" + env["AUTO_ARCHIVE_TARBALL_SUFFIX"] = "tgz" + + env["AIB_META_COMPONENT"] = "all" + env["AIB_BASE_COMPONENT"] = "common" + env["AIB_DEFAULT_COMPONENT"] = "mongodb" + env.Tool('auto_install_binaries') + env.Tool('auto_archive') env.DeclareRoles( roles=[ @@ -3922,7 +3899,6 @@ if get_option('install-mode') == 'hygienic': # runtime package. "debug" if env.TargetOSIs('windows') else None, ], - transitive=True, silent=True, ), ], @@ -3946,39 +3922,29 @@ if get_option('install-mode') == 'hygienic': env.AddSuffixMapping({ "$PROGSUFFIX": env.SuffixMap( directory="$PREFIX_BINDIR", - default_roles=[ - "runtime", - ] + default_role="runtime", ), "$SHLIBSUFFIX": env.SuffixMap( directory="$PREFIX_BINDIR" \ if mongo_platform.get_running_os_name() == "windows" \ else "$PREFIX_LIBDIR", - default_roles=[ - "runtime", - ] + default_role="runtime", ), ".debug": env.SuffixMap( directory="$PREFIX_DEBUGDIR", - default_roles=[ - "debug", - ] + default_role="debug", ), ".dSYM": env.SuffixMap( directory="$PREFIX_DEBUGDIR", - default_roles=[ - "debug" - ] + default_role="debug", ), ".pdb": env.SuffixMap( directory="$PREFIX_DEBUGDIR", - default_roles=[ - "debug" - ] + default_role="debug", ), }) @@ -4436,6 +4402,39 @@ if has_option("cache"): addNoCacheEmitter(env['BUILDERS']['LoadableModule']) +resmoke_install_dir = env.subst("$PREFIX_BINDIR") if get_option("install-mode") == "hygienic" else env.Dir("#").abspath +resmoke_install_dir = os.path.normpath(resmoke_install_dir).replace("\\", r"\\") +resmoke_config = env.Substfile( + target="#resmoke.ini", + source="#buildscripts/resmoke.ini.in", + SUBST_DICT={ + "@install_dir@": resmoke_install_dir, + } +) + +# Self-testable installs (PM-1691) will make this unnecessary because we will be +# installing resmoke (i.e. it will have it's own component and role) and it will +# be able to detect where the binaries are. For now we need to generate this +# config file to tell resmoke how to find mongod. +def resmoke_config_scanner(old_scanner): + cfg_file = resmoke_config[0] + + def new_scanner(node, env, path=()): + result = old_scanner.function(node, env, path) + result.append(cfg_file) + return result + + return new_scanner + + +program_builder = env["BUILDERS"]["Program"] +program_builder.target_scanner = SCons.Scanner.Scanner( + function=resmoke_config_scanner(program_builder.target_scanner), + path_function=program_builder.target_scanner.path_function, +) + + + env.SConscript( dirs=[ 'src', |