| 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 """Windows can't run .sh files, so this is a Python implementation of |
| 7 update.sh. This script should replace update.sh on all platforms eventually.""" | 7 update.sh. This script should replace update.sh on all platforms eventually.""" |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| 11 import shutil | 11 import shutil |
| 12 import subprocess | 12 import subprocess |
| 13 import sys | 13 import sys |
| 14 | 14 |
| 15 # Do NOT CHANGE this if you don't know what you're doing -- see | 15 # Do NOT CHANGE this if you don't know what you're doing -- see |
| 16 # https://code.google.com/p/chromium/wiki/UpdatingClang | 16 # https://code.google.com/p/chromium/wiki/UpdatingClang |
| 17 # Reverting problematic clang rolls is safe, though. | 17 # Reverting problematic clang rolls is safe, though. |
| 18 # Note: this revision is only used for Windows. Other platforms use update.sh. | 18 # Note: this revision is only used for Windows. Other platforms use update.sh. |
| 19 LLVM_WIN_REVISION = 'HEAD' | 19 LLVM_WIN_REVISION = 'HEAD' |
| 20 | 20 |
| 21 # ASan on Windows is useful enough to use it even while the clang/win is still | 21 # ASan on Windows is useful enough to use it even while the clang/win is still |
| 22 # in bringup. Use a pinned revision to make it slightly more stable. | 22 # in bringup. Use a pinned revision to make it slightly more stable. |
| 23 if (sys.platform in ['win32', 'cygwin'] and | 23 if (re.search(r'\b(asan)=1', os.environ.get('GYP_DEFINES', ''))): |
| 24 re.search(r'\b(asan)=1', os.environ.get('GYP_DEFINES', ''))): | |
| 25 LLVM_WIN_REVISION = '210586' | 24 LLVM_WIN_REVISION = '210586' |
| 26 | 25 |
| 27 # Path constants. (All of these should be absolute paths.) | 26 # Path constants. (All of these should be absolute paths.) |
| 28 THIS_DIR = os.path.abspath(os.path.dirname(__file__)) | 27 THIS_DIR = os.path.abspath(os.path.dirname(__file__)) |
| 29 CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..')) | 28 CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..')) |
| 30 LLVM_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm') | 29 LLVM_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm') |
| 31 LLVM_BUILD_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm-build', | 30 LLVM_BUILD_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm-build', |
| 32 'Release+Asserts') | 31 'Release+Asserts') |
| 33 COMPILER_RT_BUILD_DIR = os.path.join(LLVM_BUILD_DIR, '32bit-compiler-rt') | 32 COMPILER_RT_BUILD_DIR = os.path.join(LLVM_BUILD_DIR, '32bit-compiler-rt') |
| 34 CLANG_DIR = os.path.join(LLVM_DIR, 'tools', 'clang') | 33 CLANG_DIR = os.path.join(LLVM_DIR, 'tools', 'clang') |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 208 |
| 210 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): | 209 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): |
| 211 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' | 210 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' |
| 212 return 0 | 211 return 0 |
| 213 | 212 |
| 214 return UpdateClang() | 213 return UpdateClang() |
| 215 | 214 |
| 216 | 215 |
| 217 if __name__ == '__main__': | 216 if __name__ == '__main__': |
| 218 sys.exit(main()) | 217 sys.exit(main()) |
| OLD | NEW |