Skip to content

Commit

Permalink
ninjabackend: stabilize order of dependencies and order-only dependen…
Browse files Browse the repository at this point in the history
…cies

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.
  • Loading branch information
bonzini committed Oct 26, 2020
1 parent 2d29f30 commit e1a55bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ def write(self, outfile):
rulename = self.rulename
line = 'build {}{}: {} {}'.format(outs, implicit_outs, rulename, ins)
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:
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'
# This is the only way I could find to make this work on all
# platforms including Windows command shell. Slash is a dir separator
Expand Down

0 comments on commit e1a55bb

Please sign in to comment.