From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7101979564966936576 X-Received: by 2002:a05:6808:21a5:b0:32b:8da0:1c23 with SMTP id be37-20020a05680821a500b0032b8da01c23mr619069oib.195.1653558473898; Thu, 26 May 2022 02:47:53 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6871:4048:b0:f1:f7a9:be1e with SMTP id ky8-20020a056871404800b000f1f7a9be1els8591286oab.6.gmail; Thu, 26 May 2022 02:47:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL5Q54cyKSQ1IAqASLxZQuIOmxqRtbFUYzR0xwphuiMeyZr1aYwi3H1CCEC+HG693tl61Q X-Received: by 2002:a05:6870:45a5:b0:ee:1742:1be3 with SMTP id y37-20020a05687045a500b000ee17421be3mr653451oao.170.1653558473332; Thu, 26 May 2022 02:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653558473; cv=none; d=google.com; s=arc-20160816; b=tXI98eaVODTIUhZDFp3K5n1PWjOEjFIq6ylLJwSeGrYngzu3w9WqJkg0wZTK5l0VvZ qAwpqJD34Tz7vVoP4+Sx0COK7c4HCM9jGBK60GzUp7ro5PmNxoOaUsVsMb3+324P7G1e B2HmH33DJvYG4+WG1GOkkfGaXT2HqlJySKpJ94BL/5gYzvPV/n6P2MVoUY0J5Pvzf5OM Xqb+has2uZ0kSUcEYtgAsXqKZil4N5tAUlswHJnKYicufhVybYAyMa1/hSFgBMU2iRbL PjFdpC9P0EBVXYsc0Ma5pDJ4eSaEmNHPEKA+VXNH5ZQTjWVCPhUK8PezjyS7Y1ebMIm6 k2rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=4UkvT7NSEj/WQLK2JnbxyhLpCnD6U+tdjMEHugo1Sbc=; b=AwT8arVtI4PkD8ndlg1VEd2tRkctWqxP3zhwRMTzih95cF/4VrUC43LFa8UfEzFpCQ +foG7/5du/NQrD/ti8mvMPGAiYYQ3MwlMKg/yPPAm7xy8zqNZBGzpKuC9ikjSYwU5BbY moH3FNioFtiVN+xDNy6N566Tsgpu0PmV1TgjQfreeF33kPIwqfTlwn7AGsd0aVQXrUg/ u/Z3+VZ2C72m/+k4WpCTwfYfdyAvv4/3TXFmmB2RiMT8aHdEZ5mcv0C74TStAxGTIkhY 0IlPzfJok8Zt1eEAdr1omzQ0kiuvNZlzECgV3NESuuJw9NTT6bPwk6fGxwZGZr0N5v2d GgUw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id w24-20020a4a9d18000000b0035f627c29easi58133ooj.1.2022.05.26.02.47.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 May 2022 02:47:53 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from localhost.localdomain (mm-66-57-214-37.mgts.dynamic.pppoe.byfly.by [37.214.57.66] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 24Q9lojT006977 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 May 2022 11:47:51 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH] utils: Ensure shell function failure in python logging is correct Date: Thu, 26 May 2022 12:47:39 +0300 Message-Id: <20220526094739.6340-1-amikan@ilbers.de> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: rL4PXIVKTSYq If a python function exec_func() calls a shell task, the logging wasn't working correctly in all cases since the exception was turned into a BBHandledException() and the logfile piece was lost which is handled at the top task level. The easiest way to avoid this is to allow the ExecutionError exceptions to be raised to a higher level, we don't need the traceback for them. Backported from Bitbake 2.0 upstream branch: https://git.openembedded.org/bitbake/commit/?id=7cae11f558f9ff5fd05ef23b789aaef92fb5a327 Signed-off-by: Anton Mikanovich --- bitbake/lib/bb/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 2a150fe..74cbc69 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -401,7 +401,7 @@ def better_exec(code, context, text = None, realfile = "", pythonexception code = better_compile(code, realfile, realfile) try: exec(code, get_context(), context) - except (bb.BBHandledException, bb.parse.SkipRecipe, bb.data_smart.ExpansionError): + except (bb.BBHandledException, bb.parse.SkipRecipe, bb.data_smart.ExpansionError, bb.process.ExecutionError): # Error already shown so passthrough, no need for traceback raise except Exception as e: -- 2.30.2