If a command-line build is interrupted with Ctrl-C or similar, set the outcome of the Build to CANCELLED. This ensures that interrupted builds don't "hang" in the Toaster UI and are displayed as required by the design.
[YOCTO #8515] Signed-off-by: Elliot Smith <[email protected]> --- bitbake/lib/bb/ui/buildinfohelper.py | 10 ++++++++++ bitbake/lib/bb/ui/toasterui.py | 1 + 2 files changed, 11 insertions(+) diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 9397905..83dc098 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py @@ -1251,6 +1251,16 @@ class BuildInfoHelper(object): + def cancel_cli_build(self): + """ + If a build is currently underway, set its state to CANCELLED; + note that this only gets called for command line builds which are + interrupted, so it doesn't touch any BuildRequest objects + """ + build = self.internal_state['build'] + if build: + build.outcome = Build.CANCELLED + build.save() def store_dependency_information(self, event): assert '_depgraph' in vars(event) diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py index 6bf4c1f..fb476a3 100644 --- a/bitbake/lib/bb/ui/toasterui.py +++ b/bitbake/lib/bb/ui/toasterui.py @@ -442,6 +442,7 @@ def main(server, eventHandler, params): pass except KeyboardInterrupt: main.shutdown = 1 + buildinfohelper.cancel_cli_build() except Exception as e: # print errors to log import traceback -- 1.9.3 --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
