From patchwork Tue Jun 2 06:29:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 89128 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 0588FCD6E4A for ; Tue, 2 Jun 2026 06:29:59 +0000 (UTC) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18782.1780381793302632148 for ; Mon, 01 Jun 2026 23:29:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=bRU6dVZL; spf=pass (domain: gmail.com, ip: 209.85.216.47, mailfrom: saisneha196@gmail.com) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-36d98b68d68so1411716a91.2 for ; Mon, 01 Jun 2026 23:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780381793; x=1780986593; 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=ksnDEmbb2W3adotJdi1iGKHqYcwNeFwqrHEJVUtQ9F4=; b=bRU6dVZLwMR8E7xPnWVvG8zmvz0udoK9RuwZ85ZEAaRTZloXnigg2YNLVFBnMuhqWz AEQ3BwOZgMuwKhvcwKpuamkOa9cHrtzt5AmS1iAdU9WjWAWOWhsyMNsySGDeFYF2rQH5 e3fWI7fX4HlsJcv4cROXrw7amKLudjJfLuJ9YNkF3845VFC5pDSv1ss53p7SNW828unH WHSISH0Nx55TaMGK9bYVKyKOeem14ROh2DJDp5t7SL1BOVybthbXBkKtJsGiqMXRYTFX Jp8iNoFWxZXw3w3H7xgF9PtvYTF19An/ESymY9dCDSoS+cBN+eSTmCMLyOidKDu4Qn/c 9XAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780381793; x=1780986593; 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=ksnDEmbb2W3adotJdi1iGKHqYcwNeFwqrHEJVUtQ9F4=; b=jrwn5CtFFWy9QFzCHURWfsMK5IwvsHhM1CW4eeRQ1/UL2BSal87TuU0BI1Ll+gVGM+ ffA/Yn1xG9qPP4G6zmPoZN1fkDjKF5YHf0q6zegpFHmc/shR6BXDOpzMbED/rrX/5RsV 4FULqGfsgT8TKYx0Tl4ODSyv2p1VkQ8Bfh2OwiJOc+U/dLoAh0wkqFRSbi9Z4qqeOlwr A+dKq/NN+Ib9neAA+nQ6f/mPu5nAA1x8726Q4lA5fHTilJVHUd+KTnjwua2n4snJzJoX u1EQsGABh2JHDXkIDQaENNdHXI4Qgp8+t50JtnBEWEyHE80acxMIq1hYXnwP20xJtPiY 54pA== X-Gm-Message-State: AOJu0YxSfh6Fm2+vA9aQ36kxVxTU0VAghxwEE1bHXRvIFQsfNiZWUznJ hW/6KJUfkOA09AS/38xLT4fcw58cqMBIQi1ACaITOF9sCbCFwGN+bb+g9jTMm00C X-Gm-Gg: Acq92OE+UQowWZJTOXeQt/z5sJZMT4UDXuUwFGpomUeyKtpUCcWZ+6QmtFtbCYIsaiw p7HhTrXB2WpF3cuYnFqm/aMjkPDIOB2J53ZYODCGKwPrDj78+6FsQyNz3AAr2zzEVBFIx6FBk/d Amzdt+SO0rbLemgKp1kBXgeKCSoyEpdpEoubr9jdeylK75P05dXMjNIw4BiXVfz7jNuAFRoEroB cA2zjPRl74zUd5t4mHLac+VYK8Gl3RTJccwZXHj88mXFHXb8gAwGNElmay3MTmJvqrjFqY2vFRC iH0B4NKm0QcXI5RHZ3hFX54cRWhWXYvpS/Q2+s45aPrAiK0vrCoeDfOaBiGtskFqEpapg8xTnP5 mvY2CpZOBrdud8567JWpckP6p0pygXQzaZS91HtF3suWeu7EKrEt+I9wB6oTqxD5r7jXZ3gIsfh B8xED8+NxuseSG73LjzRABpYuK2vWdGRGjIPAZ6xaZu1UMrC+LJNm+iOVC X-Received: by 2002:a17:903:1905:b0:2b2:5491:e32f with SMTP id d9443c01a7336-2bf367c8d3fmr166483965ad.16.1780381792541; Mon, 01 Jun 2026 23:29:52 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.118.80]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf23c3f496sm128280255ad.76.2026.06.01.23.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2026 23:29:51 -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, mathieu.dubois-briand@bootlin.com, Sai Sneha Subject: [PATCH v5 1/4] oe/qa.py: add check_uri_srcrev() helper for SCM URI SRCREV validation Date: Tue, 2 Jun 2026 11:59:37 +0530 Message-Id: <20260602062940.3107241-2-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260602062940.3107241-1-saisneha196@gmail.com> References: <20260602062940.3107241-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 ; Tue, 02 Jun 2026 06:29:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/238001 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= or tag= 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 v5: - Add tag= to skip condition alongside rev= to fix selftest breakage (test_git_unpack_nonetwork) reported by Mathieu Dubois-Briand - Update docstring to mention tag= parameter 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..0987aaf2c4 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', '') or params.get('tag', ''): + 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 Tue Jun 2 06:29:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 89129 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 066CECD6E57 for ; Tue, 2 Jun 2026 06:29:59 +0000 (UTC) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.19005.1780381796854998445 for ; Mon, 01 Jun 2026 23:29:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=jvrzrdK3; spf=pass (domain: gmail.com, ip: 209.85.214.176, mailfrom: saisneha196@gmail.com) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2c0b944f6edso23088785ad.2 for ; Mon, 01 Jun 2026 23:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780381796; x=1780986596; 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=jpB+/g/h3dSEsFb/quEZyqc0525Neb1HiJJbSUh39ro=; b=jvrzrdK3coWnyWfW3Ykafx9JFis0WfYvH43h/Mn1dO8REUTadE70jY4djsE8SU+9MH tP/TkuHG82EBpV9sJtPQP0hBnxZlGrSVGVOKS821wxEMWxUcyFpVVJn9oIrlNyXylthj +8hZoxPgyQQXy86SCK3quRNFWDt7ky/4hhe0pphSoabqcleFCz0Dt3JTgt9+MTgb3/X6 IjVSrGn1RZGIB8i8sk2uLLz5nvEkU7gkiMF71vWdUHHmkqQxLwmN12PdPcnDXrhavqS9 ftWYNHoQN+yAzREo5A5rqVGrcMYcj5vgei1DXeB9jqnByE+De2DdlQI0GSaRtDkj3npr PAhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780381796; x=1780986596; 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=jpB+/g/h3dSEsFb/quEZyqc0525Neb1HiJJbSUh39ro=; b=O7hXPPyVb648iUifkhNwh24UK8GSB5aT4Cx+uRzMb+0dK/78yJF+lU4YpvzLIU9j8Q UfpQrkvT60XryjTbo+lPQQS+Ykeagda9+iKUfhAssI9av08b9soa9H2gP8342Uugv6nI XYjhQ0hyQuGZc3dDu7dF8jnCJEsukhcyNxMm+29S9tAy0c0e1T/aUgWhe5nzg/5IysLF NqgiZc5j3OPvX2LcMJuumBEBxsFwA6uJkM2BEI3xgvYrR2Uy90f0SOT36jeQnZ58jH1s yd3b+URpcHkZbubTRf2Cip4E67gvX04Mn4LbAPiELchF8o5Gcoos22wBX1h4GhZyStVq Btfw== X-Gm-Message-State: AOJu0YygYeyr1QlyiASnJ6HFqf8Gn4iy0RysLoY6xn63MxNRiD8rewFN edNm0qCtUxlRL2hTJU6khyUpOukPKkphThLPlAU7yHEJ79RPJ5BLsAQIkEjHqhsT X-Gm-Gg: Acq92OGbpRF+867/97flvpDe4RpB99VO/zghSJUhoiwXQboWWO1GdwkjxyInyTf6fIy mZNk/MMovMFHnW6Poav/+Dnpy+xZmJOxkE+mcnJWauMPDhU/h4ijGC7w1RTqEDW32NubZVLwWpe B2Cnwbql6Kg0BYJVf3Pvum+Nv1XtmmRDTJ0QLx3RzVxRb9o9w5XAIk4jN0N8RNPc6HnRuLgSm+J QZMNr5FYIjA4zZxsBKUqWw6Ah8BitLRQtInahD70eFE5Z/4/H3wxJol2SND0UeAN5YJv5XGjpeK 5EETyyJaMLnoPuZVR+s9D1UWmNIAo/cYvntnkvTVRZvAZLp0Wy9alUu88CGAC27b94kXaH0M3wH pK/gAYqYH+ePRV16cDewIbGWKAGIBEQ3U0zuwjEO54bHaeV8CKVBdpW20/T12WtNsAM66ova57C cdyMxT976DifjDqSwjac9G55AqmHFScgHqzhR6ESUCb2OBhyDMUR8g/oBg X-Received: by 2002:a17:902:e54c:b0:2b9:fb0b:b727 with SMTP id d9443c01a7336-2bf36876f36mr152915135ad.39.1780381796186; Mon, 01 Jun 2026 23:29:56 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.118.80]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf23c3f496sm128280255ad.76.2026.06.01.23.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2026 23:29:55 -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, mathieu.dubois-briand@bootlin.com, Sai Sneha Subject: [PATCH v5 2/4] base.bbclass: warn when SRCREV is missing for SCM URIs at parse time Date: Tue, 2 Jun 2026 11:59:38 +0530 Message-Id: <20260602062940.3107241-3-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260602062940.3107241-1-saisneha196@gmail.com> References: <20260602062940.3107241-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 ; Tue, 02 Jun 2026 06:29:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/238002 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 v5: - No changes to this patch 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 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 Tue Jun 2 06:29:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 89131 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 BB833CD6E66 for ; Tue, 2 Jun 2026 06:30:08 +0000 (UTC) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.19007.1780381800391069783 for ; Mon, 01 Jun 2026 23:30:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=DHozkIcT; spf=pass (domain: gmail.com, ip: 209.85.214.172, mailfrom: saisneha196@gmail.com) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2bf125989f2so32107445ad.3 for ; Mon, 01 Jun 2026 23:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780381800; x=1780986600; 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=HOu1v7lUDR+e961YSbsy9UmtR1z27yZjJZUbbCQzPN0=; b=DHozkIcTVEPTnCbBYSgm44e5kqcc7xYQ3PPDKqT7Nj8DnYmQRJ4L1QSld6sbIgImJC IusUIIHqNBka6zjvK2aujSiL2Ce0fqz6zOECx3ehtgBbfiSMphmWHBqzcdDeEVhj+ljQ s6EckLL8xKQ5yjOi7gLGcTRClUL7gh/+eN0VZAGGffuntDPllx80zaEp8shEie4KWVhE KpsprU7HPtAdJ4kQJSmdorenPqZUk/KP8CzwAx9UCExDaVnPo5KTGgSSX95MH2rszKnG 7L250SDeY7zd0hHRJIj/dNbjReEq/6Cm6ai7YyYIG97eL7yaURAcW560FHSfh7w8/zh8 Fsbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780381800; x=1780986600; 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=HOu1v7lUDR+e961YSbsy9UmtR1z27yZjJZUbbCQzPN0=; b=pMecyaopwY1K+LApTAzxa0NjilvuOjkAEt3Y8Y9e1PchIAuwu60IhC0bzKy1HlzQDp 45sc+zuuzUC3TJ+XysxwAlKU/MwJhwOqP4XHEBVtrvTEXEC/WBQIuvQU5D3YbGM7lXJw wLhKOHd4lcFSEx9G+KNRYDzgBYnCWSfR4YWSmYC5M1l6IewOyOX86luI5PkexIK6Gah4 MkaWd1wSrN1TeSYs2osf9CnYNKPjZiThDTQs4FHS2MlDAB2dfDVbXVXj/bLQbwoccdNf UhxfCSltLpuXhO8RCrSCZe3NES1brGfepNWHmZIKpLFGCnXXTmMmyTm/GTKeoio3jtSP 5Ptw== X-Gm-Message-State: AOJu0Ywer810BTHfyBdMjZqSKwV1ku8FJVSc+Q7yOLtWBdnZG+Qlt81d hfgVRrsThC4xe+W+UbHGkQ3WMuPNQP2+tFEofxJGOUTtz5NeQiyHJICnzEtAhJSE X-Gm-Gg: Acq92OHS5I7qpmKdltbTzHBSmRvMyEHjqiQqhButGow2dWEXdstCUcB+e7ZDWiNtAkf 9OSaobXRX+x1J7M+VfCtazBR8OPPzeuREuk8kAO5gBfc/7Fp/fzNNlATPvBJd3ZDQ67DLC4noyX QkGQ355zYDLavwYsenB3qH/FPYK0e+9sg+rLktMb1oRD8QyrgX0TZDEle/d4gkU3M0VNcqUaVU+ qHOMiNwU2vy24+eOdYTtbbgR2vkwUqXmSmYrDfjOjEm3fYY1nWhiB527tyHDNI0Hf25uzvKWhJn rnvZkWYvlzS7jlelO2uOiYUvZsR/GhcW4uWJVFx8amcC7t4cP5p5n+Au2SSGaQ+aLw2sbwegOuc EtUX/JJiSGrXheetQa2AOsYTpl0td4M/83BvbxO+PXYqzreG7O2dkAAlAaZngZ4p7jBbd2isH/J 2lXU57LtV2iB/rfsYNI6X3z+Mea4r5IwV62Nv09kJ5g7w+EdJ8MD7NiEVMCsjly+mjEH8= X-Received: by 2002:a17:903:32ce:b0:2c0:c37d:dfc1 with SMTP id d9443c01a7336-2c0c37de0dfmr121172215ad.34.1780381799812; Mon, 01 Jun 2026 23:29:59 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.118.80]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf23c3f496sm128280255ad.76.2026.06.01.23.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2026 23:29:59 -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, mathieu.dubois-briand@bootlin.com, Sai Sneha Subject: [PATCH v5 3/4] insane.bbclass: add missing-srcrev QA check for SCM URIs Date: Tue, 2 Jun 2026 11:59:39 +0530 Message-Id: <20260602062940.3107241-4-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260602062940.3107241-1-saisneha196@gmail.com> References: <20260602062940.3107241-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 ; Tue, 02 Jun 2026 06:30:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/238003 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 v5: - No changes to this patch 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 Tue Jun 2 06:29:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 89130 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 AA3DFCD6E57 for ; Tue, 2 Jun 2026 06:30:08 +0000 (UTC) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18786.1780381804053412509 for ; Mon, 01 Jun 2026 23:30:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=ZCEEmB+0; spf=pass (domain: gmail.com, ip: 209.85.214.171, mailfrom: saisneha196@gmail.com) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2c0c2d8b95bso13951505ad.1 for ; Mon, 01 Jun 2026 23:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780381803; x=1780986603; 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=+kcw5aBv0NpXy+Rq9f7djHWCVs2nkOPFQn1bwVhFzkQ=; b=ZCEEmB+0QX1HgwIx9w7Vj6rjSTX8emxdUwqapj1fGvKjqNOcS8dgQlmXl2+Wi0lqta qTlkPE77uD+a5+5rXqK57i9EvktYS/pmevXRUQQPNF2m9F4cwPxONCHMHzE76ckliua3 M8qlktc5DQxcMCdp1BjqczfPd7bdtk4687dR2pbbe1Cb2dU0SaGZbkT8wm0+0m3GtYzb Xs2OlLYKNwFbOQi56PJ8eEGzUc+nYAep6S7u395zpmGY99zjsivrjsd4nl7f/jIi3dFq dS01afKJlXiGMudfsSxp2akwER4ZqrJHNGsy/m3eHbRPNo9ut+IM07cOeFhSkCgo0pcv giKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780381803; x=1780986603; 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=+kcw5aBv0NpXy+Rq9f7djHWCVs2nkOPFQn1bwVhFzkQ=; b=Acjq1nuT1stbhKzXkzeenuzBeGYXTMgRH/upO9/1ImJm6oYzVgMNJ3/nbzQOMpmPWr Oz2afekAAwaDtlTLou2Una8rFzG8jmHUFev8l7B4w7Od9xt2mMCtwUdeAsbn0HdrdmTx 3mfCa68uhjB4ix+WHk87tR+MdbrLGlXTXEKGwRxaOJysxoEqvXqyjNHGrLPQez+8iZuR 3svSOftJuIzBas0J8nkIt6kph3RIVXVXa1vGTGiFGI7JePBPxwpPIq0hmQ0dvmB7PJO7 sfWFG/y8VUHOnsTNbakRAxnsELDOcmTLIFNykPKEdKV5M2ASO4Ul67c5tQ4GjlLewDdq sujA== X-Gm-Message-State: AOJu0YyLzu91/iG6x3wrWvET1su1DmrbdSqv/ISpkYF1T6UsVx9u7Ht7 4poRT0Aj4YnnPRbffGCyvAdHM3IkAkenxTBSRAOblBcDhE5rwVD5B7Ks7Wzrz7Xk X-Gm-Gg: Acq92OGmSlIp4TLVMQce/z7bPDXEBNZqaovIHL7+AULlM168fP82bZN83mFLEzb1VxV n9n8u8HVcff2vJcr2gsU2H4lhDQtEbVFARbj+v6C5+Xc2JyD7YFkFULITd7zF6R5bJeRVy7hNOg uakpngqNt4Mx8+Bonl8K1JYTPWIl9dUAWPruTnEkQdUpvZsWT1/ykUgtkXCkFM7sZWKqspF96hv j14hYUNql6Wm5nMJ2JSI5eyscksvmicBrQe0M6j+PH/Ve1FSLDWbF1brcEZV2DBYHcbx93YMVjM AXG17wY8SMZf+WN+VeWB1EBxHrJray548VKPjjPXMOaXigjR41A89OeoltpTmPbsrz3xb9eot7G Dw9/wmCTqDo62y+mz192yK+iTfYVC+kt8gAh1mOLz4dlLVinbJSe06rSXd466izLyfkxvHJ5ybV LHuan3c0kMKcyaSI60r/VkkKOdajAC6we7mTNnIwtnReWlLT8/oKjysNXH X-Received: by 2002:a17:902:e743:b0:2c0:aef8:23eb with SMTP id d9443c01a7336-2c0aef826d2mr132151175ad.25.1780381803429; Mon, 01 Jun 2026 23:30:03 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.118.80]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf23c3f496sm128280255ad.76.2026.06.01.23.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2026 23:30:02 -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, mathieu.dubois-briand@bootlin.com, Sai Sneha Subject: [PATCH v5 4/4] yocto-check-layer.bbclass: enforce missing SRCREV check during layer validation Date: Tue, 2 Jun 2026 11:59:40 +0530 Message-Id: <20260602062940.3107241-5-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260602062940.3107241-1-saisneha196@gmail.com> References: <20260602062940.3107241-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 ; Tue, 02 Jun 2026 06:30:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/238004 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 v5: - No changes to this patch 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 +++++++++++++++ meta/lib/oe/qa.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) 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) } diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py index 0987aaf2c4..3da45e33ce 100644 --- a/meta/lib/oe/qa.py +++ b/meta/lib/oe/qa.py @@ -245,7 +245,7 @@ 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 '' for non-SCM URIs or URIs with inline rev= or tag= parameter (skip). Returns None if SRCREV is missing or INVALID. """ import bb.fetch2