Commit b19e8dff authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Add a --nodownload option to get_toolchain_if_necessary.py

The Windows toolchain should be downloaded during gclient runhooks,
however because get_toolchain_if_necessary.py can either configure an
existing toolchain or download a toolchain there have been problems when
the toolchain is downloaded at an unexpected point. In particular, a
toolchain download during gn gen can lead to parallel downloads and
configuration failures.

The --nodownload option will be passed (after a subsequent change) by
build\vs_toolchain.py. A --nodownload option is needed instead of a more
positive --allowdownload option because of backwards compatibility. This
change will have no effect until the build\vs_toolchain.py change is
landed.

Bug: 584393, 662325
Change-Id: I9a0950e066744c0310e49e45d001a9113f1831cf
Reviewed-on: https://chromium-review.googlesource.com/c/1439805
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: 's avatarScott Graham <scottmg@chromium.org>
parent bdb11237
......@@ -442,6 +442,8 @@ def main():
help='write information about toolchain to FILE')
parser.add_option('--force', action='store_true',
help='force script to run on non-Windows hosts')
parser.add_option('--no-download', action='store_true',
help='configure if present but don\'t download')
parser.add_option('--toolchain-dir',
default=os.getenv(ENV_TOOLCHAIN_ROOT, BASEDIR),
help='directory to install toolchain into')
......@@ -492,6 +494,10 @@ def main():
# based on timestamps to make that case fast.
current_hashes = CalculateToolchainHashes(target_dir, True)
if desired_hash not in current_hashes:
if options.no_download:
raise SystemExit('Toolchain is out of date. Run "gclient runhooks" to '
'update the toolchain, or set DEPOT_TOOLS_WIN_TOOLCHAIN=0'
'to use the locally installed toolchain.')
should_use_file = False
should_use_http = False
should_use_gs = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment