Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: tools/clang/scripts/update.py

Issue 1888883004: clang update.py: Make DIA backwards compatible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """This script is used to download prebuilt clang binaries. 6 """This script is used to download prebuilt clang binaries.
7 7
8 It is also used by package.py to build the prebuilt clang binaries.""" 8 It is also used by package.py to build the prebuilt clang binaries."""
9 9
10 import argparse 10 import argparse
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 CHROMIUM_DIR, 'third_party', 'android_tools', 'ndk') 75 CHROMIUM_DIR, 'third_party', 'android_tools', 'ndk')
76 76
77 # URL for pre-built binaries. 77 # URL for pre-built binaries.
78 CDS_URL = os.environ.get('CDS_CLANG_BUCKET_OVERRIDE', 78 CDS_URL = os.environ.get('CDS_CLANG_BUCKET_OVERRIDE',
79 'https://commondatastorage.googleapis.com/chromium-browser-clang') 79 'https://commondatastorage.googleapis.com/chromium-browser-clang')
80 80
81 LLVM_REPO_URL='https://llvm.org/svn/llvm-project' 81 LLVM_REPO_URL='https://llvm.org/svn/llvm-project'
82 if 'LLVM_REPO_URL' in os.environ: 82 if 'LLVM_REPO_URL' in os.environ:
83 LLVM_REPO_URL = os.environ['LLVM_REPO_URL'] 83 LLVM_REPO_URL = os.environ['LLVM_REPO_URL']
84 84
85 # Bump after VC updates.
86 DIA_DLL = {
87 '2013': 'msdia120.dll',
88 '2015': 'msdia140.dll',
89 }
90
85 91
86 def DownloadUrl(url, output_file): 92 def DownloadUrl(url, output_file):
87 """Download url into output_file.""" 93 """Download url into output_file."""
88 CHUNK_SIZE = 4096 94 CHUNK_SIZE = 4096
89 TOTAL_DOTS = 10 95 TOTAL_DOTS = 10
90 num_retries = 3 96 num_retries = 3
91 retry_wait_s = 5 # Doubled at each retry. 97 retry_wait_s = 5 # Doubled at each retry.
92 98
93 while True: 99 while True:
94 try: 100 try:
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 sys.path.append(os.path.join(CHROMIUM_DIR, 'tools', 'gyp', 'pylib')) 353 sys.path.append(os.path.join(CHROMIUM_DIR, 'tools', 'gyp', 'pylib'))
348 import gyp.MSVSVersion 354 import gyp.MSVSVersion
349 vs_version = gyp.MSVSVersion.SelectVisualStudioVersion( 355 vs_version = gyp.MSVSVersion.SelectVisualStudioVersion(
350 vs_toolchain.GetVisualStudioVersion()) 356 vs_toolchain.GetVisualStudioVersion())
351 return vs_version 357 return vs_version
352 358
353 359
354 def CopyDiaDllTo(target_dir): 360 def CopyDiaDllTo(target_dir):
355 # This script always wants to use the 64-bit msdia*.dll. 361 # This script always wants to use the 64-bit msdia*.dll.
356 dia_path = os.path.join(GetVSVersion().Path(), 'DIA SDK', 'bin', 'amd64') 362 dia_path = os.path.join(GetVSVersion().Path(), 'DIA SDK', 'bin', 'amd64')
357 dia_dll = os.path.join(dia_path, 'msdia140.dll') # Bump after VC updates. 363 dia_dll = os.path.join(dia_path, DIA_DLL[GetVSVersion().ShortName()])
358 CopyFile(dia_dll, target_dir) 364 CopyFile(dia_dll, target_dir)
359 365
360 366
361 def UpdateClang(args): 367 def UpdateClang(args):
362 print 'Updating Clang to %s...' % PACKAGE_VERSION 368 print 'Updating Clang to %s...' % PACKAGE_VERSION
363 369
364 need_gold_plugin = 'LLVM_DOWNLOAD_GOLD_PLUGIN' in os.environ or ( 370 need_gold_plugin = 'LLVM_DOWNLOAD_GOLD_PLUGIN' in os.environ or (
365 sys.platform.startswith('linux') and 371 sys.platform.startswith('linux') and
366 'buildtype=Official' in os.environ.get('GYP_DEFINES', '') and 372 'buildtype=Official' in os.environ.get('GYP_DEFINES', '') and
367 'branding=Chrome' in os.environ.get('GYP_DEFINES', '')) 373 'branding=Chrome' in os.environ.get('GYP_DEFINES', ''))
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 args.force_local_build = True 867 args.force_local_build = True
862 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): 868 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''):
863 # Only build the Android ASan rt on ToT bots when targetting Android. 869 # Only build the Android ASan rt on ToT bots when targetting Android.
864 args.with_android = False 870 args.with_android = False
865 871
866 return UpdateClang(args) 872 return UpdateClang(args)
867 873
868 874
869 if __name__ == '__main__': 875 if __name__ == '__main__':
870 sys.exit(main()) 876 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698