Bug 1210157 - Add a --debug option to bootstrap.py r=nalexander
authorMāris Fogels <mars@mozilla.com>
Tue, 20 Aug 2019 21:19:17 +0000
changeset 553826 7c2b0c902854d5e60b4b0013f17e2f5ce195aa4a
parent 553825 5ddb34b933f3229cd358d690dc13639445815755
child 553827 f0f92aecee180a0377721ee8558579769c1ccc45
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1210157
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1210157 - Add a --debug option to bootstrap.py r=nalexander Add an option to run bootstrap.py with '--debug'. This will print full tracebacks if the bootstrap process encounters an uncaught exception. It should be useful for developers who are working on the bootstrap code as well as users when writing bug reports. Depends on D39362 Differential Revision: https://phabricator.services.mozilla.com/D39363
python/mozboot/bin/bootstrap.py
--- a/python/mozboot/bin/bootstrap.py
+++ b/python/mozboot/bin/bootstrap.py
@@ -149,27 +149,35 @@ def main(args):
                       help='The type of the repository. This defines how we fetch file '
                       'content. Like --repo, you should not need to set this.')
 
     parser.add_option('--application-choice', dest='application_choice',
                       help='Pass in an application choice (see mozboot.bootstrap.APPLICATIONS) '
                       'instead of using the default interactive prompt.')
     parser.add_option('--no-interactive', dest='no_interactive', action='store_true',
                       help='Answer yes to any (Y/n) interactive prompts.')
+    parser.add_option('--debug', dest='debug', action='store_true',
+                      help='Print extra runtime information useful for debugging and '
+                      'bug reports.')
 
     options, leftover = parser.parse_args(args)
 
     try:
         try:
             cls = ensure_environment(options.repo_url, options.repo_rev,
                                      options.repo_type)
         except Exception as e:
             print('Could not load the bootstrap Python environment.\n')
             print('This should never happen. Consider filing a bug.\n')
             print('\n')
+
+            if options.debug:
+                # Raise full tracebacks during debugging and for bug reporting.
+                raise
+
             print(e)
             return 1
         dasboot = cls(choice=options.application_choice, no_interactive=options.no_interactive,
                       vcs=options.vcs)
         dasboot.bootstrap()
 
         return 0
     finally: