From patchwork Tue Sep 16 00:06:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 70273 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 BD116CAC59E for ; Tue, 16 Sep 2025 00:06:59 +0000 (UTC) Received: from DB3PR0202CU003.outbound.protection.outlook.com (DB3PR0202CU003.outbound.protection.outlook.com [52.101.84.69]) by mx.groups.io with SMTP id smtpd.web11.7739.1757981218827481457 for ; Mon, 15 Sep 2025 17:06:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=DZ9B63pK; spf=pass (domain: axis.com, ip: 52.101.84.69, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JQSExVguUuRJJITFqljbhJ/3+b7gKPjdbxm+K1aH47gj4RbCGZPCugzVrH9/79/M6h4O5Adlv1C6w+vqaO5hM8XB4ejY1bFkpif5Mfci3fDQtlyhbMTMqYMMmF3PBb+j/l5y8CSVniIMuBblpCNV4qUbrN04syd49j3+NFNtGQ11PYNOrwrlMicNoJFl8bdBsmp/CP2Stexek56+zp9g77loCxuJtuQBv9YOhy2PhIVMXgGEtePY+mBhn40L4uJWji/IZmM4qU3ZgbVvX59Ov3SCq3DzUTdTjCSjvybj5iYOc09ujkXRBZdoATVIHBJqgHFrkUREHZ9XHQAi/kNkiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bZFEsP89gCqCDDCj8wahYbI+8u72HQ3LEvDlAXxXERo=; b=TVLwFY+J0BwBeOGf8hmqyAQpjxQ1T7EY0cBxqY1zdxhD23QqQYDUAGpvuhWs1HgnTfcUl5rBsFyUqn4t8ylBFq+JYfdu4EQXwUPIGRlvypOloeRdWOPH9ndZNbqEsEDXUo1iofK3YRhJSkiZto7OOlhScESXLYXH1HbabU4KksqOULS6BEMp9MXF8lPBWLTAIJjy6rKwRACNWd1UAMmibTt0K10nDzMa0lbk5TYQ7v3ZPTh+R3jde7vpZOvWnzRsyRe+f3V6CM6P38qRl8zlMKh8wLb0YV64dXUQLZiYb4WOTIFPfMj60ZcXTvx4ywMyWlpbXyWt1nYAZPtzNKk/2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bZFEsP89gCqCDDCj8wahYbI+8u72HQ3LEvDlAXxXERo=; b=DZ9B63pK0jADzG0TI89ec0ktgAUjMvL0ucKEVjosQAjPCtJl2PlUAVtDBbg07XQg2r2QWd1xV+/lMGlj/o4pyrsnBO787nXwvMRhXFQQj2mkyvbS2Z0ptsHNm7KBTPv5wSXua/Y8EW05G0ulrVtWlHnKtoRLJg/mSXn+lAo+Vyc= Received: from DU7P251CA0003.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:551::33) by DB9PR02MB7305.eurprd02.prod.outlook.com (2603:10a6:10:24b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.22; Tue, 16 Sep 2025 00:06:53 +0000 Received: from DB5PEPF00014B8F.eurprd02.prod.outlook.com (2603:10a6:10:551:cafe::e0) by DU7P251CA0003.outlook.office365.com (2603:10a6:10:551::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.20 via Frontend Transport; Tue, 16 Sep 2025 00:06:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB5PEPF00014B8F.mail.protection.outlook.com (10.167.8.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9137.12 via Frontend Transport; Tue, 16 Sep 2025 00:06:53 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-mail01w.axis.com (10.20.40.7) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Tue, 16 Sep 2025 02:06:52 +0200 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 17F4B26BE for ; Tue, 16 Sep 2025 02:06:52 +0200 (CEST) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 849BC120468; Tue, 16 Sep 2025 02:06:51 +0200 (CEST) From: Peter Kjellerstedt To: Subject: [PATCH 1/5] tests/parse: Use with statement to avoid ResourceWarning Date: Tue, 16 Sep 2025 02:06:44 +0200 Message-ID: <20250916000648.1182372-1-pkj@axis.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B8F:EE_|DB9PR02MB7305:EE_ X-MS-Office365-Filtering-Correlation-Id: c6582877-87c4-4cc7-a7c5-08ddf4b4f14e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: v0VSr9PAw6rDv+2AHqNhpp2QGrrsjtjN9GtW3D1zgLNGpE7viiXsxoBWNbiOKcJ4tM5ln923RX8xOSpTEMn+SkdZkZw5KyyoW/gke1uqKAtAMYRbEwhHH43/9cHf4A8ZDBr3HHytl6gsDaCOouSkWdUWe173g2n8HzJkf9/2+AiCE75SQeoExz8DGD4d2cHRd5y9SOCKx7elcw4s8A5U+8tIoV0yOlsXArFpjWP0/0QVjvs8RIMoz3gFeoo1X19U1EbbvxmdooZzd7gBAwoJB010JND5lq3gLdF5xWstMlVump6W3+V6TljBfhZY9XvSdEBvKSG2Wk80nzEKXCGFHYUQ3KSXg9IKowVHY5XPRo0bJHX6bZlzsIqcwy0WFZl4TQy9iKJSTi4ixNwOOVcbisDFfGE7MUZ/WfIxSP2Dwf3DBVOtOaO8snQx29txlkIwjdZ5zaajcEya+xb6zs/hRZgrXXFWW0+8jlBaSraUgbcekwDELwzdVQEfzEvDNijC9RIs/vKiuGXhzdrMoAztw2DB1fBBcocFsrTG+ZhqcvAjnXalih3Sk360jZxCbKi9VSjnnSHi6J0RZ21DZI/3XWGkbisl9N/eODb3mxQ9wsp07UGAeK23k4hFRidcfvu3lK6o5qS0cNhl2gSDq0eZPKbO6MJV0iypeVNamy1NHh8bUPhrnvKd+TBHTZLiHYsKOvz0MjmMiP7Eh7wdaG4x3E8x48lrxS6S4jSVfs7FIrRl+L6F4PIL+qZFf20wTRXUBtPgjsCqb8zdyLasjOwgnnidYpRi/Gr1A+BYvFUCBghHYWQj8a5fK30bIl+mW1nLuMU7Im4dG3OwgDTx6pzORCS/56hOC2NuvCcaA3dbMOyt9v/jZ3QCDybUuVkwJj69KlGX5IeYqTjl4/ppnJzXmDaVSt9uUKkuY345GaBN/snTylkO6p3/61IVWORhszA4DI+qvpq2iWyAYFpMXZayW/2vRw/65mfYXKuR4gaNdpeHG7xkw0l//rJSxRkO13eWCAkj5zSNIbmQmYIOxRNFAdz4yTxAx4Gos0HPm3s9ebiirilLl8bKcAMbjR8y8Yg/T3SznJ5ejLLuYfHPnINRZ7H55HO+XeHsnNCBiyIZzpFxR/NZRq+9Gkaz+fcPI5tT/SD9ph5nUY9JHuVV45ZQK1L9vyt96SIx41NZms6O3UvK3zyhiQdcDNjxbbAbQ9gKq46yIkPP3ybkhu4ehIPu4DXMdEx7nenVZT5ZP5ZYf0yzQXxFXdMNBcKCiMg4nGe1amAdDmkshEaWqIFB835P8EsKpB4bwOVATuxqv4CQUYhCZKZA+ARlm01L5MjRzB78PNcsmYCrd6mCgVxwq+Hd52hRZTfKPOIs/VYTrpoUCB59mf7waAYWjMsdD35R8SPE3CLo0SEaK/FFM1KmAOx0CqSBBSbq/z34ndQTMe95UyJFa9tKWl4FHuvQjHgytM87Y+Y+I/eY3j0LaTdHbhanvJk04G3OxPeVeJYaDeNwn+oMqRIfcgOBBc1R3ATASeTB X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2025 00:06:53.5732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6582877-87c4-4cc7-a7c5-08ddf4b4f14e X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B8F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR02MB7305 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 ; Tue, 16 Sep 2025 00:06:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18040 Signed-off-by: Peter Kjellerstedt --- bitbake/lib/bb/tests/parse.py | 95 ++++++++++++++++------------------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py index e3cba67ad4..b272739f56 100644 --- a/bitbake/lib/bb/tests/parse.py +++ b/bitbake/lib/bb/tests/parse.py @@ -39,7 +39,6 @@ C = "3" os.chdir(self.origdir) def parsehelper(self, content, suffix = ".bb"): - f = tempfile.NamedTemporaryFile(suffix = suffix) f.write(bytes(content, "utf-8")) f.flush() @@ -47,17 +46,17 @@ C = "3" return f def test_parse_simple(self): - f = self.parsehelper(self.testfile) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.testfile) as f: + d = bb.parse.handle(f.name, self.d)[''] self.assertEqual(d.getVar("A"), "1") self.assertEqual(d.getVar("B"), "2") self.assertEqual(d.getVar("C"), "3") def test_parse_incomplete_function(self): testfileB = self.testfile.replace("}", "") - f = self.parsehelper(testfileB) - with self.assertRaises(bb.parse.ParseError): - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(testfileB) as f: + with self.assertRaises(bb.parse.ParseError): + d = bb.parse.handle(f.name, self.d)[''] unsettest = """ A = "1" @@ -69,8 +68,8 @@ unset B[flag] """ def test_parse_unset(self): - f = self.parsehelper(self.unsettest) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.unsettest) as f: + d = bb.parse.handle(f.name, self.d)[''] self.assertEqual(d.getVar("A"), None) self.assertEqual(d.getVarFlag("A","flag"), None) self.assertEqual(d.getVar("B"), "2") @@ -113,8 +112,8 @@ A[flag_default_twice] ??= "default flag first" A[flag_default_twice] ??= "default flag second" """ def test_parse_defaulttest(self): - f = self.parsehelper(self.defaulttest) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.defaulttest) as f: + d = bb.parse.handle(f.name, self.d)[''] self.assertEqual(d.getVar("A"), "set value") self.assertEqual(d.getVarFlag("A","flag_set_vs_question"), "set flag") self.assertEqual(d.getVarFlag("A","flag_set_vs_default"), "set flag") @@ -136,8 +135,8 @@ exportD = "d" """ def test_parse_exports(self): - f = self.parsehelper(self.exporttest) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.exporttest) as f: + d = bb.parse.handle(f.name, self.d)[''] self.assertEqual(d.getVar("A"), "a") self.assertIsNone(d.getVarFlag("A", "export")) self.assertEqual(d.getVar("B"), "b") @@ -149,7 +148,6 @@ exportD = "d" self.assertEqual(d.getVar("exportD"), "d") self.assertIsNone(d.getVarFlag("exportD", "export")) - overridetest = """ RRECOMMENDS:${PN} = "a" RRECOMMENDS:${PN}:libc = "b" @@ -158,8 +156,8 @@ PN = "gtk+" """ def test_parse_overrides(self): - f = self.parsehelper(self.overridetest) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.overridetest) as f: + d = bb.parse.handle(f.name, self.d)[''] self.assertEqual(d.getVar("RRECOMMENDS"), "b") bb.data.expandKeys(d) self.assertEqual(d.getVar("RRECOMMENDS"), "b") @@ -173,8 +171,8 @@ EXTRA_OECONF:append = " c" """ def test_parse_overrides2(self): - f = self.parsehelper(self.overridetest2) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.overridetest2) as f: + d = bb.parse.handle(f.name, self.d)[''] d.appendVar("EXTRA_OECONF", " d") d.setVar("OVERRIDES", "class-target") self.assertEqual(d.getVar("EXTRA_OECONF"), "b c d") @@ -186,8 +184,8 @@ PN = "bc" """ def test_parse_combinations(self): - f = self.parsehelper(self.overridetest3) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.overridetest3) as f: + d = bb.parse.handle(f.name, self.d)[''] bb.data.expandKeys(d) self.assertEqual(d.getVar("DESCRIPTION:bc-dev"), "A B") d.setVar("DESCRIPTION", "E") @@ -195,7 +193,6 @@ PN = "bc" d.setVar("OVERRIDES", "bc-dev") self.assertEqual(d.getVar("DESCRIPTION"), "C D") - classextend = """ VAR_var:override1 = "B" EXTRA = ":override1" @@ -218,15 +215,15 @@ python () { # def test_parse_classextend_contamination(self): self.d.setVar("__bbclasstype", "recipe") - cls = self.parsehelper(self.classextend_bbclass, suffix=".bbclass") - #clsname = os.path.basename(cls.name).replace(".bbclass", "") - self.classextend = self.classextend.replace("###CLASS###", cls.name) - f = self.parsehelper(self.classextend) - alldata = bb.parse.handle(f.name, self.d) - d1 = alldata[''] - d2 = alldata[cls.name] - self.assertEqual(d1.getVar("VAR_var"), "B") - self.assertEqual(d2.getVar("VAR_var"), None) + with self.parsehelper(self.classextend_bbclass, suffix=".bbclass") as cls: + #clsname = os.path.basename(cls.name).replace(".bbclass", "") + self.classextend = self.classextend.replace("###CLASS###", cls.name) + with self.parsehelper(self.classextend) as f: + alldata = bb.parse.handle(f.name, self.d) + d1 = alldata[''] + d2 = alldata[cls.name] + self.assertEqual(d1.getVar("VAR_var"), "B") + self.assertEqual(d2.getVar("VAR_var"), None) addtask_deltask = """ addtask do_patch after do_foo after do_unpack before do_configure before do_compile @@ -250,10 +247,8 @@ deltask do_fetch ${MYVAR} ${EMPTYVAR} deltask ${EMPTYVAR} """ def test_parse_addtask_deltask(self): - - f = self.parsehelper(self.addtask_deltask) - d = bb.parse.handle(f.name, self.d)[''] - + with self.parsehelper(self.addtask_deltask) as f: + d = bb.parse.handle(f.name, self.d)[''] self.assertSequenceEqual(['do_fetch2', 'do_patch2', 'do_myplaintask', 'do_mytask', 'do_mytask2', 'do_mytask5'], bb.build.listtasks(d)) self.assertEqual(['do_mytask'], d.getVarFlag("do_mytask5", "deps")) @@ -263,10 +258,9 @@ deltask ${EMPTYVAR} """ def test_parse_broken_multiline_comment(self): - f = self.parsehelper(self.broken_multiline_comment) - with self.assertRaises(bb.BBHandledException): - d = bb.parse.handle(f.name, self.d)[''] - + with self.parsehelper(self.broken_multiline_comment) as f: + with self.assertRaises(bb.BBHandledException): + d = bb.parse.handle(f.name, self.d)[''] comment_in_var = """ VAR = " \\ @@ -276,10 +270,9 @@ VAR = " \\ " """ def test_parse_comment_in_var(self): - f = self.parsehelper(self.comment_in_var) - with self.assertRaises(bb.BBHandledException): - d = bb.parse.handle(f.name, self.d)[''] - + with self.parsehelper(self.comment_in_var) as f: + with self.assertRaises(bb.BBHandledException): + d = bb.parse.handle(f.name, self.d)[''] at_sign_in_var_flag = """ A[flag@.service] = "nonet" @@ -289,8 +282,8 @@ C[f] = "flag" unset A[flag@.service] """ def test_parse_at_sign_in_var_flag(self): - f = self.parsehelper(self.at_sign_in_var_flag) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.at_sign_in_var_flag) as f: + d = bb.parse.handle(f.name, self.d)[''] self.assertEqual(d.getVar("A"), None) self.assertEqual(d.getVar("B"), None) self.assertEqual(d.getVarFlag("A","flag@.service"), None) @@ -299,9 +292,9 @@ unset A[flag@.service] def test_parse_invalid_at_sign_in_var_flag(self): invalid_at_sign = self.at_sign_in_var_flag.replace("B[f", "B[@f") - f = self.parsehelper(invalid_at_sign) - with self.assertRaises(bb.parse.ParseError): - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(invalid_at_sign) as f: + with self.assertRaises(bb.parse.ParseError): + d = bb.parse.handle(f.name, self.d)[''] export_function_recipe = """ inherit someclass @@ -453,13 +446,13 @@ A+ = "b" += "d" """ def test_parse_special_character_assignment(self): - f = self.parsehelper(self.special_character_assignment) - d = bb.parse.handle(f.name, self.d)[''] + with self.parsehelper(self.special_character_assignment) as f: + d = bb.parse.handle(f.name, self.d)[''] self.assertEqual(d.getVar("A"), " a") self.assertEqual(d.getVar("A+"), "b") self.assertEqual(d.getVar("+"), "c") - f = self.parsehelper(self.ambigous_assignment) - with self.assertRaises(bb.parse.ParseError) as error: - bb.parse.handle(f.name, self.d) + with self.parsehelper(self.ambigous_assignment) as f: + with self.assertRaises(bb.parse.ParseError) as error: + bb.parse.handle(f.name, self.d) self.assertIn("Empty variable name in assignment", str(error.exception)) From patchwork Tue Sep 16 00:06:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 70271 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 AF0FDCAC599 for ; Tue, 16 Sep 2025 00:06:59 +0000 (UTC) Received: from DUZPR83CU001.outbound.protection.outlook.com (DUZPR83CU001.outbound.protection.outlook.com [52.101.66.34]) by mx.groups.io with SMTP id smtpd.web11.7738.1757981218163140012 for ; Mon, 15 Sep 2025 17:06:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=fwtFwE2B; spf=pass (domain: axis.com, ip: 52.101.66.34, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=utKUY6iLXqnmrGKd4A9DD9nM+7UoGDxmHgWZDmRsaBW07gNt4QHpn3ZSK+I9TBW6KOk08zvpiHABP4ypVLQJOaN4v1PLy+hhV+Ap8aae04xrda0JYxr7AGjFmrsvFkr8JgjZz/etbuoumPJBfRMD16/6yZv0iTouKk0+omDHibceYuYAc7bNJjZMrdokjKYqCVI4U2Jgd8neBb8OxtqRwoS8Ceg13DrO8nbgTA2Ve/cNkXOK+nAcI4YQTRhy9lTMKbv0wxs6XI2ro7BEGZz+g3VvCgN3nd8XTxIB9zzM49po/+W5pMTF9wpguyJlIBQuYPqOu7MRPrF4Ajo52e7HAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pC7KwzJL51QHS8BOuoN5W1fgGCG3WefK70eZ5E23Vmc=; b=TZfqzueGJxewov5VD2h/QOAxlkW3/MK9rg1j6PiOsFWYj2MdQBxYyXTKY67FRynJLGd2ZTSaghSYf82PeEepdJ8W49kQcrOQxKzXpkdQY8AiTjko20RF88PeQiPqDFsBw9mgm7wvWYnfvmHndN3Uv9U2ciYR7Dsel00RrUGynkbUbJHqwh3b54x92m+TyUhzwP38L6PT2MMouoa8aOOc7E1uhCsMwG+XBsGJPgii6KPqpZOQ2NRthrWXLeHOXiQ4BGWe6Ssvsa2HXGUsgYfVtptpVsy8wAgPmiYQEO8rLu7xH83pBkfpUjDK00kPhLXImsRZpnUQNGkvG8yBh4PvPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pC7KwzJL51QHS8BOuoN5W1fgGCG3WefK70eZ5E23Vmc=; b=fwtFwE2BpPet1iqZlSbEkFBUzSu9im/YSoeHf+ODGFHdcAIbokAyIJicuoNzW00gbidl1BYUSs0tmmwhg3CcXgvhWT1F/WsoLYSQ5SjlsBGol4oLjWf4WAfDPw4dS2WyO2Pag1zYQy04+X3ifKoAcc505EMKO2ep9RQm9EUl1MM= Received: from DU7P251CA0017.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:551::8) by AS2PR02MB9166.eurprd02.prod.outlook.com (2603:10a6:20b:5f9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.19; Tue, 16 Sep 2025 00:06:53 +0000 Received: from DB5PEPF00014B8F.eurprd02.prod.outlook.com (2603:10a6:10:551:cafe::bb) by DU7P251CA0017.outlook.office365.com (2603:10a6:10:551::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.19 via Frontend Transport; Tue, 16 Sep 2025 00:06:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB5PEPF00014B8F.mail.protection.outlook.com (10.167.8.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9137.12 via Frontend Transport; Tue, 16 Sep 2025 00:06:53 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-mail02w.axis.com (10.20.40.8) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-intmail02x.se.axis.com (10.4.0.28) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Tue, 16 Sep 2025 02:06:52 +0200 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail02x.se.axis.com (Postfix) with ESMTP id 1ADD3209C for ; Tue, 16 Sep 2025 02:06:52 +0200 (CEST) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 8731D12021A; Tue, 16 Sep 2025 02:06:51 +0200 (CEST) From: Peter Kjellerstedt To: Subject: [PATCH 2/5] tests/parse: Remove unnecessary calls to file.flush() Date: Tue, 16 Sep 2025 02:06:45 +0200 Message-ID: <20250916000648.1182372-2-pkj@axis.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250916000648.1182372-1-pkj@axis.com> References: <20250916000648.1182372-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B8F:EE_|AS2PR02MB9166:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b0a6374-0101-40b0-4851-08ddf4b4f173 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: rrs9j6s+bBVOlPY5sDWLwSmLKO2dzoOP4HhHzZQPpCiZhXWtglGwvczgo4Bd0Tqyh18/uLxvNoNm9kPcNsCT0PZV8qALCmOKTvfMZOblDKCzmp+nRWqWp2U9LIP4tyW82/lFfwoBDiL1S3NZo9lCPmamnRa3m9oap1PYcWB6PKhfdAKhqp5uyRkh2GamnjA74RBbt/UHwLsSMv0QbZwnAp90HwrsG21ahP7Rjnqe/dI6QJaPTEy1r1oPPXQQDBPn0leFerul+nq8bMp/pihfeRqcc78A5Ky7zZYgK8gr9TNlq/yTojIWhhtoccKtTL6z1nQLb1rvOvyuv1GidsnbdEwOqeITQa62oT6b89BEyDU2MGTjdj8xW03cAs7Cv4hoPZ7EIRBv2/QmnVy2tNKo2TFjvOs/EolfUf1KzDz+kqZAvc01HoRNpAQFU2drd6xjaqO1P5hQbg3NLwiy3PMWqICz9airFhHYsdtvaTkPevwZ9uMPgLeCiPvTid4GHxYF82bEWliTEmCG2l5ExV8RTCRpDagg4xWD2rOuestqqV/bRbeEDT0NiIow1Riod9u3wuMGyMN04DORDTjoyHpk9n0NbgEv2tW7Y4Rt8Imdfz3p3NT+FfO9zpu41BZWGvTo+M0YMrUV5CmeJqPoablskqYLdAN7gzGYP/2knPumN3PrWJ+YaBCz1vHsheiZIIeDtmCsWaMLgdjlks7RKJ7xpHlNZGchaTt8bnekFkObd/D5vGDUaYZZmnZ6uCIMIWOxS6sDI+01i1n95bOnF50e71xw4EljeXdENKWNX6nkxiWvdSPRQ4JNKYi0Expy7QixaZrh/gpUBQJ37Hg67M2OJPT+5xPnVY/P0vXu8EkJrUgXeStEN7V4S5snljuIXwahMAkn+ZHUSNe6a/2ivLVObElkg32PM669BdOiUFhUMGj2aPplV6yl+D/Jiu4VJLykEEm4Y7vs+TcBETH6iTgm/xZF6Ut1XET36NrQqiLiWpmTw47WOx03PEFTPXzLWmGMnLlO/hv0Ph/6Iw4JNLuhMN18PCnPepF4CiGqf5qM8WHh1eYQdPDrSFaSJkOyFqPZKo4zE3XIZFpVFWqj4FCsgQdZmfSizCTV1wH5/WC8bCngNOHl90lzZJbFiy4gDHh+r9rTTVCZNLsL42rs8CwQUOW9OJdczjStQ6iVhCa3Khx68ugQWGPHYAJuYjFbbhW3UOGVQyg9tl6xMldK3q3L941j9U5/r/4VBYQaW/Ui9fsH5Nw6sZeBKAXmCaLVECtkA5Eiq9kELd26xvtd+9J5EG3Cr4GjC0nn6W7raM939x6xi4OmJFLJ7pX+gv1zGDnCuWVZ3SsKh0bqjVc4z+k5xP7NCP3Orst1Zt3GF0rAh5YL+zWHmAEWOEk7A0QAQb9fWgtjKHzoa/kirkhjNez+m9R5itsXGC0a8l3MXh25FGE2Ba6msT4FunYKmlItdn1V1px6lFRx+zWfpg6s2TpTYFwgMLyptIsrV58OhEXBmSYF91y7aKBDtTOkVK7mg+fx X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2025 00:06:53.8140 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b0a6374-0101-40b0-4851-08ddf4b4f173 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B8F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR02MB9166 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 ; Tue, 16 Sep 2025 00:06:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18038 There is no reason to call file.flush() as the last call within a file context manager since ending the context will close the file and thus flush it. Signed-off-by: Peter Kjellerstedt --- bitbake/lib/bb/tests/parse.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py index b272739f56..431b0c7d3e 100644 --- a/bitbake/lib/bb/tests/parse.py +++ b/bitbake/lib/bb/tests/parse.py @@ -349,14 +349,11 @@ EXPORT_FUNCTIONS do_compile do_compilepython os.makedirs(tempdir + "/classes") with open(tempdir + "/classes/someclass.bbclass", "w") as f: f.write(self.export_function_class) - f.flush() with open(tempdir + "/classes/secondclass.bbclass", "w") as f: f.write(self.export_function_class2) - f.flush() with open(recipename, "w") as f: f.write(self.export_function_recipe) - f.flush() os.chdir(tempdir) d = bb.parse.handle(recipename, bb.data.createCopy(self.d))[''] self.assertIn("someclass_do_compile", d.getVar("do_compile")) @@ -366,7 +363,6 @@ EXPORT_FUNCTIONS do_compile do_compilepython recipename2 = tempdir + "/recipe2.bb" with open(recipename2, "w") as f: f.write(self.export_function_recipe2) - f.flush() d = bb.parse.handle(recipename2, bb.data.createCopy(self.d))[''] self.assertNotIn("someclass_do_compile", d.getVar("do_compile")) @@ -377,10 +373,8 @@ EXPORT_FUNCTIONS do_compile do_compilepython with open(recipename, "a+") as f: f.write("\ninherit secondclass\n") - f.flush() with open(recipename2, "a+") as f: f.write("\ninherit secondclass\n") - f.flush() d = bb.parse.handle(recipename, bb.data.createCopy(self.d))[''] self.assertIn("secondclass_do_compile", d.getVar("do_compile")) @@ -418,7 +412,6 @@ include \\ recipename = tempdir + "/recipe_unclosed.bb" with open(recipename, "w") as f: f.write(content) - f.flush() os.chdir(tempdir) with self.assertRaises(bb.parse.ParseError) as error: bb.parse.handle(recipename, bb.data.createCopy(self.d)) @@ -434,7 +427,6 @@ include \\ lines = self.export_function_unclosed_tab.split("\n") lines[3] = "}" in_file.write("\n".join(lines)) - in_file.flush() bb.parse.handle(recipename_closed, bb.data.createCopy(self.d)) special_character_assignment = """ From patchwork Tue Sep 16 00:06:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 70272 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 BCFE2CAC59C for ; Tue, 16 Sep 2025 00:06:59 +0000 (UTC) Received: from AS8PR04CU009.outbound.protection.outlook.com (AS8PR04CU009.outbound.protection.outlook.com [52.101.70.21]) by mx.groups.io with SMTP id smtpd.web10.7557.1757981218377397356 for ; Mon, 15 Sep 2025 17:06:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=UKdcTLcV; spf=pass (domain: axis.com, ip: 52.101.70.21, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q0aBqh5Dz8oaByQktb1criXAQviFnDpsj4XI50MykDr9ofLcpuKqnlNKKZUpV99YexHZzFSUWvzQGGh6tcV4jo4WxlC1PJXPVngq8TfC1qtSdHndQ1VENp5MPKrq+cmaSOMfCZm+xFcpFs6ZbAqqn2z5koTTXbOSuZeM1ywoahMOIEiel92LLw2kiU9kDtwcXR/BDJLCdH94tXZfi8PRdnfZQGbqEpu3SRM+0KvioDSNGUcqE7S1zEHoQFzbYn7iESfWiSyhnwg8vQva4juxDnQvmTjYR7qgA+FGU9xVjpm3AnjJ7rmbjEl7AFYZ8kkPiMR8OEDfn4ID89WJLao3YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ge877RpA/8AgGRzZI5eOp1fUZE6PZzAvuVEnglCFNng=; b=EHWXyJjOEmvnSNHhpMVe4zTqFcovvw2gBnHCDaTZe6aBLm+cfIoDuGLYXmD48wkwjwiJSBrXNpyaCg8j/jF8gkZqSv/9G4KwecmZ186vc4ebhA98+PbFih9qphrzzw+/Cj6OxneltAnDGdSP+gQyp3D2Uj6A1ALEgWNCFVIuFb+ThASOWLqTkA5dfkJClDh6wS09yfr1Xx31VGHzXjb4TVZsR27p5gsy3KC6OTfH7+FAEhqhztf8Lehe6ixbbelt+cKd9K4ho7iWZagBeE4SJs24fVkY6dNe9pIYYfF97LdG99jveO/hjPMJsVYofUCK+9MVTc+wXiRQfcgMWVvZFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ge877RpA/8AgGRzZI5eOp1fUZE6PZzAvuVEnglCFNng=; b=UKdcTLcVENJo8LskUEr9A+3iMLNeehlpWBYYVmxBRVKzvaxukGHqzDYV9LN5IeNYoGfYNJJWypjPZNdNPAwKFmKypwvXY9dLnzX8VQEmnHxn8khVMasAd3qJzoErSWwf0O++ubjGFgwdivV6E3AkRwJucuND/EUzhzOXQI42s/k= Received: from DU7P251CA0019.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:551::10) by DBAPR02MB6438.eurprd02.prod.outlook.com (2603:10a6:10:17c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.22; Tue, 16 Sep 2025 00:06:54 +0000 Received: from DB5PEPF00014B8F.eurprd02.prod.outlook.com (2603:10a6:10:551:cafe::2e) by DU7P251CA0019.outlook.office365.com (2603:10a6:10:551::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.21 via Frontend Transport; Tue, 16 Sep 2025 00:06:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB5PEPF00014B8F.mail.protection.outlook.com (10.167.8.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9137.12 via Frontend Transport; Tue, 16 Sep 2025 00:06:54 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-mail01w.axis.com (10.20.40.7) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Tue, 16 Sep 2025 02:06:52 +0200 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 1C7D727DC for ; Tue, 16 Sep 2025 02:06:52 +0200 (CEST) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 8BC281204B6; Tue, 16 Sep 2025 02:06:51 +0200 (CEST) From: Peter Kjellerstedt To: Subject: [PATCH 3/5] tests/parse: Add tests for include, require and include_all Date: Tue, 16 Sep 2025 02:06:46 +0200 Message-ID: <20250916000648.1182372-3-pkj@axis.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250916000648.1182372-1-pkj@axis.com> References: <20250916000648.1182372-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B8F:EE_|DBAPR02MB6438:EE_ X-MS-Office365-Filtering-Correlation-Id: c7431120-301e-4b7f-77c9-08ddf4b4f198 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: D4kJY4j1IGdxXJ7x+lL6FBG/HzCs7mLev7BCubfs/UnKfTJz2WA7KfsvVILvhEtBqBIL6GgsZ1pAhE0yS2dnWn21tACbjuB8oeuHdP8CYdUEWLU0KNZR7MiOZ99LnUDzFWWbKxkrb5JEJ/ce0JmwiAHENh+xBy8EmrWDrv5SbC+Pmx6kAnQwY+dowBCHc8412eanwHkHe6LUSrHVvraQc9DNfsnMyR/zQTuXIaiwoF5TBF41+rq4qjppiq4Q3WZ/GgSX10XsHglsKhBwlb2aJ5iUAbDiDbrTAHxcNEMtIrTFaSqJRc13ORIubN/SciAydV8HcT8yIrwZn+3FQx2O4B1MTzanexXBWtOE3Hxebn5nSz0cwSWvLtgSvMKfGtWy/gNBXNcS25+bTYWr5mRQtxcuSNHw4UVjdwon91Fn86BoXyi90Y6i3mQD6lRoggXUhEAnHBaL6xiMa9mqhAn7c7cz1FamaT1c1C4mOgWXbBWE4pAgUdskBoTfPkXIo6DuoZ5i45zyyjHU5nbe96WV3rXxMEeJ55826Fw3UAaBRjEnC0tNEbjpK10KC8oFad3s4x4hpulNNfPDLoRNQeTFBOJvgMF3cUqch92aF1prmSLpvYwF4ZrGV8WgTVqAFT1NNclPqMW1r8zraOLmSx+l71bZ4VBBDDImTULhdQY/1kq2I/3Jz11mkk9r1Ix/77ucxFhimXfooJmkKaRLwF5FiukoYgq8tFidwYZIK5V1lsLh1bYppq6y6iJJfUgph4Ku0LrCOFZSBbqNQRl7xqCrpNm25GqHxvh5O1GGzsaVAFEuGjszUP121rcPZjCBLNkHmw9miTIfmlN27+QVoxvKcLxa5rYle92m61L+MATDriNMCKNXA0Fcr1c3iojpNtZjLtnxCNw/5xh5U/OJ5u5WGwiq6Ab5CT6CK8f3r5k3EgQsQ8t3myZx8ajO1ZycaBkDOaI9ezKb2vmN5lYGs7N7zjV4Hr/sQsnPmkcDnz8TjGpak0afGc5xnTpR/xnS1wtr5+JPruTA2aO/IbUInLXbQTJq7J0hxTuztEeUkBahk17Sbv4RdinZ2WfAAAbfHD5S40bSr1tFBHrNp0P/rj+JMP7DPYFmD/hHWHxqHi6B51lduOPWWy9HeCkozag6hqjM5HUdot6wg/DFCjVjbgfmxeSaS8AMsyYv83VWw5271gtj5zNgH/GVN0YX2U+f6DiS4aBb3JQFKgy4px/wgc7cBJ0ikLb+B7xDuU4oYNrnogRIimuKIvX/CLawsapCqtlT29WKCzYTF3dZ16GR5MOM6dFp7Ooq0NDnMESeBn75wo4VTIMDNoA1b8j2ViW0MFXYOiD5EFcBTI0sNIwVCcyiIXVTx5rcWVxjVqr12Rja7F0PamNJmgmTpyOFGe78cxbNZPGEZb2qphP7vXkLJ38WAieXepndDDZKrwGgeA1eTwD57qNN8s7oCEELZsCDotJ5TKLE3z5Ay2+fxoOkfF2KrCX31ErpkP603MoSoBmLjKTmDrL8vOOWwQ8kpSHDrftJ X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2025 00:06:54.0558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7431120-301e-4b7f-77c9-08ddf4b4f198 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B8F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR02MB6438 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 ; Tue, 16 Sep 2025 00:06:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18039 Simple tests for various ways to include and require configuration files. Signed-off-by: Peter Kjellerstedt --- bitbake/lib/bb/tests/parse.py | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py index 431b0c7d3e..d3867ece98 100644 --- a/bitbake/lib/bb/tests/parse.py +++ b/bitbake/lib/bb/tests/parse.py @@ -448,3 +448,63 @@ A+ = "b" with self.assertRaises(bb.parse.ParseError) as error: bb.parse.handle(f.name, self.d) self.assertIn("Empty variable name in assignment", str(error.exception)) + + someconf1 = """ +EXTRA_OECONF:append = " foo" +""" + + someconf2 = """ +EXTRA_OECONF:append = " bar" +""" + + someconf3 = """ +EXTRA_OECONF:append = " foobar" +""" + + def test_include_and_require(self): + def test_helper(content, result): + with self.parsehelper(content) as f: + if isinstance(result, type) and issubclass(result, Exception): + with self.assertRaises(result): + d = bb.parse.handle(f.name, bb.data.createCopy(self.d))[''] + else: + d = bb.parse.handle(f.name, bb.data.createCopy(self.d))[''] + self.assertEqual(d.getVar("EXTRA_OECONF"), result) + + with tempfile.TemporaryDirectory() as tempdir: + os.makedirs(tempdir + "/conf1") + os.makedirs(tempdir + "/conf2") + + with open(tempdir + "/conf1/some.conf", "w") as f: + f.write(self.someconf1) + with open(tempdir + "/conf2/some.conf", "w") as f: + f.write(self.someconf2) + with open(tempdir + "/conf2/some3.conf", "w") as f: + f.write(self.someconf3) + + self.d.setVar("BBPATH", tempdir + "/conf1" + ":" + tempdir + "/conf2") + + test_helper("include some.conf", " foo") + test_helper("include someother.conf", None) + test_helper("include some3.conf", " foobar") + test_helper("include ${@''}", None) + test_helper("include " + tempdir + "/conf2/some.conf", " bar") + + test_helper("require some.conf", " foo") + test_helper("require someother.conf", bb.parse.ParseError) + test_helper("require some3.conf", " foobar") + test_helper("require ${@''}", None) + test_helper("require " + tempdir + "/conf2/some.conf", " bar") + + test_helper("include_all some.conf", " foo bar") + test_helper("include_all someother.conf", None) + test_helper("include_all some3.conf", " foobar") + + self.d.setVar("BBPATH", tempdir + "/conf2" + ":" + tempdir + "/conf1") + + test_helper("include some.conf", " bar") + test_helper("include some3.conf", " foobar") + test_helper("require some.conf", " bar") + test_helper("require some3.conf", " foobar") + test_helper("include_all some.conf", " bar foo") + test_helper("include_all some3.conf", " foobar") From patchwork Tue Sep 16 00:06:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 70274 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 ADEDFCAC597 for ; Tue, 16 Sep 2025 00:06:59 +0000 (UTC) Received: from AM0PR83CU005.outbound.protection.outlook.com (AM0PR83CU005.outbound.protection.outlook.com [52.101.69.70]) by mx.groups.io with SMTP id smtpd.web11.7736.1757981217527662218 for ; Mon, 15 Sep 2025 17:06:57 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=ghfiA00y; spf=pass (domain: axis.com, ip: 52.101.69.70, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MpEqegsYgGZSunmMULW0+ZOfIUF+eSHpvo3TaUMC9MxCh7eoFoGfsHPaV68bj8s30dfmGD5t+FFqt4bv8TqX5a79LdCBR5lfMttnuFan9d0kXj6H3ZMTk13oLiuERT3xuEgoEqXTimnEj7qj2xDb8axVUt7smxO7U0EUKLoK12T+TosTZZcWE+YAlX0QcRVgeXQBgDtQLPbi2FjJoPhMLvjzSOCenxWfwKnRExnLHWw0vOlOTO5V/ai8+C+ljiQRjOTOGyruvNnCa7M/sfE//knBKFB/AYbwBME+OJbFOfJ0fVqJ7QASApI2+8xvcPoMTr891Jyw8OodeavTJcBrHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zyNeHBs81Q5In6+KmLgH208gtRfsPhT5V3NcBIsAdjc=; b=NHYldPDSliIlnLxg/RhBwzdtixRBqleFtiuBySOkWPmqk9UKYL1B93cxuoH/bLucWCqPwKOAHTBiv3DIvE6CijvHS53M4rWvQ6kiU1kHwFqog8Tiau2AvpbO+sbIW7nskZrSfeDjxiHmDoeFIP4VPBgSekVq7Ge0ZfgSmJ9n9IukJcgKSfAMvNeBDnJCsSWbVE0bZBAyurTWtBqgsb4Q/M8A1QGu4rSrhmFyXj3oHinSDk5YzOzXAEiwTwWiHvgaZ0XqseEKMeJfiAuVOSYwXrl+mm7YrHbZJAY5Dsxomto39kAjYooDudfyP3GTXgqkOZXU1kNGHSE9rUPN3M4FHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zyNeHBs81Q5In6+KmLgH208gtRfsPhT5V3NcBIsAdjc=; b=ghfiA00yUvdfhRTKPg47pnVs95jwnzUdhyGfER9K3uhv3CiSG5/7JcbiwfjgBpBg39rMltDByZcKWHbzb39E3gkg8/VRA0slbw7fBwVsLZDLDoG2KF1spxdepQ9lSYxLYDXQHrpt0AolwNn51LvwL2knQ940UUzFxRcGCWLCp+c= Received: from DU7P251CA0019.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:551::10) by DB5PR02MB10216.eurprd02.prod.outlook.com (2603:10a6:10:4a3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.21; Tue, 16 Sep 2025 00:06:53 +0000 Received: from DB5PEPF00014B8F.eurprd02.prod.outlook.com (2603:10a6:10:551:cafe::50) by DU7P251CA0019.outlook.office365.com (2603:10a6:10:551::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.21 via Frontend Transport; Tue, 16 Sep 2025 00:06:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB5PEPF00014B8F.mail.protection.outlook.com (10.167.8.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9137.12 via Frontend Transport; Tue, 16 Sep 2025 00:06:52 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-mail02w.axis.com (10.20.40.8) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Tue, 16 Sep 2025 02:06:52 +0200 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 205E627EF for ; Tue, 16 Sep 2025 02:06:52 +0200 (CEST) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 8F5C9120468; Tue, 16 Sep 2025 02:06:51 +0200 (CEST) From: Peter Kjellerstedt To: Subject: [PATCH 4/5] parse: Make include_all support empty variable expansions Date: Tue, 16 Sep 2025 02:06:47 +0200 Message-ID: <20250916000648.1182372-4-pkj@axis.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250916000648.1182372-1-pkj@axis.com> References: <20250916000648.1182372-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B8F:EE_|DB5PR02MB10216:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c5b6bff-31c3-4b5d-1b51-08ddf4b4f0be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: KW1hhSMeSvPYOb1gUPp5rmcHLIQQOEiB+1ZLdekWg5N7XfN9E0D24XAMRBe+mxpVWX7O9Q2oj4Zm2+MBfct6dWSP7bMIi9CGH1ROO+7rDehyMHAdgbqdSMgTF/Ocx6qmKPgjOHoW6MrxYL4IXrrkrquhB8VOJC4XZyHPxFG/R8CnL5MTzKDpVrrTwGh5hgk9qg66ujcC19QgheCMTqLcYGlSEuv32CeI/3huewmkvbaHvaQt3XXfOMntDHNoNVCsdULFJmCGtqUYe+P6DnKvAp6IYERbDGQOs+JBVNlLLlQtn6Z66kzDzdqWTTeyMPViZ/YZ0XwuHGcCSlJfcag7j60OovIa0gamaGjX28tZKdcWnIJOPoneMleEVLPQoSoWbpTFjadJwSRPDRCFWrxiFJt6ntNITQ2mh3xXvQyG5lzpSMM9H798AOjVE7reU6PM7JNNoR3asXiRkXXcRl4CxT7bRyeZmRuQPPcRLv+/N+T7JuJToFAcu+GlDUlkc5vi+99kUhjWL+W1DhVlcZQ4KajJ+SgfO0RGGgAF8vKRYRXP813UVYqdDD3ZK2sHp2LkvPooo+kmnFWhjYxs6G6j1uVtZcw/Jqz/o8GIjGOaGCvb5qX4YCxPRnQlROqb2nF4nKRGqcj4ps5A7NGlCyu5oW1a7LFpuO77WmOKO8SravDdLUrhJAgr3819qfLPmkD5io5oYJsN6tAYFKbvUNobmfFiG99TEuqwOK+aT5W+90rauRDjj7ZKGH1Mwymq5S50u4WdMStYV1skGPS06tRMVSZ0RW4o8ojPdvzK8WtPcimz7jNuavlfi4qeLtJlJCYKrEI4rl04szgkDUDs1+KA1mf+TE222uKmdkSJBiPwV8eZL5caMZhINknhmYasnjZyWlmrBkFvJvFeHyIZFfhwefTa0uzL7wjTI8FZj7qVN1QYZBt7wXEbPzDHeV8TsYG29+Cfp5eLmMrcAx4pC3sXAv18TaRUKDneL/IRkZP62uctV5Jsfto/qya1deWuFiQAzEFn/WnodpRF80c3EoGqea6iiGZs8quYwrhiI5hFGtOZCbjriFt16KKUTkSUZnq3ucmpKhX3zBNMSJIrsKTvTo2+BWWr6aBHx/8bLltS1l+AdxnPPhn7TdOIlOgE+EKaIXJPoiqzpStVnE3ARffcC6pemIm6mYM20ie8URiavzArQPU21PnRxXSjLN/k5SSMi+i+/5vS9NyYEhRZ9lBWWo3k8vV0U5FRwJyCEsS/jpuKbDVYLGFA5U2UrAvbWBz7JRtpu912gbbKyDDY8k1jCLtljTHEbkhkyfBvkTCEvA+BR8timex31YvsygBSFZhEIUIjoGN0ulnngsL1yese4sYGJl5gWUa0d4Z/6qZMzasYzITW6+zNWpogDZNIlfHgRDoE6gD3tTk8aCk5BxJIf7ZfjzUuF8T9TJby3GkaNX7kpRowsyGdyuyFkSQJ62MaJOIe3k0BVgWZJKSsK9Iwx8DEB2nJRsW4EJ1VQ5zhsIA8l+0GS1MXYAKZdgb0d1dx X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2025 00:06:52.6252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c5b6bff-31c3-4b5d-1b51-08ddf4b4f0be X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B8F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB10216 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 ; Tue, 16 Sep 2025 00:06:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18037 include and require support empty variable expansions, typically used with conditional expansions. However, include_all does not, and instead reports an error for the first path in BBPATH. Rewrite include_all so that its behavior matches include and require. Signed-off-by: Peter Kjellerstedt --- bitbake/lib/bb/parse/ast.py | 5 ++--- bitbake/lib/bb/parse/parse_py/ConfHandler.py | 8 ++++++-- bitbake/lib/bb/tests/parse.py | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 49a0788038..3250211e60 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py @@ -53,10 +53,9 @@ class IncludeAllNode(AstNode): Include the file and evaluate the statements """ s = data.expand(self.what_file) - logger.debug2("CONF %s:%s: including %s", self.filename, self.lineno, s) + logger.debug2("CONF %s:%s: including all %s", self.filename, self.lineno, s) - for path in data.getVar("BBPATH").split(":"): - bb.parse.ConfHandler.include(self.filename, os.path.join(path, s), self.lineno, data, False) + bb.parse.ConfHandler.include(self.filename, s, self.lineno, data, False, all=True) class ExportNode(AstNode): def __init__(self, filename, lineno, var): diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 9ddbae123d..af3af2ccee 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py @@ -56,7 +56,7 @@ def init(data): def supports(fn, d): return fn[-5:] == ".conf" -def include(parentfn, fns, lineno, data, error_out): +def include(parentfn, fns, lineno, data, error_out, all=False): """ error_out: A string indicating the verb (e.g. "include", "inherit") to be used in a ParseError that will be raised if the file to be included could @@ -67,7 +67,11 @@ def include(parentfn, fns, lineno, data, error_out): # "include" or "require" accept zero to n space-separated file names to include. for fn in fns.split(): - include_single_file(parentfn, fn, lineno, data, error_out) + if all: + for path in data.getVar("BBPATH").split(":"): + include_single_file(parentfn, os.path.join(path, fn), lineno, data, error_out) + else: + include_single_file(parentfn, fn, lineno, data, error_out) def include_single_file(parentfn, fn, lineno, data, error_out): """ diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py index d3867ece98..2f77c90f60 100644 --- a/bitbake/lib/bb/tests/parse.py +++ b/bitbake/lib/bb/tests/parse.py @@ -499,6 +499,7 @@ EXTRA_OECONF:append = " foobar" test_helper("include_all some.conf", " foo bar") test_helper("include_all someother.conf", None) test_helper("include_all some3.conf", " foobar") + test_helper("include_all ${@''}", None) self.d.setVar("BBPATH", tempdir + "/conf2" + ":" + tempdir + "/conf1") From patchwork Tue Sep 16 00:06:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 70270 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 B0A48CAC592 for ; Tue, 16 Sep 2025 00:06:59 +0000 (UTC) Received: from AM0PR02CU008.outbound.protection.outlook.com (AM0PR02CU008.outbound.protection.outlook.com [52.101.72.16]) by mx.groups.io with SMTP id smtpd.web10.7555.1757981217307339939 for ; Mon, 15 Sep 2025 17:06:57 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=TkdhW6Ky; spf=pass (domain: axis.com, ip: 52.101.72.16, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w0AcGpGXLuQYtTOi/faI1vHZ30GZspF0m39PTvMJqsspoBi6YADDrb5EK0zHP4MCouwh3o32txZzGWH+2zSKXv9EYT4AdbdBKlqLglXTh6PBUNLY2nIyNqWJ4hFNazGlWnIPz9Cnt8Vpok4yV+tmWzyOTVQo3fFpokfTFoeLeVkNt+il76VtX5KDboqA1CnV6sjJk0Dqa9DKkt3TE0OatGrB+zBzK5jaY7CWt5ptBDByTPk4iq7QRWiSXOrFojfmdV9DHlAoXrzZ5smbsCwhXQ5TSawBeGbh2KCQo0wl6Z9/ZuxwaTEg498ApwZL7SqUkrU5veTfn9B5TA1ybmXc3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PczG+Pl4paWa3vOukjhMjhH/AzEuOh8Ab28oNM/OalA=; b=mQxj+HzWc/bWAlXN2wTUPYf495M6BrPqyCnPNSYucoilCxcKHtuCXnCsRCybp8HVpmBb7Hy5cFwsKu8ZSR4s37JTXv6iQqfuWT1diDgbCJw6nKe4MZXec+1t3NAkhthRLLt7XoUYFQKR5zXAhVE+BOaR4jbnDHB8LKteqBDK+FZB3Ufw6u49gzopmBbauVLj7sLZ3/Uz/psfAcp7okTtGgo/G+3UVp9WTI5Qc6mQ2Gw6YiO5sTkkUcVtthq14veiAcQxadAajkmyZiBpHlMxx+agLudveKFyeB3g//VmHZx5c9z2E6lXVUfKNkHfCOxO/0xxfz1z73SuueGvwpuzsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PczG+Pl4paWa3vOukjhMjhH/AzEuOh8Ab28oNM/OalA=; b=TkdhW6KyYqsRRQjb5QRtnyTivzejN3inqa7eVcHJm2gDt3GREpWJW3Mwka6yQsyUuXtebPSv2/EjTU4+lNPtCFFO5Y4vYfjll0V7G71A8ZYgWgiM4Hd/yRQwgmK73S7ZARSy5e0Zf4YVhbudBhjfZn/BgP4CLMO2tWiHKZO1Lzg= Received: from DU7P195CA0003.EURP195.PROD.OUTLOOK.COM (2603:10a6:10:54d::19) by AM0PR02MB5937.eurprd02.prod.outlook.com (2603:10a6:208:188::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Tue, 16 Sep 2025 00:06:53 +0000 Received: from DB3PEPF00008859.eurprd02.prod.outlook.com (2603:10a6:10:54d:cafe::54) by DU7P195CA0003.outlook.office365.com (2603:10a6:10:54d::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.20 via Frontend Transport; Tue, 16 Sep 2025 00:06:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB3PEPF00008859.mail.protection.outlook.com (10.167.242.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9137.12 via Frontend Transport; Tue, 16 Sep 2025 00:06:52 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Tue, 16 Sep 2025 02:06:52 +0200 Received: from se-intmail02x.se.axis.com (10.4.0.28) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Tue, 16 Sep 2025 02:06:52 +0200 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail02x.se.axis.com (Postfix) with ESMTP id 236F222C5 for ; Tue, 16 Sep 2025 02:06:52 +0200 (CEST) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 920801204B6; Tue, 16 Sep 2025 02:06:51 +0200 (CEST) From: Peter Kjellerstedt To: Subject: [PATCH 5/5] parse: Make include_all support absolute paths Date: Tue, 16 Sep 2025 02:06:48 +0200 Message-ID: <20250916000648.1182372-5-pkj@axis.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250916000648.1182372-1-pkj@axis.com> References: <20250916000648.1182372-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB3PEPF00008859:EE_|AM0PR02MB5937:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a6fe26a-2410-4ec0-812c-08ddf4b4f0b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: qyJuhT0scwxbdln/so3pNfuuhLPZSOyTeVekM7QsZIg8LvTr/MNJGfYFWGhSlzE5f9y1Gj1VHQZIODVveEiwQQQkKFzl5zsikQBPG6kOOWmqremyYEBP2O85Ivlo1qSUO9F7OZ22DGq2S8YlXkb2EwogdSDes9G2haYYbhmukhpzIZ5+Ggpx2SJOCeg7sODF78zTaJvVbl6xu1TU9UpwPycm0melPdW4DklZ/k1z6zty2TQeUglFPFG0OBdLe7TekhOMpgyQG6Y8rfCCVJo0XY0/s3OUPW98mwPIIH8jgsTKrGBg++gOWtrs9i2DVH6dvVjFpvq4dYTZB9rVk1kXYzZT97zbKzFeY+Qo4EkLWY9OCiPBGHl5iK7uqp+wWwc2lTWGkGckwexp+KGISjqQ7L9uVc4W5YD+nOqGizTQsE7D4T3Sg+GGvAp/zQEAcqSt79cMaE0xrEJi7Jsu8UaSMgvV4OygFegqzpCHSP+hHrlRbOh1yV0IdrBpotELaGVvUhH2qBjcR0jmOjg0QLCNCeahMAhQufSV6XpTF/HH61WZX0E2Hw+bo5CAdL/EOPkvvdjjVY3gdpxbRLtZmkvoZcenkmZ5H4/ybmbzjQ5h7ews7oPyi/H1NclXKh8k2z8FYV309tp5+YtlUo6Tz9w88m1ukJ9jleouMdGHOboDPVN/yFL9UsEmeONFVvKzPXPRSx4HqJI6/i3snXxpsPj4IIOmiFIcSVccXOdix5S9I6+HmpR2MaowtvCPJ4X7YbcMEjvWMJj8Gp+TtruUbRNr65MJW4vZPNo1r3VTfA574ajI2SVpy8iTbZZWmlCFHvwxzYMUADNq/yxct+U1N1gSRnITFjPIVPBaLOprPCcQlEdddLD8/90QT8Y0R2gcT6HHks8rz/D9JBt/iLxY38AF+Cib6PxdTZSAzk///o20gH7PBufjlhlvKiJWeSZJ48vpKcR6d8aUHLiUb7qrrG3QBPZXeoA9PlayDgxTl5CkwclXpagtfV4uy3Ho5HBHKtjSQCZsds5OdxrJTyOfeZETQ/iYc25E2zEZiM4qPE7nT2sNkHhVPj0yJ+OwwiuDMPvn9R5CPKjIk9TxN85TjC1F8/hb9t4x3I4Yc0ExJ7LBpFgOWsrkbSXUwaaar047oiIIakLcu3FriH9Sg4r6r3DlE5iY1A43m+9AM3+ZfxrkyDUIweoctWh0N9lMzto4kO4uqoS3JV70oU3RARGv7dSsRxQP5B/ChIDiesEAK9V7YWIzsqbg+41nVjXUL2T2uK8kh1LQmY1vta3d23BLKf385nzn0pbNg/rXgB5CA9Leh4OpMjZSwJPMAsiJ+LoA/beBQOPxJ9zRfWjQjeFP3QxKBEMAWtgBu9qBlTQ+QAVBzsDDrNRK6ccNDFlnmOMbpiWPvh1QgQZFnX6ArmpOfgcJoGJyd4okfexu/ZLe9AYZ55D+HSIvLuZd0e3FoTZif6Rq4uU4yRu6alaws7ffGY00vviOiak/nO+IFz2rFSaCv4Au36gPTOcOcV7kwH94UE18 X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2025 00:06:52.5342 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a6fe26a-2410-4ec0-812c-08ddf4b4f0b0 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB3PEPF00008859.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR02MB5937 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 ; Tue, 16 Sep 2025 00:06:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18036 While it does not make much sense to use an absolute path with include_all, if one is used, it should only be included once, rather than once per path in BBPATH. Signed-off-by: Peter Kjellerstedt --- bitbake/lib/bb/parse/parse_py/ConfHandler.py | 2 +- bitbake/lib/bb/tests/parse.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index af3af2ccee..caf526044c 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py @@ -67,7 +67,7 @@ def include(parentfn, fns, lineno, data, error_out, all=False): # "include" or "require" accept zero to n space-separated file names to include. for fn in fns.split(): - if all: + if all and not os.path.isabs(fn): for path in data.getVar("BBPATH").split(":"): include_single_file(parentfn, os.path.join(path, fn), lineno, data, error_out) else: diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py index 2f77c90f60..b4033f8cfd 100644 --- a/bitbake/lib/bb/tests/parse.py +++ b/bitbake/lib/bb/tests/parse.py @@ -500,6 +500,7 @@ EXTRA_OECONF:append = " foobar" test_helper("include_all someother.conf", None) test_helper("include_all some3.conf", " foobar") test_helper("include_all ${@''}", None) + test_helper("include_all " + tempdir + "/conf2/some.conf", " bar") self.d.setVar("BBPATH", tempdir + "/conf2" + ":" + tempdir + "/conf1")