Skip to contentSkip to conversation

process.py: Handle SystemExit exception to eliminate backtrace

PATCH New Mark Hatle 1 participant 1 message Sep 2, 2020

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 process.py: Handle SystemExit exception to eliminate backtrace

With an invalid layer, the desired error output should be:

ERROR: The following layer directories do not exist:
ERROR: /this_path_does_not_exist
ERROR: Please check BBLAYERS in .../build-invalid-layer/conf/bblayers.conf

Instead we were met with a backtrace:

Traceback (most recent call last):
File "/scratch1/fray/xilinx/poky/bitbake/bin/bitbake", line 36, in <module>
cookerdata.CookerConfiguration()))
...
File "/scratch1/fray/xilinx/poky/bitbake/lib/bb/cookerdata.py", line 267, in parseBaseConfiguration
self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
File "/scratch1/fray/xilinx/poky/bitbake/lib/bb/cookerdata.py", line 358, in parseConfigurationFiles

    sys.exit(1)

SystemExit: 1

---
 lib/bb/server/process.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/server/process.py +1 -1
index 8699765a31..c972fe567d 100644
@@ -368,7 +368,7 @@ class ServerCommunicator():
         ret, exc = self.recv.get()
         # Should probably turn all exceptions in exc back into exceptions?
         # For now, at least handle BBHandledException
-        if exc and "BBHandledException" in exc:
+        if exc and ("BBHandledException" in exc or "SystemExit" in exc):
             raise bb.BBHandledException()
         return ret, exc
 
Signature · 1 line
2.17.1