diff mbox series

[2/3] runqemu: ensure that bitbake environment is either returned, or an exception is raised

Message ID 20251007124652.259629-2-alex.kanavin@gmail.com
State Accepted, archived
Commit 8197be4dd336be2f8a646916223922da61c5b9b1
Headers show
Series [1/3] scripts/runqemu: raise an error when bitbake was not found | expand

Commit Message

Alexander Kanavin Oct. 7, 2025, 12:46 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

This eliminates the other remaining code path where environment getter
returns 'nothing'. This and the previous patch were tested in a-full,
and no errors occurred [1], which means the code paths that make
use of the function returning nothing are never actually executed
and can be cleaned up (in the following patch).

The rationale is that if environment getter cannot obtain the environment,
it should report that and not sweep the issue under the carpet;
it's up to the caller to handle that situation, or make pre-emptive
checks that avoid calling the environment getter when it is bound to fail.

[1] https://lists.openembedded.org/g/openembedded-core/message/223651

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 scripts/runqemu | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index c28980e6163..1e8406e1194 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1745,11 +1745,7 @@  to your build configuration.
                 cmd = 'MACHINE=%s bitbake -e %s %s' % (mach, multiconfig, target)
             else:
                 cmd = 'bitbake -e %s %s' % (multiconfig, target)
-            try:
-                return subprocess.check_output(cmd, shell=True).decode('utf-8')
-            except subprocess.CalledProcessError as err:
-                logger.warning("Couldn't run '%s' to gather environment information, giving up with 'bitbake -e':\n%s" % (cmd, err.output.decode('utf-8')))
-                return ''
+            return subprocess.check_output(cmd, shell=True).decode('utf-8')
 
 
     def load_bitbake_env(self, mach=None, target=None):