From patchwork Fri Mar 10 20:45:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20773 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 536EAC6FD1E for ; Fri, 10 Mar 2023 20:46:11 +0000 (UTC) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.groups.io with SMTP id smtpd.web10.30843.1678481168569897903 for ; Fri, 10 Mar 2023 12:46:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aBPNs9p9; spf=pass (domain: gmail.com, ip: 209.85.221.52, mailfrom: martin.jansa@gmail.com) Received: by mail-wr1-f52.google.com with SMTP id t15so6192796wrz.7 for ; Fri, 10 Mar 2023 12:46:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678481167; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=J+wr0y+3hDTDN/eAqmRT5JAzd57gK4wzuxLBf3VOBxc=; b=aBPNs9p90QIvHWNySLUjR2qmPCKTJLvC4mPxct/AImjdqVVvfyhk/wkChsTrRbaSxJ Gedtk28xZ5THEfkpGzIUQCBvmo2JmoLS2zR3gwCtv1OeVwDxtj9YqpyxpanwvtyqSwcX k3U9AKuCLcVn1Fws2iUAyphsnXz3QTIuGfOpDQ7RJZHe+QDI09OgjF3P3ZhwOstJBoTR P4CO1en0dls8lBBH/2EXJkiP1S5r2q5dRR8xVQ4utLFEu+PZBRDW/felhfpAQsvJIYKw rJvO7Mg/mGu/t7OYpDUUFIDwYgO2YXzAXuHpe4A0PMG9R1PJ8Z6p6aAU0nh15eIr4qY3 F8MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678481167; 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=J+wr0y+3hDTDN/eAqmRT5JAzd57gK4wzuxLBf3VOBxc=; b=jKeROc7XBKz4XI/d+0tAvfLikt1fb7oXPBfdhAohM0L6N6EOQjXWiKX4tORc/XiVY1 L9rO5gSS8FFQh3WnEklIgjaPOp5bnuG3rimrHiAjwIFYVMUyTEpzV/WuJNqZbU7FIN8D JIlIm0dhPL4e1SpBAzEMwAypwmUO9skxBgcSoAjwXdHI2IWhG8WPvbXwWqokhHeW/e2B DdU+VoOqWenR70Kp5QliLOnpzLDFDbijuAXI0tEcAKy6OypxbnUzjKzLlyRB9gIf4VQ8 WZjs9ZCs5xjPkmT+IE5ViX/AMyJOhs+XyAIIgHBqAW/HOrRHbcAtdVJ/DEQfAkcYi+VE XUxQ== X-Gm-Message-State: AO0yUKUMvkzA7UZYUxBJk2UdKwBKb5SxXUVRl6x7zaTQAqaJe7doDcc8 lxSvNwyDlRJmqaXjRzVO6+RzM0CouZA= X-Google-Smtp-Source: AK7set+X/Xq2X/HyJ6xRXCV4P01Xp3wPJnXsYa4I+hYmFVaxTSstaxZbp8Nesng8pYQ0phpvJttAlw== X-Received: by 2002:adf:eec2:0:b0:2c7:4ec:8d79 with SMTP id a2-20020adfeec2000000b002c704ec8d79mr19541366wrp.21.1678481166898; Fri, 10 Mar 2023 12:46:06 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id a7-20020a5d5707000000b002c54f4d0f71sm676929wrv.38.2023.03.10.12.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 12:46:06 -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.0][PATCH 1/4] utils: Allow to_boolean to support int values Date: Fri, 10 Mar 2023 21:45:58 +0100 Message-Id: <20230310204601.730833-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:46:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14544 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 bca4830f2..cdb3c6864 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -990,6 +990,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:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20772 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 53674C6FA99 for ; Fri, 10 Mar 2023 20:46:11 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.web11.30870.1678481170380874227 for ; Fri, 10 Mar 2023 12:46:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oKdLhQ6d; spf=pass (domain: gmail.com, ip: 209.85.128.50, mailfrom: martin.jansa@gmail.com) Received: by mail-wm1-f50.google.com with SMTP id az36so4263531wmb.1 for ; Fri, 10 Mar 2023 12:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678481169; 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=9JiTWM+MdCg9IOgA/X0u2f0T1rgZVeqO24TUedvTmmc=; b=oKdLhQ6d1DanPOBLWcBI4rFzgWSoxpnlgfxNUbD0DvwCEX/EsF6Cz0P/UN8ML3uFVg k6+XmKUuEtUctzmk91gJBecS+wk/Qhft53PWUPoO5z2px7xhe2EAOh6SVewbcm70gKkR 2sCp8KSNUi7vE0EPJuDufFz4RcgXmrMHqG0SAvBV/fu6xNgAsLU3YrWnZR2uVNwSJPZh 27KcfT6WAo33LsVa3I5dU3NX1accPtJptXcUHwO0+aHQpUoudkXemdJLUE93NHZxuOCD ZwJNujT56w2QUJ168QylwwjTcv9hyhq8IlvsuOXV1mmlx2u/RFipumnuR3BE0y678Dn/ a95A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678481169; 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=9JiTWM+MdCg9IOgA/X0u2f0T1rgZVeqO24TUedvTmmc=; b=UehTQeECOG+1R2AU0k/tkLoBA++dxriCPN2pABN4RTa5/ptojxyhaI5zJTp2VU0mSz uCB6xFSO74bKiOo6QT6UDi/95UdXNRD1ZJk2Sv1B2BgBzD+0+Kr4SyKvGljDhj29iaXI iZp2uA9i9iCYAKYsnRejH3ysA/PBdQ4UgNbz+kReTlxndWJ50NdEU0+uLn13vmOenaHU m5VgTnG81uD06CF54OivT1inOWy02zmslgMER11kE/jetffYb7iTsE4TPZqZYu4UUWaN 5oVyEWhmHtpTrrcGEiZZYZ62Ech7bQaifongNJvp6tNvWMXGevwaUK+ffvSoxNvfln1X ZxfA== X-Gm-Message-State: AO0yUKVTe5jtHlsCZGzsHcG5CN7nmaY6VadlLWbF+KQ3mbsA9exYkW+O /nv+5kjjbEoTQlbmyzMavvMHJB2PNr8= X-Google-Smtp-Source: AK7set8e9aHS66qEijLPrSgjb0p1ENJCJUISu//DTDwg5qsamOKPiPiIbIlHHU8JVjneCHV+4u0ErA== X-Received: by 2002:a05:600c:198e:b0:3dc:42d2:aee4 with SMTP id t14-20020a05600c198e00b003dc42d2aee4mr3999503wmq.25.1678481168873; Fri, 10 Mar 2023 12:46:08 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id k12-20020a7bc30c000000b003dc522dd25esm861432wmj.30.2023.03.10.12.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 12:46:08 -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.0][PATCH 2/4] cookerdata: Remove incorrect SystemExit usage Date: Fri, 10 Mar 2023 21:45:59 +0100 Message-Id: <20230310204601.730833-2-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310204601.730833-1-Martin.Jansa@gmail.com> References: <20230310204601.730833-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:46:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14545 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 fe5696c70..efa671aa0 100644 --- a/lib/bb/cookerdata.py +++ b/lib/bb/cookerdata.py @@ -435,7 +435,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:46:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20775 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 540E1C6FA99 for ; Fri, 10 Mar 2023 20:46:21 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web11.30871.1678481172022217925 for ; Fri, 10 Mar 2023 12:46:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N7zFyMi1; spf=pass (domain: gmail.com, ip: 209.85.221.46, mailfrom: martin.jansa@gmail.com) Received: by mail-wr1-f46.google.com with SMTP id j2so6177891wrh.9 for ; Fri, 10 Mar 2023 12:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678481170; 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=Q6RU+VIYMT5575yPXmujdQFQJ8D04u0PjkQaCVacV6E=; b=N7zFyMi1IYqN9va76e0GMROryDXPkStdP2m7i9oKhpsQY3/4XPPq+kpefC0jcbLupc 2Ansrp/A3QFNlFcPriomPJX2fHKR44XR5UfxLUSZQh0vRdYbQJLyhZd+77ltriC/MDxt vqz6GUCtIxur1ZYv369/V10a9eV5aLKMiBMbrz0VkDBlCqvmzu77CyWZNKle6+9zKoD9 0dlrUgqDerT+AuyolMEE7IrPwYMi0sVr1ARn9Gouo48U/a4hMqcw4bhuoz7vuFhOCWZn QAkBuUT9ILLHIG7BC9lFW1ZdlSJJZPvikki8WZQg6taiNXukf+Xkm2+I3QL2aYt2o62X IxXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678481170; 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=Q6RU+VIYMT5575yPXmujdQFQJ8D04u0PjkQaCVacV6E=; b=jwEodk48EaSAFjJmk9qkp3qM6e0ogG2jRBY0eTBiixBmU+iGjBcq420zqQC/M+CVVJ 0Glr448E7pLpnsTtW71UemSasDP/lnZX8FboCTqqBIquwAPIhlUOu+zHm3dunmDJJAdk A3brLnUt6BEei379115k77YtV6sNZBYvArGEwqkfeKWzIROpqqZLJHDr8sowYMObLac/ r48Vm6n7vxcMcByoV0ffESzo3+3EsxZ7QYWEJLBJy44/ZtwVw40y5PnXEJCOBw0ZvNB3 BaYZcRbGT74qdWy0dEz6RsoC6Wrn2p6TgWQmmko8+Rrqlo+9BRRCRG+EZAyM7kB3Ashh GXtQ== X-Gm-Message-State: AO0yUKVrOvDTTVbjL/v0mOm2FPutgk2H/JZyLMyWBokLiLW0pSlLfIus rNbgfbY0pValjhOTePWJmOeyaukM9ro= X-Google-Smtp-Source: AK7set//1lZbC17/wnTYGEU+CnXSmKCYtjF3+oz1TMugOzwuDh2kaepALK1V/DvIW+YnlCbjBz1JZQ== X-Received: by 2002:a05:6000:1146:b0:2ce:9f35:59c7 with SMTP id d6-20020a056000114600b002ce9f3559c7mr332493wrx.45.1678481170531; Fri, 10 Mar 2023 12:46:10 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id z4-20020a056000110400b002c71a32394dsm647040wrw.64.2023.03.10.12.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 12:46:10 -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.0][PATCH 3/4] cookerdata: Improve early exception handling Date: Fri, 10 Mar 2023 21:46:00 +0100 Message-Id: <20230310204601.730833-3-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310204601.730833-1-Martin.Jansa@gmail.com> References: <20230310204601.730833-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:46:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14546 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 efa671aa0..e2dbb3b21 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:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20774 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 4BCF1C6FD19 for ; Fri, 10 Mar 2023 20:46:21 +0000 (UTC) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.groups.io with SMTP id smtpd.web11.30872.1678481173328163688 for ; Fri, 10 Mar 2023 12:46:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fRHuceKM; spf=pass (domain: gmail.com, ip: 209.85.221.54, mailfrom: martin.jansa@gmail.com) Received: by mail-wr1-f54.google.com with SMTP id v16so6254166wrn.0 for ; Fri, 10 Mar 2023 12:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678481172; 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=LtiPxARjG/iCR3iGNMp3/OwF5gaSaHgbThLq4Wc2mdY=; b=fRHuceKMzBUkvIJXsv3wMWxPCjOxMqwMUgPJW61ABzt2CLzbqak3uuVV6vSYnnDqb/ /f1+4D9LPBccoUPBSUqNV9GiCmk9vndt5rRj9nsrC+ZCf7H8kfN5Zk88oaWwZim3njp1 +yqL/EPapgG+ZUyKFtSy6GvR5zzRj/nYCkeUxbHrfqv3PQTTrY7ON6nG47deJxYOJHoH sHUJ2rnDSfiauX/xcmby7e8HUqSveD0sPBVa42RISNP0oiA16Y0faf4HGS27QbJMEWPo Gocw+Dh3xaCpjodmuzwkQ+oHxwe1Xbg+SyFLGcGd/cA3STv0UzA1DtBd9Zva7k3QrR8h p22g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678481172; 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=LtiPxARjG/iCR3iGNMp3/OwF5gaSaHgbThLq4Wc2mdY=; b=S1P9ehhEx8Eu0dluaQjcFUI+GFT/PIgn5CtV4BZ37R8fTTPD04XjdtvomsUXYZfkq0 ijUj5jrcisvSQ5fiQSK6g545w8Bzx3MrsTJUcu5FcKjCcLM+0uvEgcjeh56JNLNHWt6V xUOUQkvYXcjBdFT0VNJk2kUTM27bdadAHl8m/dEV9qgwwNxH6/VCQ6k6Df6N8TqNJtpu HNvLCjJMmIibJvXhoLKY9TjKhkq/mBOeF7CG18AIkdWodb5HJajLodD9A1T7J/UhxO/T t4cgQUhiy+xKh5UpRn3KNh/ExzK/4SeqmJmsC6WjnX+HdWS82spwluKoILgVI8OsoTJX dP5w== X-Gm-Message-State: AO0yUKWnU49EKYszjKV8O96qF4iopf84spe3dPGWR9YJN4xzp0Q4OY+i YpEB6Gn/7qQyFd04jK4aN0AEpPRl1lc= X-Google-Smtp-Source: AK7set84JqzzreVhTJZNklM/m/jBcKfjnSoAEM23foz4XJRv8oLPMBksahCR9YR38zf7fOWfGxJXbg== X-Received: by 2002:adf:d0ca:0:b0:2c7:3f9:7053 with SMTP id z10-20020adfd0ca000000b002c703f97053mr17533127wrh.52.1678481171887; Fri, 10 Mar 2023 12:46:11 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id o13-20020a05600c510d00b003e20970175dsm995868wms.32.2023.03.10.12.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 12:46:11 -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.0][PATCH 4/4] cookerdata: Drop dubious exception handling code Date: Fri, 10 Mar 2023 21:46:01 +0100 Message-Id: <20230310204601.730833-4-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310204601.730833-1-Martin.Jansa@gmail.com> References: <20230310204601.730833-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:46:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14547 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 e2dbb3b21..ec3741cc1 100644 --- a/lib/bb/cookerdata.py +++ b/lib/bb/cookerdata.py @@ -293,14 +293,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