From 250a2a3503c9ed430bdaed4b71e53ed696f37b32 Mon Sep 17 00:00:00 2001 From: alichinese Date: Wed, 11 Sep 2024 09:52:50 +0800 Subject: [PATCH] bitbake_host: fix the bug * After the bitbake command runs, it should only exit the child process rather than terminating the parent process; otherwise, the subcommand cannot be invoked as a function by the internal process. Signed-off-by: alichinese --- src/oebuild/app/plugins/bitbake/bitbake.py | 4 +++- src/oebuild/app/plugins/bitbake/in_host.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/oebuild/app/plugins/bitbake/bitbake.py b/src/oebuild/app/plugins/bitbake/bitbake.py index f24a8ed..30bfe97 100644 --- a/src/oebuild/app/plugins/bitbake/bitbake.py +++ b/src/oebuild/app/plugins/bitbake/bitbake.py @@ -114,7 +114,9 @@ class Bitbake(OebuildCommand): if compile_param.build_in == oebuild_const.BUILD_IN_HOST: in_host = InHost(self.configure) in_host.exec(compile_param=compile_param, command=command) - sys.exit(0) + # note: Use return instead of sys.exit because the command should exit the + # function rather than terminating the entire process when it is done executing. + return try: oebuild_util.check_docker() diff --git a/src/oebuild/app/plugins/bitbake/in_host.py b/src/oebuild/app/plugins/bitbake/in_host.py index 32f6869..b4a489a 100644 --- a/src/oebuild/app/plugins/bitbake/in_host.py +++ b/src/oebuild/app/plugins/bitbake/in_host.py @@ -115,7 +115,8 @@ initialization operations''') if s_p.stderr is not None: for line in s_p.stderr: logger.error(line.strip('\n')) - sys.exit(res) + if res != 0: + sys.exit(res) def _mk_build_sh(self, nativesdk_dir, build_dir): # get nativesdk environment path automatic for next step -- Gitee