From patchwork Thu Mar 26 17:39:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 84590 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 B275610A88F1 for ; Thu, 26 Mar 2026 17:39:59 +0000 (UTC) Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.53620.1774546795203407638 for ; Thu, 26 Mar 2026 10:39:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=YCllgk0e; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=75450e5aee=rob.woolley@windriver.com) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62QFhRYY3113430; Thu, 26 Mar 2026 17:39:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=eQt4eY8IPExcGucft0zFhnk8MMBhUD1afSI7NduY89A=; b= YCllgk0eRc7C1JgHVzp2rfn2CWby9KYrV/Xq8gjfO2Ce4xypXjLmaO5UewB0dNS8 DAgIAXc0zkMRatW9al8mGF4q4Cmy39MaJGlzljYd06P8p6kM8ZYjfYthMlhonN2k q0PGDx7Cz7TauEDQ3CgaLpe7qoPN/T7h7Ta01EqIwlzWxA/m45OsmtjVDkD+r7+U K+xD1iTtS52YnbnYPob8zyLzRoR3FpDCzD4bQ36FPYWtj6C1U8YRBBxtaKLsS89H Ltbxdx5to0CmWxPOOUZmCFXpHuz81iufk1GoHCCUhVg9rhryntEHJjhbi2DAmyoa vsN4q4nVQK21fIReqpmHrA== Received: from ala-exchng02.corp.ad.wrs.com (ala-exchng02.wrs.com [128.224.246.37]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4d1gj86y45-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 26 Mar 2026 17:39:53 +0000 (GMT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ALA-EXCHNG02.corp.ad.wrs.com (10.11.224.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Thu, 26 Mar 2026 10:39:52 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Thu, 26 Mar 2026 10:39:52 -0700 From: Rob Woolley To: CC: , Subject: [PATCH 1/4] bin: Move version information to common file Date: Thu, 26 Mar 2026 10:39:48 -0700 Message-ID: <20260326173951.519326-2-rob.woolley@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260326173951.519326-1-rob.woolley@windriver.com> References: <20260326173951.519326-1-rob.woolley@windriver.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: ILYaVkmwKDXxPOoAKYc8MYSwnTkIXQAq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI2MDEyNiBTYWx0ZWRfX4kV2lZSPw+Uk GhgVP+cIQYUgq06fbnRS5fuc6k5CxqGMjuUiL82vz2BM6jaI/w50Nt8L+bwrrWGTV7pxGorz+7R OQ1BptTSzaz+DXpPYyHz/1xQyU/6na7o4rwLCZ+8QUjm1s5gQgvJ7YpB4gyMwexZWrYjGx/PuMM BGUYQkOuytkg4PxgZVIrR3+78xKZNv3PzxulDF9maRs1nknjt92MC+Dw98VDoMZQgstywejpBPC HYZsQlhcphsmYt3U0pPkDMdSTIX/8RTKXOv3wPddO+rJwKjFgISKTLD8Az1O61tf169odHAmhoc 3AeJQEp9Bdsn5X26yshUats6uPj0ghk3IZgZgg6IsjzwXWh+MlW74q6CsXU3rdv6lZKrgS0TbuB 16gP+ZqcCo2zx3YMKafbIAiuADgjuuQnDLKQR1AVwIQIrVV62gQRxUfT/ukuNiR8Arzcj9DxhMa 1fJ7tNrd7eVCs7Kkm4w== X-Authority-Analysis: v=2.4 cv=LtqfC3dc c=1 sm=1 tr=0 ts=69c56f69 cx=c_pps a=Lg6ja3A245NiLSnFpY5YKQ==:117 a=Lg6ja3A245NiLSnFpY5YKQ==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=klDOsUkWDRETUCZYPvoE:22 a=t7CeM3EgAAAA:8 a=u-5W2QJJIwHLmcSTUp8A:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: ILYaVkmwKDXxPOoAKYc8MYSwnTkIXQAq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-26_03,2026-03-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603260126 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 26 Mar 2026 17:39:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19241 Signed-off-by: Rob Woolley --- bin/bitbake | 5 +++-- bin/bitbake-setup | 2 ++ bin/version.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 bin/version.py diff --git a/bin/bitbake b/bin/bitbake index a995bd665..f838593e7 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -13,6 +13,9 @@ import os import sys import warnings + +from version import REQUIRED_BBVERSION as __version__ + warnings.simplefilter("default") sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), @@ -27,8 +30,6 @@ from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException bb.utils.check_system_locale() -__version__ = "2.16.0" - if __name__ == "__main__": if __version__ != bb.__version__: sys.exit("Bitbake core version and program version mismatch!") diff --git a/bin/bitbake-setup b/bin/bitbake-setup index dcad9c169..1ea41853b 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -21,6 +21,8 @@ import signal import functools import string +from version import REQUIRED_BBVERSION as __version__ + bindir = os.path.abspath(os.path.dirname(__file__)) sys.path[0:0] = [os.path.join(os.path.dirname(bindir), 'lib')] diff --git a/bin/version.py b/bin/version.py new file mode 100644 index 000000000..1e2d585d7 --- /dev/null +++ b/bin/version.py @@ -0,0 +1 @@ +REQUIRED_BBVERSION = "2.16.0" \ No newline at end of file From patchwork Thu Mar 26 17:39:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 84592 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 D530310A88F4 for ; Thu, 26 Mar 2026 17:39:59 +0000 (UTC) Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.54428.1774546795715290472 for ; Thu, 26 Mar 2026 10:39:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=B1TjI3ID; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=75450e5aee=rob.woolley@windriver.com) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62QFhRYZ3113430; Thu, 26 Mar 2026 17:39:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=rLQ8Nr9uFg2Da43QjHPV3jIwK7YbSMC50Ns7PgC7mTg=; b= B1TjI3ID929Wa01NN1T/07FEI5N+BccRcqjOgtjaOwVd6CnXsCIUHsiMTAGAjdTs a6u+0Cg2i5aff7im1V+MIAFbiPG2hXFU13RHUlHO7nMt4NkfRlMNbgREmLUpHKV2 epMIbAqR4qtBV59XL7yOV509PoebTdw07KEUCK/j62f+Tpy2hM3Pg0qaizetmVLw UUX0agtDd3eg6bK1QWbGgR/FnJHWUhFAryB7W0tQHth86ZzDxDT4tpcm9d/YKL2M 6k2mwaeqyxxZfGyLfwYoxzVSJLYrkN8NNQudczdc1anNM0E/jbULNqKXdej3kNTJ KZz862s8yepNVtmdpTJeAQ== Received: from ala-exchng02.corp.ad.wrs.com (ala-exchng02.wrs.com [128.224.246.37]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4d1gj86y45-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 26 Mar 2026 17:39:53 +0000 (GMT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ALA-EXCHNG02.corp.ad.wrs.com (10.11.224.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Thu, 26 Mar 2026 10:39:52 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Thu, 26 Mar 2026 10:39:52 -0700 From: Rob Woolley To: CC: , Subject: [PATCH 2/4] bitbake-setup: Add version option Date: Thu, 26 Mar 2026 10:39:49 -0700 Message-ID: <20260326173951.519326-3-rob.woolley@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260326173951.519326-1-rob.woolley@windriver.com> References: <20260326173951.519326-1-rob.woolley@windriver.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: JEpPawYawXQE1_0kzTice8gPUTxzujuA X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI2MDEyNiBTYWx0ZWRfXwLIQwwUcp7dQ MCHKEoQ8iOjRg2W2f9PDjLf7csMQpIIGlNnWOYy0huV88fmQ2Wj9Z96zG2zlLhILtIzpD/GMhuc paCP0UgN9CXl5upMbaMNJFnQqPC7TLHcb0/+sy5M9VfQjoDGf3XKO5DS6nqO33v0u+StWQiC412 HN4RyZVnp+4/1BkyQDXULnMRb36XHsjPJkUCWGHNes6ExF+NdQBPVmh4czdE4JjTt68oZze5H/i R/kgdeI53jm8WiIcK18DIC6MvVaJokuCu03cJ4PfwsHAE1iGLAUiKukQwy4KO1BiEvT43bTY1Fk uJrrGQRPzoSEkShzZ1gTqmfCFzn0F7n0cSOKsng5njh0HbtEJputcgqXM3o4ulZ3B7ebotIajh4 zwNGL/US9u+D1MRmjS6Jt+HcvSevxav+ZEIC0b7lbPDAZ7vZZ1OAvIghmO9MpnX8PGq7gsZXWpp aCh/1BY6loQ+Dp1Y3lg== X-Authority-Analysis: v=2.4 cv=LtqfC3dc c=1 sm=1 tr=0 ts=69c56f69 cx=c_pps a=Lg6ja3A245NiLSnFpY5YKQ==:117 a=Lg6ja3A245NiLSnFpY5YKQ==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=klDOsUkWDRETUCZYPvoE:22 a=t7CeM3EgAAAA:8 a=3MZ2cW2_6ngPcrpQ0mEA:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: JEpPawYawXQE1_0kzTice8gPUTxzujuA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-26_03,2026-03-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603260126 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 26 Mar 2026 17:39:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19242 This adds the long-form version option to match bitbake. Signed-off-by: Rob Woolley --- bin/bitbake-setup | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 1ea41853b..b05894e01 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -1064,6 +1064,7 @@ def main(): ) parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') + parser.add_argument('--version', action='version', version='%(prog)s ' + __version__) parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR') parser.add_argument('--no-network', action='store_true', help='Do not check whether configuration repositories and layer repositories have been updated; use only the local cache.') parser.add_argument('--global-settings', action='store', metavar='PATH', help='Path to the global settings file.') From patchwork Thu Mar 26 17:39:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 84591 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 2670710A88F6 for ; Thu, 26 Mar 2026 17:40:00 +0000 (UTC) Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.53622.1774546796086357532 for ; Thu, 26 Mar 2026 10:39:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=FT5Lyf85; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=75450e5aee=rob.woolley@windriver.com) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62QFhRYa3113430; Thu, 26 Mar 2026 17:39:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=YdYcmpynxOpL9aLcDce7OhkSsSY8EvP6lNDopgBWbBU=; b= FT5Lyf85tIxlOzIzfm8BRgewdgjV9AnZHa3Zw5sh0vx/dr2SqNoEc8OSm+FybfU7 1nmozzN7W7k868OQBnVgRYQmmSEWJOI3nVwmP7hlIUD3fAdWAaQIgoAZzduak/LC 2dKDJ5Fe0y5x64+YSj/qp+AeH6Pvy2piCSYCiJud+GBdk9rum4fQxCDv5xg+Js1t wE/jgq7qwot9bAOwsppGyTwB+otWsKQVcV3ZzL4NyLWBDPgSQQPe4LcrTlVe1d9t xcXextwXZZdCHs/CFHrZXwq67L0ApI7R6zZB+Iwb0tHVJCPdLoT/KPEBb6orjdV0 eWDryo2rm24BBTs2kDrfpw== Received: from ala-exchng02.corp.ad.wrs.com (ala-exchng02.wrs.com [128.224.246.37]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4d1gj86y45-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 26 Mar 2026 17:39:54 +0000 (GMT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ALA-EXCHNG02.corp.ad.wrs.com (10.11.224.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Thu, 26 Mar 2026 10:39:52 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Thu, 26 Mar 2026 10:39:52 -0700 From: Rob Woolley To: CC: , Subject: [PATCH 3/4] bitbake-setup: Add the conditional script stanza Date: Thu, 26 Mar 2026 10:39:50 -0700 Message-ID: <20260326173951.519326-4-rob.woolley@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260326173951.519326-1-rob.woolley@windriver.com> References: <20260326173951.519326-1-rob.woolley@windriver.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 0q_1hrDarUSIVvheaHiOsrxHRBWqufCB X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI2MDEyNiBTYWx0ZWRfX7HZTzSeYqBcg xF2PnxDbVUHH17xOfy42jcfrfmTg0s1fQiO+jXKzuJNXhGvX54w0mMbbTAkIfpTYZ9/Frw6Cjf6 h8UBQLn8jUtfkuXl0KfJL9bBiHP1dYzI7ybAOU1UjGvYOndtxdpSsHKq9dTC451k+CLYNrCA35x YCfuoeo2kapKXozpd4w3xKjtknzgRkTOmt4AfontwxEHTADqbuy9Z2/YnyoS4m6BcpS3Ju/yqae AXqWoOmcypm2Z6tBq5A8kJLVk6B9rSOuWNLJksk9I5dkXF+yvFbroQ9O385u8KVoXyW5QqBcXLH TJmuVhRumT89/o5wzD3Oj+QYEbBObA7Scr6KkRFDBsY9C6hFtzFhk1VQQEUXeI9fllPV1KcC4UF RAVZX3b2w8Kt/mjufSSBMzSwPA/BWF/7pfA36i6NMesfcbRCbrmDKQjILiTX3b31RvjhPC6J7tj Df5+Bvzu8mAbymvwAKg== X-Authority-Analysis: v=2.4 cv=LtqfC3dc c=1 sm=1 tr=0 ts=69c56f6a cx=c_pps a=Lg6ja3A245NiLSnFpY5YKQ==:117 a=Lg6ja3A245NiLSnFpY5YKQ==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=klDOsUkWDRETUCZYPvoE:22 a=t7CeM3EgAAAA:8 a=f1Ed6B2-FHGrvtuZyGsA:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: 0q_1hrDarUSIVvheaHiOsrxHRBWqufCB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-26_03,2026-03-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 clxscore=1011 impostorscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603260126 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 26 Mar 2026 17:40:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19243 This ensures that the main function is only executed if the module is executed in the top-level environment. Signed-off-by: Rob Woolley --- bin/bitbake-setup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index b05894e01..d7e2e187c 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -1192,4 +1192,5 @@ def main(): from argparse import Namespace parser.print_help() -main() +if __name__ == '__main__': + main() From patchwork Thu Mar 26 17:39:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 84593 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 EDC7710A88F4 for ; Thu, 26 Mar 2026 17:40:09 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.53626.1774546801424267718 for ; Thu, 26 Mar 2026 10:40:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=VCravLEW; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=75450e5aee=rob.woolley@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62QFi7nI4072289; Thu, 26 Mar 2026 10:39:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=4cEj7NXsdwm1kIgYKgs5c+zNf4kUbQukbzhP1GkWA3Q=; b= VCravLEWPGlsfZC0rRgOSsz2sbAhtOIJBxXDA6stI1dRTlCBa3NbTpcC9k8rLIb4 sGuUrRUrlionOv82vd7mLNru4vZOlQATp8llkYWUZsY7g785jc9aRC3zIW314vMt 8EHIlH09Zl4FV8sZENGlYbYPsnk9ZmKScMSO4QgajY9gjk6tNqzrVpTMRvwaBMgO BtSUPtKjy0I7fAC6oOpsnuzCUrgkM5NzobrFhcRM5O0vqoQjGek7huNfNsDq7Dqp XIwxzMTdaS+Idp9HdfI5gpeS7klvHY/mHj38ASpK/mvDif7NpvPoS1ul35o0ymE0 JOBsNDUOiniqQQ/3SukNtg== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4d1pkyes90-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 26 Mar 2026 10:39:53 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Thu, 26 Mar 2026 10:39:52 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Thu, 26 Mar 2026 10:39:52 -0700 From: Rob Woolley To: CC: , Subject: [PATCH 4/4] bitbake-setup: Add version check and catch exceptions Date: Thu, 26 Mar 2026 10:39:51 -0700 Message-ID: <20260326173951.519326-5-rob.woolley@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260326173951.519326-1-rob.woolley@windriver.com> References: <20260326173951.519326-1-rob.woolley@windriver.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI2MDEyNiBTYWx0ZWRfX+gq+X3WxdPa1 BspDXanvCQPMATvfbM2c8GlXKMJDAB/IpRnlRnqEoKzKojgNjU6oAfGlmP6iEgwYCZ9+mDBN8eH De+fGvZQJSLr9MwexpOECw9wzI34Ijp7MGNkGYF1/Pe3yly8WmqL9enGryasXQxd1dWBftDs0f/ ei9Ob80zYvJ8Hfti318nfyMK4X4huFI8PSB6pM936m9gOaAnZQmOTE7SrcpfFHiOYzaKJBgh0wV RRhCCqaeIfCCyZwCyQEQwMn4TVBMTRT/F+xPzLMKvdjM/8Qr7D1Ahs5PmH+DjSZ2O85l6TXWoKg 45dbqsF8wF+Af+dRT8Wsfb68ksinm7fLLPsyvQtyuYXrvZ30/4kiqSrH0RlojnyTEVUweOWmRl0 HTIk+O32+x9MM7eFlbX5NaxVIJdnyw9kArJlI1/faZSNstOC6QxdKNHPw0B3f22p1RkBIFdqhOY 5MoGGFWwNfRWvmk0msA== X-Proofpoint-ORIG-GUID: weR1f7lz2Kl2Yjp7LMFoKpJUxY0M9_Jz X-Authority-Analysis: v=2.4 cv=Scr6t/Ru c=1 sm=1 tr=0 ts=69c56f69 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=HK-ge7EqtdluswH-FwHe:22 a=t7CeM3EgAAAA:8 a=UlQryPpcJGEf9TBE9sIA:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: weR1f7lz2Kl2Yjp7LMFoKpJUxY0M9_Jz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-26_03,2026-03-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 lowpriorityscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 impostorscore=0 bulkscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603260126 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 26 Mar 2026 17:40:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19244 This modifies the conditional script stanza to match bitbake. It adds a version check to ensure that the correct bb module version has been found. It also catches any exceptions thrown during execution. Signed-off-by: Rob Woolley --- bin/bitbake-setup | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index d7e2e187c..65c38b4f7 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -1193,4 +1193,11 @@ def main(): parser.print_help() if __name__ == '__main__': - main() + if __version__ != bb.__version__: + sys.exit("Bitbake core version and program version mismatch!") + try: + sys.exit(main()) + except Exception: + import traceback + traceback.print_exc() + sys.exit(1)