From patchwork Fri Mar 10 20:45:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20770 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F4A5C6FA99 for ; Fri, 10 Mar 2023 20:45:41 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.web10.30832.1678481135095935614 for ; Fri, 10 Mar 2023 12:45:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CfmrVWz1; spf=pass (domain: gmail.com, ip: 209.85.128.53, mailfrom: martin.jansa@gmail.com) Received: by mail-wm1-f53.google.com with SMTP id az36so4262675wmb.1 for ; Fri, 10 Mar 2023 12:45:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678481133; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8Xuet9e0HwGpmOG3ug9oYD6YSpptRFLHOOjlo8cEuhI=; b=CfmrVWz1K4oJIiC2LV8e0zd8najft58T/VzW2be6Pqce7kwX1BRn2wJzWeBAuYAKha CtK0CSRd8xgpLQeUW5uErts2vJeCH/qhxlcILeJDuNzegNy3mtZYPC4AdhTKSJ9zOsk9 xygb9zh0XMHNMdHYwfJjwn/jRDdArdKSngBajdOt+Add4DMl2vEHKWwUNeccqgtvh238 /opAqYsXrYhibVJeFtl6rSI2MITyGHfU0it4CR13XndSRMt32AClrloazWnzZ/oKCBec FSvKMk1z4jAZp2XfG5NuyVpmUuBBr2+Xl3X7juiAawGBowrfs1dCKZu5g2GOd/IUNSda Pmuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678481133; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8Xuet9e0HwGpmOG3ug9oYD6YSpptRFLHOOjlo8cEuhI=; b=FZ2G/ZUw7tqESHnmI45g0khd5LwGVhENvEZfXrg+YBSsmsuQZrQNZlz3Z4Jd1adC6r LXcgx/R7iFI/DOZCQyTjbH7Mr6cH9f7z9KEX0aYIgq59K3oTZNKjvSGkJcpLFxfvZd5c 91S4eYaecUnUR4KIaYlbRDHfyKQ1tQuSoAokAbcRvq9NhfmoPABaWYGMKVrRMMZhjQjX DPQ75ZrIkb/+d6hqZKTx1p1UcJJN3mKE3Ur3PJZhf8M1sCl4Bx6Lt03X48eAb648l1Um 2yUrcCeJtAblqsU83DMhqvR3h5SOS0vdeOaLpsyg1OV74MmAVsrHGDWUnh1iyzc79Pco leBg== X-Gm-Message-State: AO0yUKU8xIkVUo6rYuoMZSK93FNrBUlfhaKKa4K8ofLFkDeKGB8b8g9q L7I4HmfSainEg/WcMhKLbLfJZ8Yb8dw= X-Google-Smtp-Source: AK7set/r+FdwxOYf+XxjZRGfm5bxlUt4DyjwHeklDBoaRTTNZ+HwraCfvOsv2GI/sN9UY5KtRRSHoQ== X-Received: by 2002:a05:600c:4fc4:b0:3eb:2de8:b732 with SMTP id o4-20020a05600c4fc400b003eb2de8b732mr4360749wmq.0.1678481133381; Fri, 10 Mar 2023 12:45:33 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id x1-20020adff641000000b002c70c99db74sm660333wrp.86.2023.03.10.12.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 12:45:32 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: bitbake-devel@lists.openembedded.org Cc: steve@sakoman.com, Richard Purdie Subject: [2.2][PATCH 1/4] utils: Allow to_boolean to support int values Date: Fri, 10 Mar 2023 21:45:16 +0100 Message-Id: <20230310204519.706973-1-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 10 Mar 2023 20:45:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14540 From: Richard Purdie Some variables may be set as: X = 1 as well the more usual X = "1" so add support to to_boolean to handle this case. Signed-off-by: Richard Purdie --- lib/bb/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 3ce98d317..2f6d9229a 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -992,6 +992,9 @@ def to_boolean(string, default=None): if not string: return default + if isinstance(string, int): + return string != 0 + normalized = string.lower() if normalized in ("y", "yes", "1", "true"): return True From patchwork Fri Mar 10 20:45:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71583C6FD19 for ; Fri, 10 Mar 2023 20:45:41 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.groups.io with SMTP id smtpd.web10.30833.1678481137769508976 for ; Fri, 10 Mar 2023 12:45:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cHTnEg6F; spf=pass (domain: gmail.com, ip: 209.85.221.48, mailfrom: martin.jansa@gmail.com) Received: by mail-wr1-f48.google.com with SMTP id v16so6253118wrn.0 for ; Fri, 10 Mar 2023 12:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678481136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9ici8ngGTFKAdb3QgWeePJEkL9CATtA6yKoICPBgOI8=; b=cHTnEg6FiK8Mrh+PVugRcQJ3hsEb3oWNiLYS1RMnmnsaJpcSa3GC99iLia7NFt6Oqd GjOMUDBZT+Qa2cnci9j+LMMcKcLOuFmW0RCPu7dA8WgO/4id+Blo/VTbcXftCefa1qEX OEOy/7aebxfkvqzPav63eWQ/zLkDD7bX012tUeQ7U+X4u/egYOFSk1YPEemi1Iw/TApb iwnwqThMNbRgpJJX3U1TMCEkTDGERNRDNLbd65tk6MPs8NwFmAjoWefgXWE0AqhMv+vI +Nc+tKQETjroiei5SpYsE0sccvsiPnhGXYGdW4gTiu7c/mVfE4Vmr8gt+5Ra+GojtO58 Fvjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678481136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9ici8ngGTFKAdb3QgWeePJEkL9CATtA6yKoICPBgOI8=; b=B/ipg60ZPQcajoKVn/V4UR3PHfSpJ5Lp7jjDdMoJx4bdv3dkrTG+qWdLa/z2pEyWGb 9CIgQe+esqM1P4ge2OiNqo65TNsl5ySTshlgU98gR4NgjbGYHIYkYRw08cv8jm3Tobn1 hfBUzpe18/1lhb1UXEdl9VmO75bXp6TlAZaI5SWmvgqY2lJ6UHwHcruOfiMNQLTuQrYw nNfMuv7h8TXdnd8y7augB6qFHH8HgekwyTGEFupA26Gm2XQHGH5/Kz0REArtEHTHYbLU 2twBLgtxbNWrhpjHhcxu4a78d4cr6AFye5OLJgEfZMNIDhIFaZPHwPt07ksq5/Pa1UA+ PBIQ== X-Gm-Message-State: AO0yUKUBWLSld3R3Rvh+0uFUDSWokVAoIeqzweAA7JntlqfQBr/rwx7z qUgn2OXI08luNUf1wUR5TeViaMbqEZs= X-Google-Smtp-Source: AK7set8uRzU+x8tlF+dUFZ7j/E4zPU2S6iJaYLVoqji/pdRAjmKbRQrLKNOQ9SFRQcP3od/nnw6/KQ== X-Received: by 2002:a05:6000:4a:b0:2c7:faf:af32 with SMTP id k10-20020a056000004a00b002c70fafaf32mr16560878wrx.14.1678481136321; Fri, 10 Mar 2023 12:45:36 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id h16-20020adffd50000000b002c56af32e8csm644089wrs.35.2023.03.10.12.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 12:45:36 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: bitbake-devel@lists.openembedded.org Cc: steve@sakoman.com, Richard Purdie Subject: [2.2][PATCH 2/4] cookerdata: Remove incorrect SystemExit usage Date: Fri, 10 Mar 2023 21:45:17 +0100 Message-Id: <20230310204519.706973-2-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310204519.706973-1-Martin.Jansa@gmail.com> References: <20230310204519.706973-1-Martin.Jansa@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 10 Mar 2023 20:45:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14541 From: Richard Purdie Calling SystemExit doesn't work well with server/client usage since the string isn't printed to the right place. Use bb.fatal() instead which prints the right log output and raises and handled exception which then shows correctly on the UI. Signed-off-by: Richard Purdie --- lib/bb/cookerdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py index 8a354fed7..3555585c8 100644 --- a/lib/bb/cookerdata.py +++ b/lib/bb/cookerdata.py @@ -436,7 +436,7 @@ class CookerDataBuilder(object): msg += (" and bitbake did not find a conf/bblayers.conf file in" " the expected location.\nMaybe you accidentally" " invoked bitbake from the wrong directory?") - raise SystemExit(msg) + bb.fatal(msg) if not data.getVar("TOPDIR"): data.setVar("TOPDIR", os.path.abspath(os.getcwd())) From patchwork Fri Mar 10 20:45:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F4EBC6FD1E for ; Fri, 10 Mar 2023 20:45:41 +0000 (UTC) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.groups.io with SMTP id smtpd.web11.30858.1678481139737926273 for ; Fri, 10 Mar 2023 12:45:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XcoiOnX6; spf=pass (domain: gmail.com, ip: 209.85.221.49, mailfrom: martin.jansa@gmail.com) Received: by mail-wr1-f49.google.com with SMTP id e13so6180693wro.10 for ; Fri, 10 Mar 2023 12:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678481138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P6y8QF3Fi3E1e9PE5jehWduL3g7jCzMN9yBHJGRnKhY=; b=XcoiOnX630HQKJF3NDkkS5tlnPvplexMLC6Qh/5qcrLx0kD+YJuMjXZ5cFhuJnJRXm 3ZiEXxYwdxowhftVDbWOoFozNGiZ6CBHbz20Ksw44g7wvCpG2Qg5FCxNiKzl7zNCs+79 Mdz8IU2NG2PIgIsVihIsZsJOeaURRfHVbcJ7u4p88Dsy4mGW+Gtn/6fJwCrFQOE7SyzH 4zsETUwifqXl92GOQprP5HhuFgi+hNiok3aMq/Zczo7qEnL9cIG6Ic00ybyNzqgetMFq RSGO1oNrKev0/M2tfESC52R//Ph2YwQ7aKj9YzyVwWfmQZGTvHDPIN+GdvVMeGt31Ob7 ty9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678481138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P6y8QF3Fi3E1e9PE5jehWduL3g7jCzMN9yBHJGRnKhY=; b=GdsWlDzPyAQb6Jas3vmbWyMrPQrXsH0XhQQKhILUpodYWyZhxAU5C7OKLHWKexv255 Dfaw09uy5G9GsqZedGbMOdZwMkI+SI3FiI3ERUAEve5a25l+8olePes9VClhpUBLdA0n ohKIvBboy8FnFSyhNI2cHSEnlEWIg61s0YjmYHtPfpYEeuvIRdTeEYeEOHtQROQhzay6 2s4Jjh68H/hcE7ls67A2sjyLa3OsdY4DIZVuAsyAR/iCoqbbz98tRbfQuQxn5qVW0vIc IeSG9LjXhMRljBRwePQANB+xx3tv/ChuPwL7HqRU2gQ25X+FFL/LfU1/0bnVwwh17e89 lCbw== X-Gm-Message-State: AO0yUKWk1dUNtfw4DYJ8IAL3I/AW86z1Rv5Fsny0rtb3WHhazvW+u1SI wiGP+vt+4SztUD9HrwGWBlamBDPYVbg= X-Google-Smtp-Source: AK7set+ojtxCdEfzo3O8Odu1b34ycoYtg5sWWmnC7YOkPnoKA73XW9DvlSg+lVcemnGhAI9B/Rjd/A== X-Received: by 2002:a05:6000:10:b0:2c7:15b6:15b8 with SMTP id h16-20020a056000001000b002c715b615b8mr17016324wrx.10.1678481138136; Fri, 10 Mar 2023 12:45:38 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id s10-20020a1cf20a000000b003eb5ce1b734sm895997wmc.7.2023.03.10.12.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 12:45:37 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: bitbake-devel@lists.openembedded.org Cc: steve@sakoman.com, Richard Purdie Subject: [2.2][PATCH 3/4] cookerdata: Improve early exception handling Date: Fri, 10 Mar 2023 21:45:18 +0100 Message-Id: <20230310204519.706973-3-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310204519.706973-1-Martin.Jansa@gmail.com> References: <20230310204519.706973-1-Martin.Jansa@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 10 Mar 2023 20:45:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14542 From: Richard Purdie Martin Jansa reported that if you put a syntax error into an imported module such as qa.py in OE, no error is shown. Part of the issue appears to be that the catch_parse_error() decorator only catches certain exceptions and SyntaxError isn't one of them. As far as I can tell we should remove all the special cases and use the more advanced code in all cases, not just expansion errors. I confirmed this now prints a proper error message for a qa.py syntax error. Signed-off-by: Richard Purdie --- lib/bb/cookerdata.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py index 3555585c8..25eea827d 100644 --- a/lib/bb/cookerdata.py +++ b/lib/bb/cookerdata.py @@ -160,12 +160,7 @@ def catch_parse_error(func): def wrapped(fn, *args): try: return func(fn, *args) - except IOError as exc: - import traceback - parselog.critical(traceback.format_exc()) - parselog.critical("Unable to parse %s: %s" % (fn, exc)) - raise bb.BBHandledException() - except bb.data_smart.ExpansionError as exc: + except Exception as exc: import traceback bbdir = os.path.dirname(__file__) + os.sep @@ -177,9 +172,6 @@ def catch_parse_error(func): break parselog.critical("Unable to parse %s" % fn, exc_info=(exc_class, exc, tb)) raise bb.BBHandledException() - except bb.parse.ParseError as exc: - parselog.critical(str(exc)) - raise bb.BBHandledException() return wrapped @catch_parse_error From patchwork Fri Mar 10 20:45:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CCB5C6FD19 for ; Fri, 10 Mar 2023 20:45:51 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web11.30859.1678481141269229011 for ; Fri, 10 Mar 2023 12:45:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PN5PKgTL; spf=pass (domain: gmail.com, ip: 209.85.128.43, mailfrom: martin.jansa@gmail.com) Received: by mail-wm1-f43.google.com with SMTP id bg16-20020a05600c3c9000b003eb34e21bdfso7007319wmb.0 for ; Fri, 10 Mar 2023 12:45:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678481140; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Conf+TDC0XsUvsiTqLoRskqAoimNbhMnt9hN5mXh/gQ=; b=PN5PKgTLMl+8nfFEBmiRQuQw66L0EJf23/e2wlUelBp/UAPbABFm5BX7Z5nYGeFqzt PjDCBTt4r+qN6ukxLZ1WJ4OCLxMJKeDFbYgb71/sorbnnTJm+fCGGV6eHoGOfdU7Puyv INd2e90X2t8nBSwVfF01FKUvuk1GGzuk4/fZESgrFpQ8/wN7IeGwglD8Vv3wR4SqinYo 82eyopyPamvLyelDSYJvllzxEIFBNAIkbKanZCb6EmNvbNPY6r0+yPRE7HFQI03ijDgq zRTfTcKS2hkmBuJSd9vA7qNv57Bkr6FlaPRPeo+T9feKHi1nkL5PhBvFbFy3mSrT1Lk0 o4MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678481140; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Conf+TDC0XsUvsiTqLoRskqAoimNbhMnt9hN5mXh/gQ=; b=6wAAn7OmZaZmECdsGY2yOzjzwdQZmP0ZV/q9Qu73y8uvvhIQUS264DCDcQnHxkxI+i DP2MNUxW9TBakD/nmZnmGGxUBwW4HIs+heof0eYas6I9zkpiBh9BYdzdj9uj+UhPIWyI cao2rPdMxU3h2DgdUXmlFPuat11eEOlX6gFItnRV7aPRg4s8JwvDbUPm7XCrXrSli0Aj kRR7HvbUT3n2RnIy4kohcipzsdRLNxbP1sRpvMg7pxBdIO72KmI8ySiyNrIWW5ndYSdb hPCnvvi0AdzWVm4Iq62XM45CIUooVPVTqTDryYbm6Bwk1lO7ojECSe8ECh2H55mqzDsS jqrw== X-Gm-Message-State: AO0yUKUhNggrS8anXA+9is9/PXfXeyVeLdfbp66SM3FFaBAxWawssGGk GUIs/mEbmyNf8EBP4yq8yukkdFAKMLM= X-Google-Smtp-Source: AK7set93ERBmZOWhHpW8mxzY+BJCxrQWORR/t7AUmGhJwku6LXGeBh4VC4iy3GVGvERJBPcBP9dtrg== X-Received: by 2002:a05:600c:468e:b0:3e8:f27b:a92c with SMTP id p14-20020a05600c468e00b003e8f27ba92cmr4021702wmo.32.1678481139666; Fri, 10 Mar 2023 12:45:39 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id h18-20020a5d4312000000b002c559626a50sm670976wrq.13.2023.03.10.12.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 12:45:39 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: bitbake-devel@lists.openembedded.org Cc: steve@sakoman.com, Richard Purdie Subject: [2.2][PATCH 4/4] cookerdata: Drop dubious exception handling code Date: Fri, 10 Mar 2023 21:45:19 +0100 Message-Id: <20230310204519.706973-4-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310204519.706973-1-Martin.Jansa@gmail.com> References: <20230310204519.706973-1-Martin.Jansa@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 10 Mar 2023 20:45:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14543 From: Richard Purdie This code appears to be dangerous, it swallows exceptions, turning them into "handled" versions which then show no errors to the user. This is a pretty poor user experience and I can't see why this code should be swallowing such things. Drop the worst bits of code. Signed-off-by: Richard Purdie --- lib/bb/cookerdata.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py index 25eea827d..b4bfba335 100644 --- a/lib/bb/cookerdata.py +++ b/lib/bb/cookerdata.py @@ -294,14 +294,9 @@ class CookerDataBuilder(object): bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data) self.data_hash = data_hash.hexdigest() - except (SyntaxError, bb.BBHandledException): - raise bb.BBHandledException() except bb.data_smart.ExpansionError as e: logger.error(str(e)) raise bb.BBHandledException() - except Exception: - logger.exception("Error parsing configuration files") - raise bb.BBHandledException() # Handle obsolete variable names