Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 715 help='select which chrome tools to build', | 715 help='select which chrome tools to build', |
| 716 default=['plugins', 'blink_gc_plugin']) | 716 default=['plugins', 'blink_gc_plugin']) |
| 717 parser.add_argument('--without-android', action='store_false', | 717 parser.add_argument('--without-android', action='store_false', |
| 718 help='don\'t build Android ASan runtime (linux only)', | 718 help='don\'t build Android ASan runtime (linux only)', |
| 719 dest='with_android', | 719 dest='with_android', |
| 720 default=sys.platform.startswith('linux')) | 720 default=sys.platform.startswith('linux')) |
| 721 args = parser.parse_args() | 721 args = parser.parse_args() |
| 722 | 722 |
| 723 if args.if_needed: | 723 if args.if_needed: |
| 724 is_clang_required = False | 724 is_clang_required = False |
| 725 # We don't need to download the toolchain on upload bots during runhooks. | |
| 726 if 'LLVM_DOWNLOAD_NOT_NEEDED' in os.environ: | |
| 727 print ('Skipping downloading Clang toolchain binaries as ' | |
| 728 'LLVM_DOWNLOAD_NOT_NEEDED is found in the environment') | |
|
hans
2016/03/04 19:52:28
can we call it LLVM_FORCE_LOCAL_BUILD instead and
| |
| 729 return 0 | |
| 725 # clang is always used on Mac and Linux. | 730 # clang is always used on Mac and Linux. |
| 726 if sys.platform == 'darwin' or sys.platform.startswith('linux'): | 731 if sys.platform == 'darwin' or sys.platform.startswith('linux'): |
| 727 is_clang_required = True | 732 is_clang_required = True |
| 728 # clang requested via $GYP_DEFINES. | 733 # clang requested via $GYP_DEFINES. |
| 729 if re.search(r'\b(clang|asan|lsan|msan|tsan)=1', | 734 if re.search(r'\b(clang|asan|lsan|msan|tsan)=1', |
| 730 os.environ.get('GYP_DEFINES', '')): | 735 os.environ.get('GYP_DEFINES', '')): |
| 731 is_clang_required = True | 736 is_clang_required = True |
| 732 # clang previously downloaded, keep it up-to-date. | 737 # clang previously downloaded, keep it up-to-date. |
| 733 # If you don't want this, delete third_party/llvm-build on your machine. | 738 # If you don't want this, delete third_party/llvm-build on your machine. |
| 734 if os.path.isdir(LLVM_BUILD_DIR): | 739 if os.path.isdir(LLVM_BUILD_DIR): |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 765 args.force_local_build = True | 770 args.force_local_build = True |
| 766 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 771 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
| 767 # Only build the Android ASan rt on ToT bots when targetting Android. | 772 # Only build the Android ASan rt on ToT bots when targetting Android. |
| 768 args.with_android = False | 773 args.with_android = False |
| 769 | 774 |
| 770 return UpdateClang(args) | 775 return UpdateClang(args) |
| 771 | 776 |
| 772 | 777 |
| 773 if __name__ == '__main__': | 778 if __name__ == '__main__': |
| 774 sys.exit(main()) | 779 sys.exit(main()) |
| OLD | NEW |