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

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

Issue 2748973003: Revert of Remove depenedency on GYP_DEFINES in clang gclient hook (Closed)
Patch Set: Created 3 years, 9 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 version_out = re.match(r'clang version ([0-9.]+)', version_out).group(1) 390 version_out = re.match(r'clang version ([0-9.]+)', version_out).group(1)
391 if version_out != VERSION: 391 if version_out != VERSION:
392 print ('unexpected clang version %s (not %s), update VERSION in update.py' 392 print ('unexpected clang version %s (not %s), update VERSION in update.py'
393 % (version_out, VERSION)) 393 % (version_out, VERSION))
394 sys.exit(1) 394 sys.exit(1)
395 395
396 396
397 def UpdateClang(args): 397 def UpdateClang(args):
398 print 'Updating Clang to %s...' % PACKAGE_VERSION 398 print 'Updating Clang to %s...' % PACKAGE_VERSION
399 399
400 # Required for LTO, which is used when is_official_build = true. 400 need_gold_plugin = 'LLVM_DOWNLOAD_GOLD_PLUGIN' in os.environ or (
401 need_gold_plugin = sys.platform.startswith('linux') 401 sys.platform.startswith('linux') and
402 'buildtype=Official' in os.environ.get('GYP_DEFINES', ''))
402 403
403 if ReadStampFile() == PACKAGE_VERSION and not args.force_local_build: 404 if ReadStampFile() == PACKAGE_VERSION and not args.force_local_build:
404 print 'Clang is already up to date.' 405 print 'Clang is already up to date.'
405 if not need_gold_plugin or os.path.exists( 406 if not need_gold_plugin or os.path.exists(
406 os.path.join(LLVM_BUILD_DIR, "lib/LLVMgold.so")): 407 os.path.join(LLVM_BUILD_DIR, "lib/LLVMgold.so")):
407 return 0 408 return 0
408 409
409 # Reset the stamp file in case the build is unsuccessful. 410 # Reset the stamp file in case the build is unsuccessful.
410 WriteStampFile('') 411 WriteStampFile('')
411 412
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 args.force_local_build = True 893 args.force_local_build = True
893 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): 894 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''):
894 # Only build the Android ASan rt on ToT bots when targetting Android. 895 # Only build the Android ASan rt on ToT bots when targetting Android.
895 args.with_android = False 896 args.with_android = False
896 897
897 return UpdateClang(args) 898 return UpdateClang(args)
898 899
899 900
900 if __name__ == '__main__': 901 if __name__ == '__main__':
901 sys.exit(main()) 902 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