From patchwork Thu Dec 3 15:39:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 107216 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16865.1796312364185805444 for ; Thu, 03 Dec 2026 07:39:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=rWWXTNM3; spf=pass (domain: linaro.org, ip: 209.85.218.48, mailfrom: andre.draszik@linaro.org) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-c4395d31228so2550072666b.1 for ; Thu, 03 Dec 2026 07:39:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796312363; x=1796917163; darn=lists.openembedded.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=7x28bn53k1HyXujQOVk7bIPv97rZrGYsReRdsdapvJc=; b=rWWXTNM34MoqqY8H/sp5vITeGrKrpiSJLF/6vaozwXSUphIj5wW83yeorBXM6w+yLI YMYd6aLjxq8TLMETBAYq43mCViRZfQOrlHwyOCtwTgcP6FPTbq+DNNVw8hLvrvlPqh3V 9J8ncMRZuuYCUgJMwSRfTz+lsCryh7FHK+MXhseHHkGMzsSTAuKFXtdKlRYQWNBfH54I yDF0TewM14pYCMQm48jq7IpsFVg1qBXX0Myc3xQYX+EwlQI9szMjKDoFP4tgUR/BkYgV lGH0M0lpri9mQ3R4RWgsE8fdfq0Jfq6k0tjsnKTJOyTDvuKfCMUgCYEA+EoJ00etdPro K0YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796312363; x=1796917163; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=7x28bn53k1HyXujQOVk7bIPv97rZrGYsReRdsdapvJc=; b=LZIxX22S/rp4LLMtEAd/xde5ma/4HNCQpMKpWKNl3e8Zmk0Qkk9IHrBWNLGbnHFl4s Nf0LKNbgxroH24GAnvhk9xSFxG4Oprt8DkdurZh0uX34RzYC1z+oIPoIBqCDoXmjbQuu yqazCIMuaZrTxlQ6Tb3jMnjKI4uMPCpi7xPaXnrCmZf+yvNAQntW0khEEMmjR9KgKMaL w1RGnJM+1IpNDjrmUwUoIbAZg2eRfadurRQFcacW+vh9TFP9jG7e4zjZCd8bNshyV90t UaRX0VG1+vB7vPFFhDtab9a3eFAXvsMDrOWHDSfwepUkK4XDGZK6ta3mScQCF8PZWC8V pr5g== X-Gm-Message-State: APuU4Z8F5ddy82Nfl8oqoGfbQDbrt9nsDTT1G6tNT+KYuRYBXjwE9xGD NxNhUxyORL2nDN0+cRgD6jIjc1bE9T7qzQ5XTPpjyJZB9Zb0mSehvjmz1iAovn2b/HB3wBQgh9I dqVg/ X-Gm-Gg: AZFdTZeXHC6qvYNU2zjC9fkXLsTxp83V0aq/KCwk8MsaEsrY7A6mXvcTTdwtkKkrijV Wtb3MvZ8PftqLicYZGKURjkKoMhRHU4mp+J7ErNnGT3OprYhaDYsQy9pWfffNLApRfnts9qbVnj ZoSFscowpcQyjAUEWyGfspTGl3q3BE2EZWIwrEV3zMQPS/0NK0kTBXFPD+yxA0KS8Z2VIGYmn5k CG6T+feuPH9tz2e/8vP3Phn4whAHLYVoZACS55Me7lNEsJiXK++PHg93iU04fgr1l87rQpRct7J C2dCtsnVlImLbBWW5UTIzDAl8WRb1c4aQXACy5WoYtP9XlMyquHGaCUd1/ar88b7ZJl7Aci8+r6 xDgEp3NaUFrh7+ZsLE4bo6OZ7sfEYQJucGcGyFguKSXlFl2NUIAA6+yoy/WTzefS6uuCxROTDW3 J7puG2AGCk/CfLPUfqCMz2WO5Z/BbfaHJsAHmS4QOteoWIml7PPAxyaZqMg/FwQVTHwG6FWhWnY RyPibqnU7YZF9gQwgM/qzJj4Xm/DN/W0WRxl3xbNHxEqdKD26okU7uJRIdDg3MuMllgFVOqdKAR h29FAiJCJVbR++K5ghGaTugZUMycQ+sBgMtkpV90EvsMGqZEP+/D3Na5+D6U4HneNLF3SSuMzhe mTetg4IdLHNDIvtJH5m7Nilq6aKvWtTmZNyCDsHv2iwW3 X-Received: by 2002:a17:906:29db:b0:c4c:eb16:4014 with SMTP id a640c23a62f3a-c513a3a0107mr3257768766b.1.1796312362350; Thu, 03 Dec 2026 07:39:22 -0800 (PST) Return-Path: Received: from puffmais2.c.googlers.com.com (226.124.90.34.bc.googleusercontent.com. [34.90.124.226]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c52596350a5sm101266b.16.2026.12.03.07.39.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 07:39:21 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= To: openembedded-core@lists.openembedded.org Subject: [OE-core][PATCH] checklayer: fix show-layers regex in add_layers() Date: Thu, 3 Dec 2026 15:39:20 +0000 Message-ID: <20261203153920.419088-1-andre.draszik@linaro.org> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 15:39:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251906 add_layers() parses `bitbake-layers show-layers` with `r'^(\S+) +([^\n]*?) +(\d+)$'`, which expects the old three-column `layer path priority` output and fails to match any layer after BitBake switched `show-layers` to `layer path version depends` (bitbake commit 4bca2d0ea404, "bblayers: Switch to use layerdata and new format layers"). Even layers without dependencies fail to match because `version` is left-justified with trailing spaces. As a result, calling add_layers() repeatedly appends duplicate BBLAYERS entries and triggers `ERROR: LAYERNAME ... is used by both ...`. Match the new two-space-delimited columns, making the trailing depends column optional and requiring at least two spaces between columns so single-space paths and diagnostic lines are not misparsed. Tested against synthetic show-layers lines (empty, trimmed, and versioned depends, paths with spaces, long names/paths, and NOTE/WARNING lines) and via repeated add_layers() / add_layer_dependencies() calls against a fresh build directory. Fixes: cb771198c206 ("checklayer: Update for layer format changes and removal of collections") AI-Generated: Uses Gemini Signed-off-by: André Draszik --- scripts/lib/checklayer/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 5fc2ef7058..3166593e10 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py @@ -228,7 +228,7 @@ def add_layers(bblayersconf, layers, logger): # Don't add a layer that is already present. added = set() output = check_command('Getting existing layers failed.', 'bitbake-layers show-layers').decode('utf-8') - for layer, path, pri in re.findall(r'^(\S+) +([^\n]*?) +(\d+)$', output, re.MULTILINE): + for layer, path, version in re.findall(r'^(\S+) +([^\n]*?) +(\d+)(?: +[^\n]*)?$', output, re.MULTILINE): added.add(path) with open(bblayersconf, 'a+') as f: