From patchwork Tue May 19 10:32:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88363 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 19A35CD5BA3 for ; Tue, 19 May 2026 10:33:00 +0000 (UTC) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18087.1779186779614088854 for ; Tue, 19 May 2026 03:32:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=OrXNi9VB; spf=pass (domain: gmail.com, ip: 209.85.216.53, mailfrom: saisneha196@gmail.com) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-369002b26f4so1698004a91.3 for ; Tue, 19 May 2026 03:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779186779; x=1779791579; 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=Tsg7ZO808gfYevecoKttFuhcIaNpK1qik9nkBXrZJiE=; b=OrXNi9VB6pl9qZd8q54TIWRXzu8isAlx3WPvNAoMwQsOykQaYjWoOxOJ6Xn/JN1tNR jn1KstRgDz+Nh802o6wTn1qtl3RDvz3DMaAn+rbMBs+khZUByp74U/XS1CWn83mqYmef w8k4+8syq5CBHpQI6gMg8Rd0V4SwtrZOVtECb9LZveqvgSsA2SgzBDAvBrwrFWSOuzWV 3lmAw7EKhmGuRih9vTJe+M2yqQP+n15DLrpXv4Qtr2fNdZsv5ZuQpyBiTlwPClcxDjbj /jjscKiyPXjMiPW5rAi+2EYYp0825PS4+XSpENT9RikS//dURC2zPnUJ/VsfR3roYuGB TutQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779186779; x=1779791579; 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=Tsg7ZO808gfYevecoKttFuhcIaNpK1qik9nkBXrZJiE=; b=FAbhqNzQs70zULMdQdFLHb4AJ+oJzdj/u2G3lYeewkQpPSsgaEEU/oGC49cf428X1b indsxA4DVHMEfqlRJq7ksAVOfuiVF+v1g8F3pxdgXBmE1sOrKCxVflIobLPgEbIGvOEv RZaCmZ9uxv76VWDgErDcyqCKDjv0vSWCrUOSG8tE8QI1o/XN9mZvXJxsOB4r+RNtYzcF 87/4MnuE58m84MkcirXFNfUH63yI9PgsBd2pVQxtZkyKYhGkQs2WJ+kMV9hlJ0eWCcVE oZJkDGPrMojIMLu7RNeIAMcfX6unbxY7yKf6d/xC+zZslIhSR03ewZyighwHpxahfuek 3wrQ== X-Gm-Message-State: AOJu0Yz3GR3SvgH4X/KcwpaJfN3i/CAtkKiTbw/xe2/2O1+08T8yg7pk n6JcL3DBQrcCn4ip3oL9oLNKkuiBI4UY9cfbpToxusj6mCesZqI0EBrqcDsEyA== X-Gm-Gg: Acq92OEFF7+UFAv6f2bT1DOZBm07OVGv5XRyDdZR9I9sp9HBe8KIAFL/av88H1uGzr0 3FauZIQsNM28tRm6RcYCG2OxZB/nFI97+ews2r2L+Jxv6Uz1BMV23XVODg0GidzHpqbCdjuQqPc joB8d/FQjJNDX+P1r+ufupi+b/ZHCkLLqRAGa2bnSSYkOZQ6gQTFJCUB+j77OYuC8qazV0affpC DtuH0DPOgM1kDcFkiTRDB4J+QoTxmI0AzIhMu+K9LJhYqfp1e+a0t0qkhy437Xtgjr9rvGCQt4I 7D8NsgBlCVi6G7EjkdgVabdNAkS2914TkXb5HbrC/VvKOlcATa7m6JRhmgSkqrlEOzGDRAigGOO z6aGiuCltVQFREh33wLUJx5baQNz/+4NsmCIANVDyaHZs7wUK8zzUwc7gaanDeYzWbGGkk6Y+xV iezbLPP5n/Ubpci33iO8kOopGe0WeearlB71WlMXR1NIwVSA== X-Received: by 2002:a17:90b:1c0f:b0:366:4782:139a with SMTP id 98e67ed59e1d1-36951a6c339mr17924070a91.17.1779186778908; Tue, 19 May 2026 03:32:58 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.62]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c82bb06268asm15383709a12.1.2026.05.19.03.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 03:32:58 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH v3 1/3] base.bbclass: warn when SRCREV is missing for SCM URIs at parse time Date: Tue, 19 May 2026 16:02:47 +0530 Message-Id: <20260519103249.236132-2-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519103249.236132-1-saisneha196@gmail.com> References: <20260519103249.236132-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, 19 May 2026 10:33:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237307 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 by 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 inspects SRC_URI and SRCREV using unexpanded getVar() calls (False flag). This avoids triggering get_autorev() or any live network fetch. 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) rather than srcrev_internal_helper() because the latter expands SRCREV, triggering get_autorev() and live network fetches -- the exact problem this patch fixes. Our fallback chain mirrors BitBake's internal resolution order exactly, as confirmed by the error messages BitBake itself produces: SRCREV_default:pn-X, SRCREV_default, SRCREV:pn-X, SRCREV The check handles: - Full SRCREV resolution fallback chain matching BitBake's behavior - Multiple SCM URIs in one recipe (all reported, not just the first) - Inline rev= parameter in URI (skipped, no SRCREV needed) - AUTOREV passthrough (legitimate devtool usage, let through) - Parse-time severity respecting WARN_QA/ERROR_QA layer config Note: parse-time warnings intentionally duplicate 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). Fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16051 Reported-by: Yoann Congal AI-Generated: Developed with assistance from Anthropic Claude Signed-off-by: Sai Sneha --- meta/classes-global/base.bbclass | 40 ++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 62f2814bb7..66b2e25f71 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -165,13 +165,49 @@ 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): + import bb.fetch2 + src_uri = (d.getVar('SRC_URI', False) or '').split() + pn = d.getVar('PN') + found_issue = False + for uri in src_uri: + try: + (scheme, _, _, _, _, params) = bb.fetch2.decodeurl(uri) + except Exception: + continue + if scheme not in ('git', 'gitsm', 'hg', 'svn'): + continue + if params.get('rev', ''): + continue + name = params.get('name', '') or 'default' + candidates = [ + 'SRCREV_%s:pn-%s' % (name, pn), + 'SRCREV_%s' % name, + 'SRCREV:pn-%s' % pn, + 'SRCREV', + ] + raw = None + for candidate in candidates: + raw = d.getVar(candidate, False) + if raw: + break + if not raw or raw == 'INVALID': + found_issue = True + if bb.utils.contains('ERROR_QA', 'missing-srcrev', True, False, d): + bb.error("%s: %s not set for %s" % (pn, candidates[-1], uri)) + elif bb.utils.contains('WARN_QA', 'missing-srcrev', True, False, d): + bb.warn("%s: %s not set for %s" % (pn, candidates[-1], uri)) + elif '${AUTOREV}' in raw: + return True + return not found_issue + + # 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 May 19 10:32:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88364 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 DC285CD5BA3 for ; Tue, 19 May 2026 10:33:09 +0000 (UTC) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18089.1779186782894776095 for ; Tue, 19 May 2026 03:33:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=j2V3w2vm; spf=pass (domain: gmail.com, ip: 209.85.215.173, mailfrom: saisneha196@gmail.com) Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-c802803ac17so1439993a12.1 for ; Tue, 19 May 2026 03:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779186782; x=1779791582; 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=mk18DnqfANnp1sG6QBK0fH+0qsxWBi+ihm7/DXN204Q=; b=j2V3w2vmAEexBXxgcRIzAl0a68eqvSGsqPJfDxRNFOPgx3gfubPR8s9SsP18kCdVHn mH0TuJNRpXwJMXhOZEWGvf4k96lkyvMRrAyVQOlgpa5LfiNGQbKJflVW/pNrE3fo9fBQ p70fs8E8cwlpBskfUKAL1gfW0vpyUoIZx2Zf2EsZpS6EEgQ7q+K1oKavd4vOi9nfSRly CYSpZ/P/UZSt621+pbqXe0kvm2nwVHnVZjxDW0owNSe9UWuRv5VHz4AiG2QEJkXAZoUJ WAJdoW3th+VEEw/3sn6jL+GrfRJUc7zCZBvygKrYJ5pAZnsGOFw8s/coFmF5TjDPNy7W 9S6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779186782; x=1779791582; 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=mk18DnqfANnp1sG6QBK0fH+0qsxWBi+ihm7/DXN204Q=; b=om6lSMEjDIdprE1VFHZdlm8pp1/1IF2wfw6zFFCUFJDKtNbdR7W58qVckbBxFzsvvw DsPWzW8tFGjEb2fNAhNH2BPyike/Tfm3Pj1Hp11l3EO6pvyouo1lgELvNNnS5jdYrkaa pzUKse/0kowUwxlzcBNXgW56JjOXYDalrfjmI3Ns8gVExEmOscOQJp4G6UFr+1aGCdvU iYSm/XSLwOpMnBjeU7k7s+c6Ne9V9VUgG6Gp3JU93cv303wxJPPwiZfcWW5pouVcMPMA NPCT8eUYkPdHVnKCWr+UHjbbgc6uoYiYhPm+YlE6gCJJB1EcomFCgY1bkMmB3k0XtaSb NBQQ== X-Gm-Message-State: AOJu0YzBA4nCIDhSYjbS58AroAfTBEehuoARyCe/UFy635aOfE4LWESy wMDCLE+cIngZA49SF8jy31qTEtNLgFgJvMZ1TnYlsKoSiwD9peXUAxIPYsXkrQ== X-Gm-Gg: Acq92OFLUt7ZNuAIf4uu12gCVfq2roOrKDWY6ezdfga0RTld0RQPfDkJ84oGE0UnaUg GOCYaW7Z1mUkNu7kEtoPFxjL35soGBWdFMMsF5BNacwrrsGGxnTDNYKtAOLRKTEmHG+Q+BAFMwD JabNHn9pZ4tK2wUi+98phfU9+ayXjseuabahj6luZgQ64iwcG7D7qO/B1x+ivrf69hMacnlCWNq v+nE4SvWFSPrR0DiAJ36mCWGCEk7G9U0VKAt2+5t1HbWrBrRKcVUlxAon76+xCLmpl9x8qKHpXm kfSl95iFeZ1jqBo8l1EcZPFs1UA10ocSDTQyxzhY+Ploh0Y4MljhqmFZ1HOg9ia7YfZclekM0Xf EIT4XJhYtXPU12z2/VQZEIYT3peYSWow0gc3jUk7LDG+Pl4OHnFKGUeXWs6Z4cwGlu1QyZ3TGnZ iiONMkw+AuPJGkHBQUfJrkCt41wQKFWG7gS1/mMA2wuoV90C/AKHMmzlGt X-Received: by 2002:a05:6a21:6d94:b0:3a2:dafd:3c02 with SMTP id adf61e73a8af0-3b22ea861a4mr21543990637.19.1779186781959; Tue, 19 May 2026 03:33:01 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.62]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c82bb06268asm15383709a12.1.2026.05.19.03.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 03:33:01 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH v3 2/3] insane.bbclass: add missing-srcrev QA check for SCM URIs Date: Tue, 19 May 2026 16:02:48 +0530 Message-Id: <20260519103249.236132-3-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519103249.236132-1-saisneha196@gmail.com> References: <20260519103249.236132-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, 19 May 2026 10:33:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237308 Add a proper QA check test_missing_srcrev() in do_recipe_qa that fires at build time via oe.qa.handle_error(), complementing the parse-time check in base.bbclass. The check uses unexpanded getVar() calls (False flag) to safely inspect SRCREV without triggering AUTOREV expansion, and mirrors BitBake's full SRCREV resolution fallback chain. 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. Fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16051 Reported-by: Yoann Congal AI-Generated: Developed with assistance from Anthropic Claude Signed-off-by: Sai Sneha --- meta/classes-global/insane.bbclass | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 04700be71c..296cfba0fe 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,34 @@ python do_qa_unpack() { python do_recipe_qa() { import re + def test_missing_srcrev(pn, d): + import bb.fetch2 + src_uri = (d.getVar('SRC_URI', False) or '').split() + for uri in src_uri: + try: + (scheme, _, _, _, _, params) = bb.fetch2.decodeurl(uri) + except Exception: + continue + if scheme not in ('git', 'gitsm', 'hg', 'svn'): + continue + if params.get('rev', ''): + continue + name = params.get('name', '') or 'default' + candidates = [ + 'SRCREV_%s:pn-%s' % (name, pn), + 'SRCREV_%s' % name, + 'SRCREV:pn-%s' % pn, + 'SRCREV', + ] + raw = None + for candidate in candidates: + raw = d.getVar(candidate, False) + if raw: + break + if not raw or raw == 'INVALID': + oe.qa.handle_error("missing-srcrev", + "%s: %s not set for SCM URI %s" % (pn, candidates[-1], 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 +1528,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 May 19 10:32:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88365 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 EB153CD5BA4 for ; Tue, 19 May 2026 10:33:09 +0000 (UTC) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18091.1779186786172409830 for ; Tue, 19 May 2026 03:33:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=XbGgZJ7p; spf=pass (domain: gmail.com, ip: 209.85.215.178, mailfrom: saisneha196@gmail.com) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-c6dd5b01e14so1518360a12.0 for ; Tue, 19 May 2026 03:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779186785; x=1779791585; 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=GvwlaTr4p6ozsGQZ8zsf6sqGRNy7JILdG8F28Pa8pGk=; b=XbGgZJ7pXQbfq4vuf/2BZm7MrKA39rEHAvqCYjyezkEPIsDlgmbc9hdwvCBVUgy8Kp EB1ZStIO1gTuLMVsE2Ho0hB+GlvP0ORjIX3sxV9rDUivDsPVoH6isnXfICK7XsSvTnfW eNG5RdbWUrdfn3fAQcyQNjjLyMe7qNT0BQejyz6S9I6k6uK2VJyqIzA9zFm2yLr65HrY /EddnVyRjfM0k6HWSsq6uiGwCvU61PwDTxTC+tz8G50gJ3OY36h+pUOoSxDM+NJv/iq3 4RgL4LeaMOr8weopdVk5GQz7hiQPe7UsN2C++DF2zsPLE1D88qvMjfL6r4g0/eqDHGCr 5rOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779186785; x=1779791585; 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=GvwlaTr4p6ozsGQZ8zsf6sqGRNy7JILdG8F28Pa8pGk=; b=Or+hN20ReJ6ImPuU/ywg4wkpRPPWQNvLou7KYvpSwnKNNnjOpfmfq0ND2gVPcR7J2M sV45fxS2qhbCF9WuKhszSvemf6cduWhmqY3W4qzsqD+kdP0tw/4KsMiTilx82Xq+Sl4P twdpIj+FNMS3nIFDQN6QQIx+UrWAloPjH+aKLiLhlLSJCaMQKWbroIp+gd4GjoVR4Y2x h58xYMOmk26H3ujiJ0cZz/aoYqQip9iSwJ/wZk0YjPUGHqWJR3iyiwH6kGspit7T1gNt ezBUvojipOgWhCdGyVdILurvJPItcGiPuzTMfUFMvZRDiRZRcJpoYlcqQveCrM8S74/X Bd/g== X-Gm-Message-State: AOJu0Yxkh4GnHePGtyqWEm3A+Dy2UZApkKJ41Fqz1YhL3gzEwzjTNaXd yYxpEXmzhwdvUBzImfJyn0ygDbepEqdZPV/ZMLSNDRghaKkwuHv+uBUv6th29Q== X-Gm-Gg: Acq92OGRaCpfspc7usj+uSCZDhsw8aGD7/IqZ2Zw8tSq8B90IW6JbUOqAX1Y/BLHqsK f9NCm+XSgHnBUUzJVVqV3F1LxeceRlURt7RAm46H3EEqcb+oc4PkrY+8uAAfvA4UXO8jJ/+M7PZ HV9LE6VYE7MeFSiUJXRxNhwAgBDzcg3IMC+OVLwEMHWUWPIfM229YapPP47+zj8udlT5uais1eh 4Smt85arpJ0hy007KaIi/QlHbbyQ2cMXpRUiNN5Mwmvb/kwNJqaAFWVLlXANFVTQE+gm6Wyjoni tN71CJHVHGJCqWD63TtFWs4xKF5GyGQgnHH41NQsIP7G9n+eeaGn+3QUdIB/RSfGKg8aXmCJEFJ Fpv6+BfJvrHicpApHpayRY0VnKPxr74aIpMoFLgKylXH7yd6SImBPLHB5pqzQdzjVpwJNgvvi2X Jd/KgyySI3f1SxZNhUCjThVq+TN3o3hMEK6mbPHghjr7JfVdvveqI2Xdb9 X-Received: by 2002:a05:6a21:6d89:b0:3a2:cc5f:2187 with SMTP id adf61e73a8af0-3b22ebc87a3mr21841838637.28.1779186785451; Tue, 19 May 2026 03:33:05 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.62]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c82bb06268asm15383709a12.1.2026.05.19.03.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 03:33:04 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH v3 3/3] yocto-check-layer.bbclass: enforce missing SRCREV check during layer validation Date: Tue, 19 May 2026 16:02:49 +0530 Message-Id: <20260519103249.236132-4-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519103249.236132-1-saisneha196@gmail.com> References: <20260519103249.236132-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, 19 May 2026 10:33:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237309 Add check_missing_srcrev() to yocto-check-layer.bbclass to enforce the missing-srcrev check as an error during yocto-check-layer runs. 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. This satisfies the requirement from Bug 16051 Comment 2: 'add a QA check outside of checklayer then add it to checklayer' Fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16051 Reported-by: Yoann Congal AI-Generated: Developed with assistance from Anthropic Claude Signed-off-by: Sai Sneha --- meta/classes-global/yocto-check-layer.bbclass | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/meta/classes-global/yocto-check-layer.bbclass b/meta/classes-global/yocto-check-layer.bbclass index ba93085325..1ef5424083 100644 --- a/meta/classes-global/yocto-check-layer.bbclass +++ b/meta/classes-global/yocto-check-layer.bbclass @@ -56,7 +56,39 @@ 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): + import bb.fetch2 + src_uri = (d.getVar('SRC_URI', False) or '').split() + pn = d.getVar('PN') + for uri in src_uri: + try: + (scheme, _, _, _, _, params) = bb.fetch2.decodeurl(uri) + except Exception: + continue + if scheme not in ('git', 'gitsm', 'hg', 'svn'): + continue + if params.get('rev', ''): + continue + name = params.get('name', '') or 'default' + candidates = [ + 'SRCREV_%s:pn-%s' % (name, pn), + 'SRCREV_%s' % name, + 'SRCREV:pn-%s' % pn, + 'SRCREV', + ] + raw = None + for candidate in candidates: + raw = d.getVar(candidate, False) + if raw: + break + if not raw or raw == 'INVALID': + bb.error("QA Issue: %s: %s not set for SCM URI %s [missing-srcrev]" % ( + d.getVar('PN'), candidates[-1], uri)) + d.setVar("QA_ERRORS_FOUND", "True") + + python () { check_insane_skip(d) check_network_flag(d) + check_missing_srcrev(d) }