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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 def WriteStampFile(s, path=STAMP_FILE): | 160 def WriteStampFile(s, path=STAMP_FILE): |
| 161 """Write s to the stamp file.""" | 161 """Write s to the stamp file.""" |
| 162 EnsureDirExists(os.path.dirname(path)) | 162 EnsureDirExists(os.path.dirname(path)) |
| 163 with open(path, 'w') as f: | 163 with open(path, 'w') as f: |
| 164 f.write(s) | 164 f.write(s) |
| 165 f.write('\n') | 165 f.write('\n') |
| 166 | 166 |
| 167 | 167 |
| 168 def GetSvnRevision(svn_repo): | 168 def GetSvnRevision(svn_repo): |
| 169 """Returns current revision of the svn repo at svn_repo.""" | 169 """Returns current revision of the svn repo at svn_repo.""" |
| 170 if sys.platform == 'darwin': | |
| 171 # mac_files toolchain must be set for hermetic builds. | |
| 172 root = os.path.dirname(os.path.dirname(os.path.dirname( | |
| 173 os.path.dirname(__file__)))) | |
| 174 sys.path.append(os.path.join(root, 'build')) | |
| 175 import mac_toolchain | |
| 176 | |
| 177 mac_toolchain.SetToolchainEnvironment() | |
|
justincohen
2016/10/13 18:09:09
Does this file not need --developer_dir anymore?
erikchen
2016/10/13 19:43:54
As I indicate in the commit message:
"""
svn is as
| |
| 178 svn_info = subprocess.check_output('svn info ' + svn_repo, shell=True) | 170 svn_info = subprocess.check_output('svn info ' + svn_repo, shell=True) |
| 179 m = re.search(r'Revision: (\d+)', svn_info) | 171 m = re.search(r'Revision: (\d+)', svn_info) |
| 180 return m.group(1) | 172 return m.group(1) |
| 181 | 173 |
| 182 | 174 |
| 183 def RmTree(dir): | 175 def RmTree(dir): |
| 184 """Delete dir.""" | 176 """Delete dir.""" |
| 185 def ChmodAndRetry(func, path, _): | 177 def ChmodAndRetry(func, path, _): |
| 186 # Subversion can leave read-only files around. | 178 # Subversion can leave read-only files around. |
| 187 if not os.access(path, os.W_OK): | 179 if not os.access(path, os.W_OK): |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 900 args.force_local_build = True | 892 args.force_local_build = True |
| 901 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 893 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
| 902 # Only build the Android ASan rt on ToT bots when targetting Android. | 894 # Only build the Android ASan rt on ToT bots when targetting Android. |
| 903 args.with_android = False | 895 args.with_android = False |
| 904 | 896 |
| 905 return UpdateClang(args) | 897 return UpdateClang(args) |
| 906 | 898 |
| 907 | 899 |
| 908 if __name__ == '__main__': | 900 if __name__ == '__main__': |
| 909 sys.exit(main()) | 901 sys.exit(main()) |
| OLD | NEW |