Message ID | 20240523145541.198353-1-marlon.rodriguez-garcia@savoirfairelinux.com |
---|---|
State | New |
Headers | show |
Series | Add exception treatment to fix missing target_file | expand |
Hi Marlon, The patch looks good. Thank you for fixing this edge case. David -----Original Message----- From: toaster@lists.yoctoproject.org <toaster@lists.yoctoproject.org> On Behalf Of Marlon Rodriguez Garcia via lists.yoctoproject.org Sent: Thursday, May 23, 2024 7:56 AM To: bitbake-devel@lists.openembedded.org; toaster@lists.yoctoproject.org Cc: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Subject: [Toaster] [PATCH] Add exception treatment to fix missing target_file Based on the discution on https://lists.yoctoproject.org/g/toaster/message/6157 in some cases the value for Target_file could be missing and is needed to bypass it to finish build Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> --- lib/bb/ui/buildinfohelper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py index 8b212b780..4ee45d67a 100644 --- a/lib/bb/ui/buildinfohelper.py +++ b/lib/bb/ui/buildinfohelper.py @@ -559,7 +559,10 @@ class ORMWrapper(object): # we might have an invalid link; no way to detect this. just set it to None filetarget_obj = None - parent_obj = Target_File.objects.get(target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY) + try: + parent_obj = Target_File.objects.get(target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY) + except Target_File.DoesNotExist: + parent_obj = None Target_File.objects.create( target = target_obj,
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py index 8b212b780..4ee45d67a 100644 --- a/lib/bb/ui/buildinfohelper.py +++ b/lib/bb/ui/buildinfohelper.py @@ -559,7 +559,10 @@ class ORMWrapper(object): # we might have an invalid link; no way to detect this. just set it to None filetarget_obj = None - parent_obj = Target_File.objects.get(target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY) + try: + parent_obj = Target_File.objects.get(target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY) + except Target_File.DoesNotExist: + parent_obj = None Target_File.objects.create( target = target_obj,
Based on the discution on https://lists.yoctoproject.org/g/toaster/message/6157 in some cases the value for Target_file could be missing and is needed to bypass it to finish build Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> --- lib/bb/ui/buildinfohelper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)