ninjabackend: stabilize order of dependencies and order-only dependencies

These do not go into the command line, and therefore do not matter
for the purpose of avoiding unnecessary rebuilds after meson is
rerun.  However, they complicate the task of finding differences
between build lines across meson reruns.

So take the easy way out and sort everything after | and ||.
With this change, there is absolutely no change in QEMU's 40000-line
build.ninja file after meson is rerun.
pull/7900/head
Paolo Bonzini 4 years ago
parent 4caa0577ec
commit 0b2865e8b9
  1. 4
      mesonbuild/backend/ninjabackend.py

@ -359,9 +359,9 @@ class NinjaBuildElement:
rulename = self.rulename rulename = self.rulename
line = 'build {}{}: {} {}'.format(outs, implicit_outs, rulename, ins) line = 'build {}{}: {} {}'.format(outs, implicit_outs, rulename, ins)
if len(self.deps) > 0: if len(self.deps) > 0:
line += ' | ' + ' '.join([ninja_quote(x, True) for x in self.deps]) line += ' | ' + ' '.join([ninja_quote(x, True) for x in sorted(self.deps)])
if len(self.orderdeps) > 0: if len(self.orderdeps) > 0:
line += ' || ' + ' '.join([ninja_quote(x, True) for x in self.orderdeps]) line += ' || ' + ' '.join([ninja_quote(x, True) for x in sorted(self.orderdeps)])
line += '\n' line += '\n'
# This is the only way I could find to make this work on all # This is the only way I could find to make this work on all
# platforms including Windows command shell. Slash is a dir separator # platforms including Windows command shell. Slash is a dir separator

Loading…
Cancel
Save