From 67efcf3102b31581cb95f9c4b1a1aedff7464a53 Mon Sep 17 00:00:00 2001 From: Troels Dalsgaard Hoffmeyer Date: Fri, 9 Aug 2024 13:50:13 +0200 Subject: [PATCH] bitbake: build/exec_task: Log str() instead of repr() for exceptions in build When getting errors during build, they would be printed using repr(), which doesnt have a lot of context in some cases. For example FileNotFoundError(2, "file or directory not found"), would be printed, without the path of the file not found. This changes the build logging to use str() instead, which according to the spec is fore human readable strings, whereas repr() is for string representations that can be be used as valid python. (Bitbake rev: 2a97024b8b9245ec47deace011a7560a25491207) Signed-off-by: Troels Dalsgaard Hoffmeyer Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- bitbake/lib/bb/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index d226aadacb..9f9285de3d 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -743,7 +743,7 @@ def _exec_task(fn, task, d, quieterr): if quieterr: if not handled: - logger.warning(repr(exc)) + logger.warning(str(exc)) event.fire(TaskFailedSilent(task, fn, logfn, localdata), localdata) else: errprinted = errchk.triggered @@ -752,7 +752,7 @@ def _exec_task(fn, task, d, quieterr): if verboseStdoutLogging or handled: errprinted = True if not handled: - logger.error(repr(exc)) + logger.error(str(exc)) event.fire(TaskFailed(task, fn, logfn, localdata, errprinted), localdata) return 1