diff options
author | Andrew Morrow <acm@mongodb.com> | 2020-04-24 07:07:08 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-29 13:17:45 +0000 |
commit | e350287d6bf433c509884916ff5ca998efebaced (patch) | |
tree | 814ec36ec03768e03c4d0aa9a1e0d07fdaba6f34 /site_scons | |
parent | 009f88fe141f91ba693a6a32287809baf940b06e (diff) | |
download | mongo-e350287d6bf433c509884916ff5ca998efebaced.tar.gz |
SERVER-46519 Do not force a global rebuild on ninja regeneration
(cherry picked from commit dc116507128f70cc2399bf6656764313aa7d7333)
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/ninja_next.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/site_scons/site_tools/ninja_next.py b/site_scons/site_tools/ninja_next.py index ca733abf449..7cdfb9d98af 100644 --- a/site_scons/site_tools/ninja_next.py +++ b/site_scons/site_tools/ninja_next.py @@ -592,9 +592,8 @@ class NinjaState: template_builders.append(build) continue - implicit = build.get("implicit", []) - implicit.append(ninja_file) - build["implicit"] = sorted(implicit) + if "implicit" in build: + build["implicit"].sort() # Don't make generated sources depend on each other. We # have to check that none of the outputs are generated @@ -605,7 +604,7 @@ class NinjaState: generated_source_files and not build["rule"] == "INSTALL" and set(build["outputs"]).isdisjoint(generated_source_files) - and set(implicit).isdisjoint(generated_source_files) + and set(build.get("implicit", [])).isdisjoint(generated_source_files) ): # Make all non-generated source targets depend on @@ -696,13 +695,13 @@ class NinjaState: # jstests/SConscript and being specific to the MongoDB # repository layout. ninja.build( - ninja_file, + self.env.File(ninja_file).path, rule="REGENERATE", implicit=[ - self.env.File("#SConstruct").get_abspath(), - os.path.abspath(__file__), + self.env.File("#SConstruct").path, + __file__, ] - + glob("src/**/SConscript", recursive=True), + + sorted(glob("src/**/SConscript", recursive=True)), ) # If we ever change the name/s of the rules that include @@ -712,6 +711,7 @@ class NinjaState: "compile_commands.json", rule="CMD", pool="console", + implicit=[ninja_file], variables={ "cmd": "ninja -f {} -t compdb CC CXX > compile_commands.json".format( ninja_file |