OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2015 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 """Downloads pre-built sanitizer-instrumented third-party libraries from GCS.""" | 6 """Downloads pre-built sanitizer-instrumented third-party libraries from GCS.""" |
7 | 7 |
8 import os | 8 import os |
9 import re | 9 import re |
10 import subprocess | 10 import subprocess |
11 import sys | 11 import sys |
12 | 12 |
13 def get_ubuntu_release(): | 13 def get_ubuntu_release(): |
14 supported_releases = ['precise', 'trusty'] | 14 supported_releases = ['precise', 'trusty'] |
15 release = subprocess.check_output(['lsb_release', '-cs']).strip() | 15 release = subprocess.check_output(['lsb_release', '-cs']).strip() |
16 if release not in supported_releases: | 16 if release not in supported_releases: |
17 raise Exception("Supported Ubuntu versions: %s", str(supported_releases)) | 17 raise Exception("Supported Ubuntu versions: %s", str(supported_releases)) |
18 return release | 18 return release |
19 | 19 |
20 | 20 |
21 def get_configuration(gyp_defines): | 21 def get_configuration(gyp_defines): |
22 if re.search(r'\b(msan)=1', gyp_defines): | 22 if re.search(r'\b(msan)=1', gyp_defines): |
| 23 if 'msan_track_origins=0' in gyp_defines: |
| 24 return 'msan-no-origins' |
23 if 'msan_track_origins=2' in gyp_defines: | 25 if 'msan_track_origins=2' in gyp_defines: |
24 return 'msan-chained-origins' | 26 return 'msan-chained-origins' |
25 if 'msan_track_origins=' not in gyp_defines: | 27 if 'msan_track_origins=' not in gyp_defines: |
26 # NB: must be the same as the default value in common.gypi | 28 # NB: must be the same as the default value in common.gypi |
27 return 'msan-chained-origins' | 29 return 'msan-chained-origins' |
28 raise Exception( | 30 raise Exception( |
29 "Prebuilt instrumented libraries not available for your configuration.") | 31 "Prebuilt instrumented libraries not available for your configuration.") |
30 | 32 |
31 | 33 |
32 def get_archive_name(gyp_defines): | 34 def get_archive_name(gyp_defines): |
(...skipping 17 matching lines...) Expand all Loading... |
50 '--no_resume', | 52 '--no_resume', |
51 '--no_auth', | 53 '--no_auth', |
52 '--bucket', 'chromium-instrumented-libraries', | 54 '--bucket', 'chromium-instrumented-libraries', |
53 '-s', sha1file], cwd=target_directory) | 55 '-s', sha1file], cwd=target_directory) |
54 | 56 |
55 return 0 | 57 return 0 |
56 | 58 |
57 | 59 |
58 if __name__ == '__main__': | 60 if __name__ == '__main__': |
59 sys.exit(main(sys.argv[1:])) | 61 sys.exit(main(sys.argv[1:])) |
OLD | NEW |