diff options
author | Tom Tanner <ttanner2@bloomberg.net> | 2013-10-01 12:18:49 +0100 |
---|---|---|
committer | Tom Tanner <ttanner2@bloomberg.net> | 2013-10-01 12:18:49 +0100 |
commit | da33d39d5174d73f82384559a5855fc966b12db7 (patch) | |
tree | 393caae6da68a4894218ad0bad15b1b9030c5302 | |
parent | 1a50903a2f142a5b087d59b6f94dca92cca8b0a2 (diff) | |
download | scons-da33d39d5174d73f82384559a5855fc966b12db7.tar.gz |
Added stack dump on build error
Added message if nothing found to build
Always produce profile stats, no matter what sort of exit
Print message if you drop out with a build error
-rw-r--r-- | src/engine/SCons/Script/Main.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index fea0916c..9c2e0b9e 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -272,6 +272,9 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask): (EnvironmentError, SCons.Errors.StopError, SCons.Errors.UserError))): type, value, trace = buildError.exc_info + if tb and print_stacktrace: + sys.stderr.write("scons: internal stack trace:\n") + traceback.print_tb(tb, file=sys.stderr) traceback.print_exception(type, value, trace) elif tb and print_stacktrace: sys.stderr.write("scons: internal stack trace:\n") @@ -1071,6 +1074,7 @@ def _main(parser): # Build the targets nodes = _build_targets(fs, options, targets, target_top) if not nodes: + print 'Found nothing to build' exit_status = 2 def _build_targets(fs, options, targets, target_top): @@ -1299,12 +1303,8 @@ def _exec_main(parser, values): prof = Profile() try: prof.runcall(_main, parser) - except SConsPrintHelpException, e: + finally: prof.dump_stats(options.profile_file) - raise e - except SystemExit: - pass - prof.dump_stats(options.profile_file) else: _main(parser) @@ -1359,6 +1359,7 @@ def main(): parser.print_help() exit_status = 0 except SCons.Errors.BuildError, e: + print e exit_status = e.exitstatus except: # An exception here is likely a builtin Python exception Python |