From patchwork Wed May 27 11:17:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88823 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 5034ECD4F54 for ; Wed, 27 May 2026 11:18:15 +0000 (UTC) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18206.1779880692327707687 for ; Wed, 27 May 2026 04:18:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=ONy1jpBS; spf=pass (domain: gmail.com, ip: 209.85.214.182, mailfrom: saisneha196@gmail.com) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2bd2c147abaso70054675ad.3 for ; Wed, 27 May 2026 04:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779880692; x=1780485492; darn=lists.openembedded.org; 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=B8p4VPUTVkx8Bgu9uxt/nQ7yvo0tDR4nGUc0FGCSoC4=; b=ONy1jpBSRUbip/WHyELbREBIAfO1YqcYQp3Pnr4o+bDAR46PybLy0ejvEEVf6geGfj aP6DWvOzEk/L3vQRbafP5EPNhhn8gDvt7Va9nhOwrFyUxs1rmCx4JFlYcomi1wEobxdX S/63sePdbLx8/mwH7zQCoL1HZTL91nMhvxEHtBOpK0wi+AbFx+B88GFmsoKfaRqLsmEm M6tSQ4r8/+W77W0Kr8FlrAHcxSZrk1870/zWWKyLFeunfMwU+XajYaqMoqK6U/I4IUmw 5C9kE70S8OD+s2AeMN1ZigZn9Srdy3i8ojWrTjgtKYFRoyUnAbUi7WWt5NTNktYz0k6b A0Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779880692; x=1780485492; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=B8p4VPUTVkx8Bgu9uxt/nQ7yvo0tDR4nGUc0FGCSoC4=; b=jINGRzuUbfQp0/mZYr6SSN68f9FG/Sm2EH221Bv+y7x+/QRHzOQFLoDMuruzJU7KKN xT6P2V3Bru2kxoyHS7c447mIiroIN1y6Cj6WD0fcawlKHG5yEHo0OAOQpHpClvKiVjrr ZuvSQd2OKZBL08k+6+QGanfNcdJ/zqEDdbc29ytPbwNLymPXKpjblr9s7uMD/OgXVKge bbZOGs1vzhlqO5NaoblVvYWRwchbTE5kqT2FIdPANcE+1n+/00oQaM6dWNC/gHrcDDjR XReI5DOuy7F/avWNtgiMxtcETxgPSQUMtQD9orXDSDmiM4RWWMwI7iyw4WCKZnsnjJ2P jR9g== X-Gm-Message-State: AOJu0YxSjZgwOr6cDQhOaXIyxM8zc8HV50/j101h9QsYe+34Kvg4T9MW Bzq+zfsyC9DTE+6e3dBZDvSqcvUWVo2zx1mmjTzo6pJD9bViqRkRA6sz8zsC1nDK X-Gm-Gg: Acq92OE9ewJperIlT5lUGDBAIBYX2j+uOCyvwy6Dw4ekjSybZDsXcu5YSZ7K3avPvIe AyOOW+Bb8YmZgZfsSD5ujtrD7WDV7ALEn/AVQEaiY3/44a6OKKGyTMCBaRRfjo6phaER6TR46wm kaPr5nwv2odwUgKC0gi5ckzqs9fEBcfgwDo4Az0TYTfgWp0nppQIVHAyzRaiyvAAbwQxrbeYx16 li0Y/PpD0f7na2095oHT0yyg9MsslOnkWWUYDRGMJEqyk6ox0laziUj8e7RxUn0T5Cq6ixoEQ03 eOl+V7R7vu42kTxgpVW8YNkV4Yzfg5sFGKY7d1NfJyTJIEKWrv0Cf3BEGcINzfpkD/f6mDNrpX7 Rwbi5rdthpKrNX/+bDZl1oC3srHbWYClyQMbLtSkfZpMZObIRpUYJdq69vmVf44g7ke1LS3s66T FG0A3f/SS4LvyUvNVOZfWCTXo7GndE34JwvJ5EYFljlJWkPBUieB3AOFHp X-Received: by 2002:a17:902:e745:b0:2bd:158d:299a with SMTP id d9443c01a7336-2beb05cead8mr246671605ad.25.1779880691572; Wed, 27 May 2026 04:18:11 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.21.184]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2beb56b9fabsm192079475ad.23.2026.05.27.04.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 04:18:10 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, martin@geanix.com, paul@pbarker.dev, Sai Sneha Subject: [PATCH v4 1/4] oe/qa.py: add check_uri_srcrev() helper for SCM URI SRCREV validation Date: Wed, 27 May 2026 16:47:53 +0530 Message-Id: <20260527111756.1306022-2-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260527111756.1306022-1-saisneha196@gmail.com> References: <20260527111756.1306022-1-saisneha196@gmail.com> MIME-Version: 1.0 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 ; Wed, 27 May 2026 11:18:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237642 Add a shared helper function check_uri_srcrev() that checks whether a single SCM URI has a valid SRCREV set in the datastore. The function uses unexpanded getVar() calls (False flag) to safely inspect SRCREV without triggering AUTOREV expansion or live network fetches. It mirrors BitBake's internal SRCREV resolution fallback chain exactly: SRCREV_:pn-, SRCREV_, SRCREV:pn-, SRCREV Returns: - The revision string if a valid SRCREV is found - '' for non-SCM URIs or URIs with inline rev= parameter (skip) - None if SRCREV is missing or INVALID This shared helper is used by base.bbclass, insane.bbclass and yocto-check-layer.bbclass to avoid duplicating the same logic. Reported-by: Yoann Congal Fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16051 AI-Generated: Developed with assistance from Anthropic Claude Signed-off-by: Sai Sneha --- Changes in v4: - New patch: factored common SRCREV checking logic into shared helper - Eliminates code duplication across base.bbclass, insane.bbclass and yocto-check-layer.bbclass - Uses for-else pattern, f-strings, simplified name lookup - Adds docstring explaining return values Changes in v3: - Added AI-Generated disclosure and Reported-by tag Changes in v2: - Initial public submission meta/lib/oe/qa.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py index cd36cb5070..3505e2492c 100644 --- a/meta/lib/oe/qa.py +++ b/meta/lib/oe/qa.py @@ -240,6 +240,36 @@ def check_upstream_status(fullpath): else: return "Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines) +def check_uri_srcrev(pn, uri, d): + """ + Check that a single SCM URI has a valid SRCREV set. + + Returns the resolved revision string if valid (including '${AUTOREV}'). + Returns '' for non-SCM URIs or URIs with inline rev= parameter (skip). + Returns None if SRCREV is missing or INVALID. + """ + import bb.fetch2 + try: + (scheme, _, _, _, _, params) = bb.fetch2.decodeurl(uri) + except Exception: + return '' + if scheme not in ('git', 'gitsm', 'hg', 'svn'): + return '' + if params.get('rev', ''): + return '' + name = params.get('name', 'default') + candidates = [ + f'SRCREV_{name}:pn-{pn}', + f'SRCREV_{name}', + f'SRCREV:pn-{pn}', + 'SRCREV', + ] + for candidate in candidates: + rev = d.getVar(candidate, False) + if rev and rev != 'INVALID': + return rev + return None + if __name__ == "__main__": import sys From patchwork Wed May 27 11:17:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88826 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 48E8ACD5BC9 for ; Wed, 27 May 2026 11:18:25 +0000 (UTC) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18207.1779880696022171531 for ; Wed, 27 May 2026 04:18:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=SG8kHsYs; spf=pass (domain: gmail.com, ip: 209.85.214.169, mailfrom: saisneha196@gmail.com) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2ba3e3c4f87so120413775ad.3 for ; Wed, 27 May 2026 04:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779880695; x=1780485495; darn=lists.openembedded.org; 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=HKw4duNbVMOBya/K3geGSAwJYTxnEOs1P8UhruKJBMg=; b=SG8kHsYsSxxbQmJjbpazoWMVY5JCRLo4D/d7yBLL2/jQiWpNGhwEQhemnSAGTQSF9T QX7jSLoDY4qjjcB+YgPwfhwQFtr9HL96hsp1GLf2exyqYezNh00nf7FCtma66hbMHyEl tcxdPHSOEqmvXKivmzg40Kf38TBgX+QkfOtiptboJeNh4oHQBsZA3SENvaRUmmVCQFor Xfnwqq1Zr2fRGHFk6DCzFoV5CEqxl6IcqF56VxWJ7XH9IFL0FNkpoAxYpM1OdkYnlRUu ijIA/58AsjcJ2qG93L0wL80y4wzskfy3/NF2t0QzsuKX5hoUF/v2CCUtJwXLHqiG7pQe rhEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779880695; x=1780485495; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HKw4duNbVMOBya/K3geGSAwJYTxnEOs1P8UhruKJBMg=; b=ftY8xucymsHCs3fpRGeK0f25fg82VxxA0VvdbtG5MWyVDvFRsfuS57yqrTy7xur9d+ 8KWnc18i9RLXZ/ZL6UKmvhc0vhcZWLjPKrNruKtpWeRlelSyUefraKe0LaOTa92QpXd+ M8sZ12vN4KwW7WZga9yBxfl1l9m5LeU5RCqhNHPemGXvorbWQW4OmPUCwWQ0dTjhrmGR 218Ju5Y6EEuK8hbjfdNA/5AIWjvJcIvgXjN2ZZCyU/qDSZAPd/k/Brucqtb+DqVlSG7N J2mt3IqYG52rpvDLxR1NRAhAIit1ahsZKN229PTymTV1ZWgQjDWcEWV48cbP1eCFG/6T NY1Q== X-Gm-Message-State: AOJu0Yw0TUBmirxK9IjTztMAgqMnjw79fVBlQ5Cv5KJVgn2sAFwyIdBb 1iGT5oHkhdGqRBkKRumdal/9Vicg+RyRn9iMhqoGd34KQOp1UPugCTkVuYQOv2yF X-Gm-Gg: Acq92OFa4s6skJMjxL07K2Z1OACHCR4+J+pPs8N4Tc7R3m8MqkdbpK3vkett6cjnNrU kEIr9F2rwZqhQK3vrDDN4vDe4jA7UwLIBMPjpdSsH6ECRwSKZ+GSTvY+ubmEujaLAprlgvCfdS5 r06pryUrviz4f+9pG4uNGiKcUH05Rj9dKS8zfW/8wZlGI0cUMXKIPaK+JC2be3FkHDZD+W1YL5w yA+LCerpYmXe1bMA9a1ikYTUC1InnY1ycscSgNJIIpK3bmMP23454Bi986otIoUUjOvVvhQhKZw qBTcmuAiKnLFW81BiBzFM4ehYRTXDNvqBxsUJ19ghnPU3R/h6OWppWIKJ8TC6ow3Y6peKYxCBlK 09XU3d5I/m3yeVYHZTPFcScI2QREn5m4XNf7lOn/+MEIoEeZdrH1Vifxihn30O1Lah4hnVgghBW D6P8B2rAHo12aXa/VJ+mfXSWSzC9RMfqythwyGuyhsFoqBfvu6e5YTeaHZfs+9XkjrXbg= X-Received: by 2002:a17:903:350d:b0:2b2:4cd2:e162 with SMTP id d9443c01a7336-2beb065aa18mr253545615ad.34.1779880695126; Wed, 27 May 2026 04:18:15 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.21.184]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2beb56b9fabsm192079475ad.23.2026.05.27.04.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 04:18:14 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, martin@geanix.com, paul@pbarker.dev, Sai Sneha Subject: [PATCH v4 2/4] base.bbclass: warn when SRCREV is missing for SCM URIs at parse time Date: Wed, 27 May 2026 16:47:54 +0530 Message-Id: <20260527111756.1306022-3-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260527111756.1306022-1-saisneha196@gmail.com> References: <20260527111756.1306022-1-saisneha196@gmail.com> MIME-Version: 1.0 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 ; Wed, 27 May 2026 11:18:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237643 A recipe with a git:// (or other SCM) URI in SRC_URI must have a corresponding SRCREV set. Without it, BitBake performs a live query on the remote repository at every parse, breaking reproducibility and causing parse failures under BB_NO_NETWORK=1. The trivial fix of checking SRCREV in insane.bbclass do_recipe_qa fails because fetcher_hashes_dummyfunc[vardepvalue] expands SRCREV at parse time before QA checks run, causing a FetchError that halts parsing entirely. This was identified in Corentin Guillevic's RFC series and confirmed by Mathieu Dubois-Briand's autobuilder testing. The fix intercepts at the vardepvalue expansion point by introducing check_srcrev_set() which uses the shared oe.qa.check_uri_srcrev() helper. The function is called conditionally: fetcher_hashes_dummyfunc[vardepvalue] = "${@bb.fetch.get_hashvalue(d) if check_srcrev_set(d) else ''}" Note on design choice: we intentionally use d.getVar(candidate, False) in oe.qa.check_uri_srcrev() rather than srcrev_internal_helper() because the latter expands SRCREV, triggering get_autorev() and live network fetches -- the exact problem this patch fixes. Note: parse-time warnings intentionally complement the QA-time warnings added in insane.bbclass. This is necessary because CI pipelines running 'bitbake --parse-only' with BB_NO_NETWORK=1 (the original motivation from Ross Burton) would miss the issue entirely if only QA-time warnings existed. This pattern is already established in the codebase (e.g. src-uri-bad fires at both parse and QA time). Reported-by: Yoann Congal Fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16051 AI-Generated: Developed with assistance from Anthropic Claude Signed-off-by: Sai Sneha --- Changes in v4: - Refactored to use shared oe.qa.check_uri_srcrev() helper - Eliminates duplicated URI parsing logic - Added docstring explaining True/False return values Changes in v3: - Added AI-Generated disclosure and Reported-by tag - Added design decision notes to commit message Changes in v2: - Initial public submission meta/classes-global/base.bbclass | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 62f2814bb7..7de896ca7d 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -164,14 +164,40 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True): if notfound and fatal: bb.fatal("The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:\n %s" % " ".join(notfound)) + +def check_srcrev_set(d): + """ + Inspect SRC_URI for SCM URIs missing a valid SRCREV. + + Returns True if all SCM URIs have a valid SRCREV or AUTOREV set, + allowing get_hashvalue(d) to proceed normally. + + Returns False if any SCM URI is missing SRCREV, suppressing + get_hashvalue(d) to prevent a FetchError parse crash. + """ + import oe.qa + src_uri = (d.getVar('SRC_URI', False) or '').split() + pn = d.getVar('PN') + for uri in src_uri: + rev = oe.qa.check_uri_srcrev(pn, uri, d) + if rev is None: + # SRCREV missing — warn and suppress hash expansion + if bb.utils.contains('ERROR_QA', 'missing-srcrev', True, False, d): + bb.error("%s: SRCREV not set for %s" % (pn, uri)) + elif bb.utils.contains('WARN_QA', 'missing-srcrev', True, False, d): + bb.warn("%s: SRCREV not set for %s" % (pn, uri)) + return False + if rev and '${AUTOREV}' in rev: + return True + return True + # We can't use vardepvalue against do_fetch directly since that would overwrite # the other task dependencies so we use an indirect function. python fetcher_hashes_dummyfunc() { return } -fetcher_hashes_dummyfunc[vardepvalue] = "${@bb.fetch.get_hashvalue(d)}" - +fetcher_hashes_dummyfunc[vardepvalue] = "${@bb.fetch.get_hashvalue(d) if check_srcrev_set(d) else ''}" addtask fetch do_fetch[dirs] = "${DL_DIR}" do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" From patchwork Wed May 27 11:17:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88825 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 2856ECD4F54 for ; Wed, 27 May 2026 11:18:25 +0000 (UTC) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18208.1779880699469262002 for ; Wed, 27 May 2026 04:18:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=cv0wADyG; spf=pass (domain: gmail.com, ip: 209.85.215.180, mailfrom: saisneha196@gmail.com) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-c8026aa4d53so8430400a12.3 for ; Wed, 27 May 2026 04:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779880699; x=1780485499; darn=lists.openembedded.org; 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=1yrP1iOiTWH05MxGYpUz7ebX1iRjLBXWYg8AUbKQZuw=; b=cv0wADyGX6IlB/KpDZ7E1Uy6DnJwHT/J7SYRgcd0mGHiBDGMqg0zcIDbadmN3CgPdA FsVUNnQOu/H+T7vrkvcj6oW5Gmy5stGnhcZPZBu0BNQvAqb21n0sQcElKSaZZF6mOGQd qp1RdXNBy5bK/D4Yzkl/g1DnprXYbAb9UjByWiKZa0lNxk9xwVNA8Db5vl4tD9achQmW nmkUOicjYZN5wC9Dr8peQJ4qck25Wzrqw2JVccEtbNNbH0FvWkQABL/65xpZgj7dtisO v776mYxWfOZTEFxqtYKkiqUofF+yBbV4dZWYk0fcKSOjZHM4hx8EDrl2duQfWwjDelY1 qqZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779880699; x=1780485499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1yrP1iOiTWH05MxGYpUz7ebX1iRjLBXWYg8AUbKQZuw=; b=GJWGs3jRmSZbRH3GfbyjvrXs6wamPCnOhnkIgmVLMKWwc8nEytORRVA8ciD+CuAsYs 1TN4e70YJzR4sGNTSdb3Vz3PU0cyho4nVNx0hImcZa8AYrnDfYMSwGKLr9R3/7QGS3Yz +8HNR5uIB93ovjYywWwVTLSfvEvVLo4kUOjYk/IcMaheRoc75JUYlPq2SuNZ3TlS4d1z M7sE5o9Vacwib/wkYXBzc8rtkyOOg8NfsnBEX6F650iYvzzLHr3T9YZQObJprg7bNXtv g93k23eieIv6rZ0yoTscFI9zX1pOcKysNKeiZdMe43/jOV2EfTXlw8XBFcq6DAO+uP5k lgig== X-Gm-Message-State: AOJu0Yxc6WNEaihs0pwbAeT4lwQMO1ghFmNL2+VwSRbOY19I7rJ2rxPC 07VPDIS8pBlVRsbKElomXj7SoB2igncZg5yq5hzsTJCcfsRXZNigp928J9fd9ybg X-Gm-Gg: Acq92OFSht6SEhgqZinQKHB6ESRxRCNCQvtEnAI2CWEzHbc8P6RunhQVKdGQsw/7wMW IZ56N2ECQXW9CKlvyfkMNpLy+8HbhB6Fx4wXNSmpJYWBZvTfsdzliSd1sv94p59GTLJ115IF3GC 8pnEeFd0fQaI8NYyNrcJbc6t7j818evkXp0CCPRByVRpPCSyr6EYIcl82beGIerR+DwQCiqi0d8 KJ9BVY9u11Y/72iGG9kcuYasEPV6OXfRG5relHVYSU7o/6x0jhNEs8tQLLeR1DQ+HxUnIyOjbJb C71c9hZHpFWKi9xSCmpq89T6ExBQG3NeCEgj3zrnHJyXUDr8tttVtHhyrW7H3FFYgglGLDIzRgt VctPH0dNCPkUWCJNKPl5JWLDCYxUNZDvbysRED93uN8PA1A1bDNfcAQf1NFJWceK3EeKqIQHd5q MDcWLnt2jJLqgn6ddjs2dBzlCp2vGQ+bd3ypEup4Isu+h+/T8I800x5ncC X-Received: by 2002:a17:902:f544:b0:2bc:e628:9cc7 with SMTP id d9443c01a7336-2beb05da027mr251376915ad.24.1779880698764; Wed, 27 May 2026 04:18:18 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.21.184]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2beb56b9fabsm192079475ad.23.2026.05.27.04.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 04:18:18 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, martin@geanix.com, paul@pbarker.dev, Sai Sneha Subject: [PATCH v4 3/4] insane.bbclass: add missing-srcrev QA check for SCM URIs Date: Wed, 27 May 2026 16:47:55 +0530 Message-Id: <20260527111756.1306022-4-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260527111756.1306022-1-saisneha196@gmail.com> References: <20260527111756.1306022-1-saisneha196@gmail.com> MIME-Version: 1.0 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 ; Wed, 27 May 2026 11:18:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237644 Add a proper QA check test_missing_srcrev() in do_recipe_qa that fires at build time via oe.qa.handle_error(), using the shared oe.qa.check_uri_srcrev() helper to avoid code duplication. Severity is controlled per layer: - WARN_QA:append = " missing-srcrev" for all layers (warning by default) - ERROR_QA:append:layer-core = " missing-srcrev" for oe-core (strict) This follows the same pattern as missing-metadata and missing-maintainer which are warnings globally but errors for oe-core. Note on CHECKLAYER_REQUIRED_TESTS: missing-srcrev is intentionally not added to CHECKLAYER_REQUIRED_TESTS because that would promote it to ERROR_QA for all layers globally during normal builds, contradicting the layer-specific enforcement requested in Bug 16051 Comment 3. Instead, yocto-check-layer.bbclass enforces it directly during checklayer validation runs. Reported-by: Yoann Congal Fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16051 AI-Generated: Developed with assistance from Anthropic Claude Signed-off-by: Sai Sneha --- Changes in v4: - Refactored to use shared oe.qa.check_uri_srcrev() helper - Eliminates duplicated URI parsing logic - Added note explaining why CHECKLAYER_REQUIRED_TESTS is not used Changes in v3: - Added AI-Generated disclosure and Reported-by tag Changes in v2: - Initial public submission meta/classes-global/insane.bbclass | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 04700be71c..1fe426646d 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -49,6 +49,9 @@ ERROR_QA ?= "\ ERROR_QA:append = " ${@bb.utils.filter('DISTRO_FEATURES', 'usrmerge', d)}" WARN_QA:append:layer-core = " missing-metadata missing-maintainer" +WARN_QA:append = " missing-srcrev" +ERROR_QA:append:layer-core = " missing-srcrev" + FAKEROOT_QA = "host-user-contaminated" FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \ enabled tests are listed here, the do_package_qa task will run under fakeroot." @@ -1455,6 +1458,15 @@ python do_qa_unpack() { python do_recipe_qa() { import re + def test_missing_srcrev(pn, d): + import oe.qa + src_uri = (d.getVar('SRC_URI', False) or '').split() + for uri in src_uri: + rev = oe.qa.check_uri_srcrev(pn, uri, d) + if rev is None: + oe.qa.handle_error("missing-srcrev", + "%s: SRCREV not set for SCM URI %s" % (pn, uri), d) + def test_naming(pn, d): if pn.endswith("-native") and not bb.data.inherits_class("native", d): oe.qa.handle_error("recipe-naming", "Recipe %s appears native but is not, should inherit native" % pn, d) @@ -1497,6 +1509,7 @@ python do_recipe_qa() { pn = d.getVar('PN') test_naming(pn, d) + test_missing_srcrev(pn, d) test_missing_metadata(pn, d) test_missing_maintainer(pn, d) test_srcuri(pn, d) From patchwork Wed May 27 11:17:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88824 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 3D6ABCD5BD5 for ; Wed, 27 May 2026 11:18:25 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18209.1779880702985603469 for ; Wed, 27 May 2026 04:18:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=QTCnxGWJ; spf=pass (domain: gmail.com, ip: 209.85.216.49, mailfrom: saisneha196@gmail.com) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-367cbac9c37so6837118a91.2 for ; Wed, 27 May 2026 04:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779880702; x=1780485502; darn=lists.openembedded.org; 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=+W5wPRFUQKM0fqKiJzjpoitUyxzJryXQI8/GwX5ipbk=; b=QTCnxGWJwtSVqK5RsGJX2ob6s7UxfQCTMCqOHGG1esMdM+kZ4jaJ8KicKMAbUYc9jY 0YzvwEKV5HiXPYUFbalMmAYORPnXBHdlrEW1KqN6nhXOPR3VL/qeInO+R84p6Kmje7Cn 6/shpsH0LSQeJ5cY6aoVoeY/66k1tDGx8OjRKiQfPcqmcvbAFGyR2/rZcpIHwZlDu/qs ZB4abkeENdlcnu2lEMJ1yic0Hi3tzpGpwCJ9dM+uh2GxVbOOgdbo/2utxxSi38v6eqNH PjV9+ulVQYqFSbB2zShHPwYclqRLEdOz4pKxTxXT2TS4qqBgCQvmnlDCtkM3L5FfhIrO 9vkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779880702; x=1780485502; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+W5wPRFUQKM0fqKiJzjpoitUyxzJryXQI8/GwX5ipbk=; b=giPLm1UoH2mlI2y2qfJNRfJ2MvEBu4D31I/iQfXk7mbmGrcSrCrUXSWEZ72TnpLz95 gKl+tXY7gLG8E53C+9/0nEA+v5anNFMot5Uhe7ktw1k73A1a2WPdd+5F/VCJkitv8ViB GoB76O8IEg26XgPVQZQstJDpHZIibDCPkYJ3eXG2yFnSk/354fhwH0x5Pg++TQ2vhoq1 M5Nat2BpBRUBWh1DYG61W9ZGebcs4VUXweMgmNALmaAS2TPn3ZZrw44+55X4UzBifS8I YZXYFOZUUCk6iOyd8HW3Qe8NYIbM/smG838fmtqnRAYNECoeApuk/N56+S5sWvVGCB/4 JkpA== X-Gm-Message-State: AOJu0Yxii1y4fc3uMEcy05ND5FeARnMfYyNA0j5Wyq8EyzWY+1w4TwBG d2x1DrLHH+P2hHqEe58/PEMi/8ujCf7qf1Gvqyi0A0xEbvNH0xBUDVVjuF9fw4WB X-Gm-Gg: Acq92OFC0NY0xqF/YCoQ1xa9SPKBSH30QP6hNvhgH+RVPPAC5tEdwDLxt0I+Qfj0MP5 vI2flsl0zWQ0L2WRjZPVLSy6nHI24M78ak/PTyaxbHJRKsz1MlQzaaS341vb68iywtreZvpmQsh kW6HquNr2cqzktwaQrQYSBuiE210HmUHfxml398/vGYgB5WFeJ3mYcxn7U/xQ5Xusnj/lVTxjvU rRV92aUOmV+aghaDk9LCK5TkJoH2E4NfQzvgn4tPz8sJnOvwqMjX2TMJ/04/kmECCKRalkWLnxM nbBGPY+YbS1+gO+NzXAYuaR4fBz+rZGyq0wbEozxB/mISVkO2V4lOIE5CmNjKaFcx8bickmXnWS bEDfqMEmhpbR3GWTlPnMBCd/9cJf73d/HuiH94bN+0iDYMlOri3S7Q7W7cZgEeLUHpW6KUAW8O3 U1XJEH0NG4U0BVT8uXlvaFLCntisF7sSbkFX7FnrBphsLKFUoEzl0sEB7lsuhA3SJI/QA= X-Received: by 2002:a17:902:ebc2:b0:2ae:6259:5aff with SMTP id d9443c01a7336-2beb031adfdmr227369115ad.6.1779880702232; Wed, 27 May 2026 04:18:22 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.21.184]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2beb56b9fabsm192079475ad.23.2026.05.27.04.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 04:18:21 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, martin@geanix.com, paul@pbarker.dev, Sai Sneha Subject: [PATCH v4 4/4] yocto-check-layer.bbclass: enforce missing SRCREV check during layer validation Date: Wed, 27 May 2026 16:47:56 +0530 Message-Id: <20260527111756.1306022-5-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260527111756.1306022-1-saisneha196@gmail.com> References: <20260527111756.1306022-1-saisneha196@gmail.com> MIME-Version: 1.0 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 ; Wed, 27 May 2026 11:18:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237645 Add check_missing_srcrev() to yocto-check-layer.bbclass to enforce the missing-srcrev check as an error during yocto-check-layer runs, using the shared oe.qa.check_uri_srcrev() helper. This ensures layer maintainers submitting layers to the Yocto ecosystem must fix all missing SRCREVs before their layer passes validation, even if their layer only gets WARN_QA during normal builds. Note on design: missing-srcrev is not added to CHECKLAYER_REQUIRED_TESTS because that would promote it to ERROR_QA for all layers globally during normal builds, contradicting the layer-specific enforcement requested in Bug 16051 Comment 3. This direct implementation in yocto-check-layer.bbclass enforces it strictly during checklayer validation without affecting normal builds. This satisfies the requirement from Bug 16051 Comment 2: 'add a QA check outside of checklayer then add it to checklayer' Reported-by: Yoann Congal Fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16051 AI-Generated: Developed with assistance from Anthropic Claude Signed-off-by: Sai Sneha --- Changes in v4: - Refactored to use shared oe.qa.check_uri_srcrev() helper - Eliminates duplicated URI parsing logic - Added docstring Changes in v3: - Added AI-Generated disclosure and Reported-by tag Changes in v2: - Initial public submission meta/classes-global/yocto-check-layer.bbclass | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meta/classes-global/yocto-check-layer.bbclass b/meta/classes-global/yocto-check-layer.bbclass index ba93085325..11b7f5d2ee 100644 --- a/meta/classes-global/yocto-check-layer.bbclass +++ b/meta/classes-global/yocto-check-layer.bbclass @@ -56,7 +56,22 @@ def check_network_flag(d): if network and not is_allowed(bpn, task): bb.error(f"QA Issue: task {task} has network enabled") +def check_missing_srcrev(d): + """ + Enforce missing-srcrev check as error during yocto-check-layer runs. + Uses the shared oe.qa.check_uri_srcrev() helper. + """ + import oe.qa + src_uri = (d.getVar('SRC_URI', False) or '').split() + pn = d.getVar('PN') + for uri in src_uri: + rev = oe.qa.check_uri_srcrev(pn, uri, d) + if rev is None: + bb.error("QA Issue: %s: SRCREV not set for SCM URI %s [missing-srcrev]" % (pn, uri)) + d.setVar("QA_ERRORS_FOUND", "True") + python () { check_insane_skip(d) check_network_flag(d) + check_missing_srcrev(d) }