| 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 """Snapshot Build Bisect Tool | 6 """Snapshot Build Bisect Tool |
| 7 | 7 |
| 8 This script bisects a snapshot archive using binary search. It starts at | 8 This script bisects a snapshot archive using binary search. It starts at |
| 9 a bad revision (it will try to guess HEAD) and asks for a last known-good | 9 a bad revision (it will try to guess HEAD) and asks for a last known-good |
| 10 revision. It will then binary search across this revision range by downloading, | 10 revision. It will then binary search across this revision range by downloading, |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 # revision number. | 152 # revision number. |
| 153 self.use_local_repo = use_local_repo | 153 self.use_local_repo = use_local_repo |
| 154 | 154 |
| 155 # If the script is being used for android builds. | 155 # If the script is being used for android builds. |
| 156 self.android = self.platform.startswith('android') | 156 self.android = self.platform.startswith('android') |
| 157 | 157 |
| 158 # Set some internal members: | 158 # Set some internal members: |
| 159 # _listing_platform_dir = Directory that holds revisions. Ends with a '/'. | 159 # _listing_platform_dir = Directory that holds revisions. Ends with a '/'. |
| 160 # _archive_extract_dir = Uncompressed directory in the archive_name file. | 160 # _archive_extract_dir = Uncompressed directory in the archive_name file. |
| 161 # _binary_name = The name of the executable to run. | 161 # _binary_name = The name of the executable to run. |
| 162 if self.platform in ('linux', 'linux64', 'linux-arm'): | 162 if self.platform in ('linux', 'linux64', 'linux-arm', 'chromeos'): |
| 163 self._binary_name = 'chrome' | 163 self._binary_name = 'chrome' |
| 164 elif self.platform in ('mac', 'mac64'): | 164 elif self.platform in ('mac', 'mac64'): |
| 165 self.archive_name = 'chrome-mac.zip' | 165 self.archive_name = 'chrome-mac.zip' |
| 166 self._archive_extract_dir = 'chrome-mac' | 166 self._archive_extract_dir = 'chrome-mac' |
| 167 elif self.platform in ('win', 'win64'): | 167 elif self.platform in ('win', 'win64'): |
| 168 self.archive_name = 'chrome-win32.zip' | 168 self.archive_name = 'chrome-win32.zip' |
| 169 self._archive_extract_dir = 'chrome-win32' | 169 self._archive_extract_dir = 'chrome-win32' |
| 170 self._binary_name = 'chrome.exe' | 170 self._binary_name = 'chrome.exe' |
| 171 elif self.android: | 171 elif self.android: |
| 172 pass | 172 pass |
| (...skipping 29 matching lines...) Expand all Loading... |
| 202 elif self.platform == 'android-arm-64': | 202 elif self.platform == 'android-arm-64': |
| 203 self._listing_platform_dir = 'arm_64/' | 203 self._listing_platform_dir = 'arm_64/' |
| 204 self.archive_name = self.android_apk | 204 self.archive_name = self.android_apk |
| 205 elif self.platform == 'android-x86': | 205 elif self.platform == 'android-x86': |
| 206 self._listing_platform_dir = 'x86/' | 206 self._listing_platform_dir = 'x86/' |
| 207 self.archive_name = self.android_apk | 207 self.archive_name = self.android_apk |
| 208 elif self.platform == 'android-x64-64': | 208 elif self.platform == 'android-x64-64': |
| 209 self._listing_platform_dir = 'x86_64/' | 209 self._listing_platform_dir = 'x86_64/' |
| 210 self.archive_name = self.android_apk | 210 self.archive_name = self.android_apk |
| 211 else: | 211 else: |
| 212 if self.platform in ('linux', 'linux64', 'linux-arm'): | 212 if self.platform in ('linux', 'linux64', 'linux-arm', 'chromeos'): |
| 213 self.archive_name = 'chrome-linux.zip' | 213 self.archive_name = 'chrome-linux.zip' |
| 214 self._archive_extract_dir = 'chrome-linux' | 214 self._archive_extract_dir = 'chrome-linux' |
| 215 if self.platform == 'linux': | 215 if self.platform == 'linux': |
| 216 self._listing_platform_dir = 'Linux/' | 216 self._listing_platform_dir = 'Linux/' |
| 217 elif self.platform == 'linux64': | 217 elif self.platform == 'linux64': |
| 218 self._listing_platform_dir = 'Linux_x64/' | 218 self._listing_platform_dir = 'Linux_x64/' |
| 219 elif self.platform == 'linux-arm': | 219 elif self.platform == 'linux-arm': |
| 220 self._listing_platform_dir = 'Linux_ARM_Cross-Compile/' | 220 self._listing_platform_dir = 'Linux_ARM_Cross-Compile/' |
| 221 elif self.platform == 'chromeos': |
| 222 self._listing_platform_dir = 'Linux_ChromiumOS_Full/' |
| 221 elif self.platform == 'mac': | 223 elif self.platform == 'mac': |
| 222 self._listing_platform_dir = 'Mac/' | 224 self._listing_platform_dir = 'Mac/' |
| 223 self._binary_name = 'Chromium.app/Contents/MacOS/Chromium' | 225 self._binary_name = 'Chromium.app/Contents/MacOS/Chromium' |
| 224 elif self.platform == 'win': | 226 elif self.platform == 'win': |
| 225 self._listing_platform_dir = 'Win/' | 227 self._listing_platform_dir = 'Win/' |
| 226 | 228 |
| 227 def GetASANPlatformDir(self): | 229 def GetASANPlatformDir(self): |
| 228 """ASAN builds are in directories like "linux-release", or have filenames | 230 """ASAN builds are in directories like "linux-release", or have filenames |
| 229 like "asan-win32-release-277079.zip". This aligns to our platform names | 231 like "asan-win32-release-277079.zip". This aligns to our platform names |
| 230 except in the case of Windows where they use "win32" instead of "win".""" | 232 except in the case of Windows where they use "win32" instead of "win".""" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 639 |
| 638 if context.android: | 640 if context.android: |
| 639 RunAndroidRevision(context, revision, zip_file) | 641 RunAndroidRevision(context, revision, zip_file) |
| 640 # TODO(mikecase): Support running command to auto-bisect Android. | 642 # TODO(mikecase): Support running command to auto-bisect Android. |
| 641 return (None, None, None) | 643 return (None, None, None) |
| 642 | 644 |
| 643 # Create a temp directory and unzip the revision into it. | 645 # Create a temp directory and unzip the revision into it. |
| 644 cwd = os.getcwd() | 646 cwd = os.getcwd() |
| 645 tempdir = tempfile.mkdtemp(prefix='bisect_tmp') | 647 tempdir = tempfile.mkdtemp(prefix='bisect_tmp') |
| 646 UnzipFilenameToDir(zip_file, tempdir) | 648 UnzipFilenameToDir(zip_file, tempdir) |
| 649 |
| 650 # Hack: Chrome OS archives are missing icudtl.dat; try to copy it from |
| 651 # the local directory. |
| 652 if context.platform == 'chromeos': |
| 653 icudtl_path = 'third_party/icu/source/data/in/icudtl.dat' |
| 654 if not os.access(icudtl_path, os.F_OK): |
| 655 print 'Couldn\'t find: ' + icudtl_path |
| 656 sys.exit() |
| 657 os.system('cp %s %s/chrome-linux/' % (icudtl_path, tempdir)) |
| 658 |
| 647 os.chdir(tempdir) | 659 os.chdir(tempdir) |
| 648 | 660 |
| 649 # Run the build as many times as specified. | 661 # Run the build as many times as specified. |
| 650 testargs = ['--user-data-dir=%s' % profile] + args | 662 testargs = ['--user-data-dir=%s' % profile] + args |
| 651 # The sandbox must be run as root on Official Chrome, so bypass it. | 663 # The sandbox must be run as root on Official Chrome, so bypass it. |
| 652 if ((context.is_official or context.flash_path or context.pdf_path) and | 664 if ((context.is_official or context.flash_path or context.pdf_path) and |
| 653 context.platform.startswith('linux')): | 665 context.platform.startswith('linux')): |
| 654 testargs.append('--no-sandbox') | 666 testargs.append('--no-sandbox') |
| 655 if context.flash_path: | 667 if context.flash_path: |
| 656 testargs.append('--ppapi-flash-path=%s' % context.flash_path) | 668 testargs.append('--ppapi-flash-path=%s' % context.flash_path) |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 ' SVN revisions (e.g. 123456) for chromium builds, from trunk.\n' | 1092 ' SVN revisions (e.g. 123456) for chromium builds, from trunk.\n' |
| 1081 ' Use base_trunk_revision from http://omahaproxy.appspot.com/\n' | 1093 ' Use base_trunk_revision from http://omahaproxy.appspot.com/\n' |
| 1082 ' for earlier revs.\n' | 1094 ' for earlier revs.\n' |
| 1083 ' Chrome\'s about: build number and omahaproxy branch_revision\n' | 1095 ' Chrome\'s about: build number and omahaproxy branch_revision\n' |
| 1084 ' are incorrect, they are from branches.\n' | 1096 ' are incorrect, they are from branches.\n' |
| 1085 '\n' | 1097 '\n' |
| 1086 'Tip: add "-- --no-first-run" to bypass the first run prompts.') | 1098 'Tip: add "-- --no-first-run" to bypass the first run prompts.') |
| 1087 parser = optparse.OptionParser(usage=usage) | 1099 parser = optparse.OptionParser(usage=usage) |
| 1088 # Strangely, the default help output doesn't include the choice list. | 1100 # Strangely, the default help output doesn't include the choice list. |
| 1089 choices = ['mac', 'mac64', 'win', 'win64', 'linux', 'linux64', 'linux-arm', | 1101 choices = ['mac', 'mac64', 'win', 'win64', 'linux', 'linux64', 'linux-arm', |
| 1090 'android-arm', 'android-arm-64', 'android-x86', 'android-x86-64'] | 1102 'android-arm', 'android-arm-64', 'android-x86', 'android-x86-64', |
| 1091 # linux-chromiumos lacks a continuous archive http://crbug.com/78158 | 1103 'chromeos'] |
| 1092 apk_choices = ['Chrome.apk', 'ChromeBeta.apk', 'ChromeCanary.apk', | 1104 apk_choices = ['Chrome.apk', 'ChromeBeta.apk', 'ChromeCanary.apk', |
| 1093 'ChromeDev.apk', 'ChromeStable.apk'] | 1105 'ChromeDev.apk', 'ChromeStable.apk'] |
| 1094 parser.add_option('-a', '--archive', | 1106 parser.add_option('-a', '--archive', |
| 1095 choices=choices, | 1107 choices=choices, |
| 1096 help='The buildbot archive to bisect [%s].' % | 1108 help='The buildbot archive to bisect [%s].' % |
| 1097 '|'.join(choices)) | 1109 '|'.join(choices)) |
| 1098 parser.add_option('-o', | 1110 parser.add_option('-o', |
| 1099 action='store_true', | 1111 action='store_true', |
| 1100 dest='official_builds', | 1112 dest='official_builds', |
| 1101 help='Bisect across official Chrome builds (internal ' | 1113 help='Bisect across official Chrome builds (internal ' |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 | 1306 |
| 1295 print 'CHANGELOG URL:' | 1307 print 'CHANGELOG URL:' |
| 1296 if opts.official_builds: | 1308 if opts.official_builds: |
| 1297 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) | 1309 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
| 1298 else: | 1310 else: |
| 1299 PrintChangeLog(min_chromium_rev, max_chromium_rev) | 1311 PrintChangeLog(min_chromium_rev, max_chromium_rev) |
| 1300 | 1312 |
| 1301 | 1313 |
| 1302 if __name__ == '__main__': | 1314 if __name__ == '__main__': |
| 1303 sys.exit(main()) | 1315 sys.exit(main()) |
| OLD | NEW |