diff options
-rw-r--r-- | SConstruct | 14 | ||||
-rw-r--r-- | site_scons/site_tools/ninja_next.py | 17 |
2 files changed, 21 insertions, 10 deletions
diff --git a/SConstruct b/SConstruct index 580fd37f93d..c207d5c4602 100644 --- a/SConstruct +++ b/SConstruct @@ -3879,6 +3879,7 @@ if get_option('ninja') != 'disabled': else: ninja_builder = Tool("ninja_next") ninja_builder.generate(env) + env.Default(env.Alias("install-all-meta")) # idlc.py has the ability to print it's implicit dependencies # while generating, Ninja can consume these prints using the @@ -4242,10 +4243,8 @@ else: target="#lint-eslint", source=[ "buildscripts/eslint.py", - "jstests/", - "src/mongo/", ], - action="$PYTHON ${SOURCES[0]} --dirmode lint ${SOURCES[1:]}", + action="$PYTHON ${SOURCES[0]} --dirmode lint jstests/ src/mongo", ) lint_py = env.Command( @@ -4531,12 +4530,13 @@ env.SConscript( ) -allTargets = ['core', 'tools', 'unittests', 'integration_tests', 'libfuzzer_tests', 'benchmarks'] +if get_option("install-mode") != "hygienic": + allTargets = ['core', 'tools', 'unittests', 'integration_tests', 'libfuzzer_tests', 'benchmarks'] -if not has_option('noshell') and usemozjs: - allTargets.extend(['dbtest']) + if not has_option('noshell') and usemozjs: + allTargets.extend(['dbtest']) -env.Alias('all', allTargets) + env.Alias('all', allTargets) # run the Dagger tool if it's installed if should_dagger: diff --git a/site_scons/site_tools/ninja_next.py b/site_scons/site_tools/ninja_next.py index 89cae89d8ef..fe437b8738f 100644 --- a/site_scons/site_tools/ninja_next.py +++ b/site_scons/site_tools/ninja_next.py @@ -61,7 +61,11 @@ def _mkdir_action_function(env, node): return { "outputs": get_outputs(node), "rule": "CMD", - "implicit": get_dependencies(node), + # implicit explicitly omitted, we translate these so they can be + # used by anything that depends on these but commonly this is + # hit with a node that will depend on all of the fake + # srcnode's that SCons will never give us a rule for leading + # to an invalid ninja file. "variables": { # On Windows mkdir "-p" is always on "cmd": "{mkdir} $out".format( @@ -101,7 +105,13 @@ def is_valid_dependent_node(node): check because some nodes (like src files) won't have builders but are valid implicit dependencies. """ - return not isinstance(node, SCons.Node.Alias.Alias) or node.children() + if isinstance(node, SCons.Node.Alias.Alias): + return node.children() + + if not node.env: + return True + + return not node.env.get("NINJA_SKIP") def alias_to_ninja_build(node): @@ -110,7 +120,7 @@ def alias_to_ninja_build(node): "outputs": get_outputs(node), "rule": "phony", "implicit": [ - get_path(n) for n in node.children() if is_valid_dependent_node(n) + get_path(src_file(n)) for n in node.children() if is_valid_dependent_node(n) ], } @@ -506,6 +516,7 @@ class NinjaState: return False self.builds.append(build) + self.built.update(build["outputs"]) return True def is_generated_source(self, output): |