diff options
author | Andrew Morrow <acm@mongodb.com> | 2020-05-21 09:05:22 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-26 17:52:59 +0000 |
commit | b79b53f55a5c148fd297b81a45c08d08e2cf8f94 (patch) | |
tree | a2d485cd67a77eb5c200a10ca703f806f6f81403 | |
parent | 29f8ca9ec2fef177f98928ee4c1ec6168db5cf87 (diff) | |
download | mongo-r4.4.0-rc7.tar.gz |
SERVER-48348 Do not sort dwo files in ahead of object files during Ninja generationr4.4.0-rc7
(cherry picked from commit 18cbf0d581162b2d15d66577b1fe08fe22006699)
-rw-r--r-- | site_scons/site_tools/ninja_next.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/site_scons/site_tools/ninja_next.py b/site_scons/site_tools/ninja_next.py index 7cdfb9d98af..38a065cf65b 100644 --- a/site_scons/site_tools/ninja_next.py +++ b/site_scons/site_tools/ninja_next.py @@ -641,7 +641,16 @@ class NinjaState: # use for the "real" builder and multiple phony targets that # match the file names of the remaining outputs. This way any # build can depend on any output from any build. - build["outputs"].sort() + # + # We assume that the first listed output is the 'key' + # output and is stably presented to us by SCons. For + # instance if -gsplit-dwarf is in play and we are + # producing foo.o and foo.dwo, we expect that outputs[0] + # from SCons will be the foo.o file and not the dwo + # file. If instead we just sorted the whole outputs array, + # we would find that the dwo file becomes the + # first_output, and this breaks, for instance, header + # dependency scanning. if rule is not None and (rule.get("deps") or rule.get("rspfile")): first_output, remaining_outputs = ( build["outputs"][0], @@ -650,7 +659,7 @@ class NinjaState: if remaining_outputs: ninja.build( - outputs=remaining_outputs, rule="phony", implicit=first_output, + outputs=sorted(remaining_outputs), rule="phony", implicit=first_output, ) build["outputs"] = first_output |