summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorTroels Dalsgaard Hoffmeyer <tdah@bang-olufsen.dk>2024-08-09 13:50:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-15 15:15:10 +0100
commit67efcf3102b31581cb95f9c4b1a1aedff7464a53 (patch)
tree42b67ce1cb6badbc9ff46c6c58ee351645cc29d5 /bitbake
parent96b61275be85b46712308b6ec5695865e0716c2e (diff)
downloadpoky-67efcf3102b31581cb95f9c4b1a1aedff7464a53.tar.gz
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 <tdah@bang-olufsen.dk> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/build.py4
1 files 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):
743 743
744 if quieterr: 744 if quieterr:
745 if not handled: 745 if not handled:
746 logger.warning(repr(exc)) 746 logger.warning(str(exc))
747 event.fire(TaskFailedSilent(task, fn, logfn, localdata), localdata) 747 event.fire(TaskFailedSilent(task, fn, logfn, localdata), localdata)
748 else: 748 else:
749 errprinted = errchk.triggered 749 errprinted = errchk.triggered
@@ -752,7 +752,7 @@ def _exec_task(fn, task, d, quieterr):
752 if verboseStdoutLogging or handled: 752 if verboseStdoutLogging or handled:
753 errprinted = True 753 errprinted = True
754 if not handled: 754 if not handled:
755 logger.error(repr(exc)) 755 logger.error(str(exc))
756 event.fire(TaskFailed(task, fn, logfn, localdata, errprinted), localdata) 756 event.fire(TaskFailed(task, fn, logfn, localdata, errprinted), localdata)
757 return 1 757 return 1
758 758