diff mbox series

[v5,08/13] buildman: Add a flag to control the traceback

Message ID 20220122050728.v5.8.I636748c91d1fdc7d2e39a3d636c03751004427d3@changeid
State Accepted
Commit 433fa549e138a06085fe3a9a0ac4924bb1804687
Delegated to: Tom Rini
Headers show
Series kconfig: Add some new macros | expand

Commit Message

Simon Glass Jan. 22, 2022, 12:07 p.m. UTC
At present the full horror of the Python traceback is shown by default. It
is normally only useful for debugging. Turn it off by default and add a
--debug flag to enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 tools/buildman/cmdline.py | 2 ++
 tools/buildman/main.py    | 3 +++
 2 files changed, 5 insertions(+)

Comments

Tom Rini Feb. 9, 2022, 4:38 p.m. UTC | #1
On Sat, Jan 22, 2022 at 05:07:29AM -0700, Simon Glass wrote:

> At present the full horror of the Python traceback is shown by default. It
> is normally only useful for debugging. Turn it off by default and add a
> --debug flag to enable it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py
index 274b5ac3f45..092a82f4e9c 100644
--- a/tools/buildman/cmdline.py
+++ b/tools/buildman/cmdline.py
@@ -32,6 +32,8 @@  def ParseArgs():
           help='Show detailed size delta for each board in the -S summary')
     parser.add_option('-D', '--config-only', action='store_true', default=False,
           help="Don't build, just configure each commit")
+    parser.add_option('--debug', action='store_true',
+        help='Enabling debugging (provides a full traceback on error)')
     parser.add_option('-e', '--show_errors', action='store_true',
           default=False, help='Show errors and warnings')
     parser.add_option('-E', '--warnings-as-errors', action='store_true',
diff --git a/tools/buildman/main.py b/tools/buildman/main.py
index 2b714739a20..04698ce9e50 100755
--- a/tools/buildman/main.py
+++ b/tools/buildman/main.py
@@ -54,6 +54,9 @@  def RunTests(skip_net_tests):
 
 options, args = cmdline.ParseArgs()
 
+if not options.debug:
+    sys.tracebacklimit = 0
+
 # Run our meagre tests
 if options.test:
     RunTests(options.skip_net_tests)