gn: Make generation of main build.ninja file deterministic.

Follow-up to https://codereview.chromium.org/1494883002/ which either missed
the main build.ninja file, or build.ninja file writing has since gotten
nondetermistic again.

Fixes three cases of nondeterminism in build.ninja:
* Order of pools
* Order of subninjas for each toolchain
* Order of phony targets in build.ninja

BUG=662750,565075

Review-Url: https://codereview.chromium.org/2485523002
Cr-Original-Commit-Position: refs/heads/master@{#430416}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8c2865318628b91312ea2bfa065590e3dc4f920a
4 files changed
tree: 6cee46dc9b8db58333e4a1566f859fe75355d03c
  1. tools/