diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-07 13:54:04 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-08 16:44:31 +0100 |
commit | a2a04c6fe94bc56efcff299c669a151746e35916 (patch) | |
tree | caeb018167bea33d322f7637d644fb595712b280 | |
parent | 0244acb968eb593d2ad7bc6e52f222c2b1d39aa9 (diff) | |
download | bitbake-a2a04c6fe94bc56efcff299c669a151746e35916.tar.gz |
bitbake-worker: Handle pseudo shutdown in Ctrl+C case
If the build is interrupted, handle the shutdown of pseudo even in this
case to avoid data corruption inside docker containers.
[YOCTO #14555]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | bin/bitbake-worker | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/bitbake-worker b/bin/bitbake-worker index 115bc1d09..6a12e1fed 100755 --- a/bin/bitbake-worker +++ b/bin/bitbake-worker @@ -287,10 +287,12 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha try: if dry_run: return 0 - ret = bb.build.exec_task(fn, taskname, the_data, cfg.profile) - if fakeroot: - fakerootcmd = shlex.split(the_data.getVar("FAKEROOTCMD")) - subprocess.run(fakerootcmd + ['-S'], check=True, stdout=subprocess.PIPE) + try: + ret = bb.build.exec_task(fn, taskname, the_data, cfg.profile) + finally: + if fakeroot: + fakerootcmd = shlex.split(the_data.getVar("FAKEROOTCMD")) + subprocess.run(fakerootcmd + ['-S'], check=True, stdout=subprocess.PIPE) return ret except: os._exit(1) |