Add ensure_gn_version.py and DEPS hook.

In r641353, I switched from using download_from_google_storage to download
GN binaries to using CIPD. Unfortunately, I chose to install the binary
into the same location we were using previously, which, while convenient,
meant that we might hit cases where someone would sync back to a pre-cipd
version of the checkout, run the old hook to download an old version of
GN, and then sync back to tip-of-tree, and CIPD wouldn't know that the
binary got clobbered. This could lead to really weird errors.

This CL adds a hook to DEPS to check that have the right version of GN,
and, if not, forcibly download and install it again. In the common case,
the hook should be very fast. Ultimately we want to modify CIPD to
actually validate that the files it thinks are installed are in fact right.

Bug: 944367
Change-Id: I86d3eeaf9ef232e4d472d36db54a40458702078e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1534554
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#643568}
2 files changed