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 """Windows can't run .sh files, so this is a Python implementation of | 6 """This script is used to download prebuilt clang binaries. |
7 update.sh. This script should replace update.sh on all platforms eventually.""" | 7 |
| 8 It is also used by package.py to build the prebuilt clang binaries.""" |
8 | 9 |
9 import argparse | 10 import argparse |
10 import cStringIO | 11 import cStringIO |
11 import distutils.spawn | 12 import distutils.spawn |
12 import glob | 13 import glob |
13 import os | 14 import os |
14 import pipes | 15 import pipes |
15 import re | 16 import re |
16 import shutil | 17 import shutil |
17 import subprocess | 18 import subprocess |
18 import stat | 19 import stat |
19 import sys | 20 import sys |
20 import tarfile | 21 import tarfile |
21 import tempfile | 22 import tempfile |
22 import time | 23 import time |
23 import urllib2 | 24 import urllib2 |
24 import zipfile | 25 import zipfile |
25 | 26 |
26 # Do NOT CHANGE this if you don't know what you're doing -- see | 27 # Do NOT CHANGE this if you don't know what you're doing -- see |
27 # https://code.google.com/p/chromium/wiki/UpdatingClang | 28 # https://code.google.com/p/chromium/wiki/UpdatingClang |
28 # Reverting problematic clang rolls is safe, though. | 29 # Reverting problematic clang rolls is safe, though. |
29 # Note: this revision is only used for Windows. Other platforms use update.sh. | |
30 CLANG_REVISION = '254049' | 30 CLANG_REVISION = '254049' |
31 | 31 |
32 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ | 32 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ |
33 if use_head_revision: | 33 if use_head_revision: |
34 CLANG_REVISION = 'HEAD' | 34 CLANG_REVISION = 'HEAD' |
35 | 35 |
36 # This is incremented when pushing a new build of Clang at the same revision. | 36 # This is incremented when pushing a new build of Clang at the same revision. |
37 CLANG_SUB_REVISION=1 | 37 CLANG_SUB_REVISION=1 |
38 | 38 |
39 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION) | 39 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION) |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 args.force_local_build = True | 776 args.force_local_build = True |
777 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 777 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
778 # Only build the Android ASan rt on ToT bots when targetting Android. | 778 # Only build the Android ASan rt on ToT bots when targetting Android. |
779 args.with_android = False | 779 args.with_android = False |
780 | 780 |
781 return UpdateClang(args) | 781 return UpdateClang(args) |
782 | 782 |
783 | 783 |
784 if __name__ == '__main__': | 784 if __name__ == '__main__': |
785 sys.exit(main()) | 785 sys.exit(main()) |
OLD | NEW |