From patchwork Tue May 19 09:09:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88368 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 22955CD4851 for ; Tue, 19 May 2026 11:23:00 +0000 (UTC) Received: from mail-dy1-f175.google.com (mail-dy1-f175.google.com [74.125.82.175]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.17507.1779182230702318571 for ; Tue, 19 May 2026 02:17:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=P9UK2jJt; spf=pass (domain: gmail.com, ip: 74.125.82.175, mailfrom: saisneha196@gmail.com) Received: by mail-dy1-f175.google.com with SMTP id 5a478bee46e88-30246cfd41aso320209eec.1 for ; Tue, 19 May 2026 02:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779182230; x=1779787030; 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=EwF/RxOps7mGQwximLao371G7FVWTdIb4cbkMzV1oJY=; b=P9UK2jJtRqdS9ntd5+UPQ/hIwBwW/i4oBJOI6B8XhaqjM2XJPHPXU+OGDAygt/KK1A yiPfPSP6A0ccmYS9+R9mbNNkOZQMET8Dv/VdbrcP9q4jYwVYz1zbjzuj5xHgBMHge+LR Ll55bJXhpO49TeT/H/tuAibZyiCZ8htd6ISIKA+fVvNCEqYZdkeiVS+Dm9DVpNwr0S64 HCsSBpK7ogrPZ6E0mEJLOIZZylfWdWlrJ5ANYryBn5dAoGwizOEj1vEUxV9j0Q/k24EM /p5NWFTq/OP86n4SAs6uevF0nJYkL7+3sBhjsgi/b8csF+tCbyvDHTNSIbwJSpzNJVeT 9nQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779182230; x=1779787030; 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=EwF/RxOps7mGQwximLao371G7FVWTdIb4cbkMzV1oJY=; b=h04v6gqLJNhT9ZZtIEEvRK8ASCeHRnBMQXFBY/objzBRHYs5IREyzZDho+SSt3DFw0 6/pHTUVNqpLBUV2BmqQUnpkSWQnYbFYwqObnVEeBNYiqkYDyIMjsQFLHEM/MQwp0g3rZ rDSQhY3IORc15u0uhaLxpcW35R+/8XgE8FC0dXaQJw9B/dZU29HvfLLgD23tMGAyLjDn RQb5CZL9yZUqF9obAPMGgTcrH1fQ4U/bSCJB7OAI3/xQIgv7D4i9kUrniITJE69gV2X+ HB9bVrWkddEiXK+RrB1RxXmsARwYo74E48W3387D1891RoFsFBU55DaI+8TU/XBCYlDx YVAQ== X-Gm-Message-State: AOJu0YyidGDuu4QMLWcGisNUY4xaNYRGNjnkjYGb8brxxZT4a1r/NPw8 NZG13hDLfbVR5Pt5bQFjW47pg9zAUMEZ5HcISWfEUKluE+nqxc56Fw+pZ9HOi7Vl X-Gm-Gg: Acq92OG9nqQ66LtbBKvJUxcxKc7QReRYTVJwM/L8ZgfrmSk+IwQx9/3SoFXaqwqi3w0 2RimHgAW8oooSZ9eSygAzC/jDP+UocFYRbrVayoTv8i7BkUS0WAx4XaHK/+3Hm+VSkpNPLwN4In CKK3enUrG+JcWOmsbzzM/wMb+MKuBUYXdT/wTiHMCRdHGM0S+vAOv6toBwpgEu78Zp0J1wlLm2A aiZkQnuzQcnAaO8TDR1ynERF0eqp8TsM0fh6UkNNeCDNopJcFZrSbv6VAzQz29QULTo85cDHWCX caGEi2P0fnAXmHpKvnBmao4F1LrH1AgovSNh9iNBGKGGChnTbATccyZwJPYirIIsdgOE4TjP+jW VJZEKWPOSDz+lWaMnNHtsWO4PiRugvvSNQL6yI6oBVvfbWjC89EMqHZsvvzHRyDzpO8W4AorOTv Xx9AVGkCok5Z6zL0SvLPzchIVYHLtow89nFQlLsHqMPAEkjyI= X-Received: by 2002:a17:902:f38f:b0:2ba:924b:3948 with SMTP id d9443c01a7336-2bd7e8352f7mr143396735ad.15.1779181769191; Tue, 19 May 2026 02:09:29 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.247]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5cfe4935sm187342225ad.42.2026.05.19.02.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 02:09:28 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH 1/3] base.bbclass: warn when SRCREV is missing for SCM URIs at parse time Date: Tue, 19 May 2026 14:39:16 +0530 Message-Id: <20260519090918.235880-2-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519090918.235880-1-saisneha196@gmail.com> References: <20260519090918.235880-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 11:23:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237315 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 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 09:09:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88367 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 2361CCD4851 for ; Tue, 19 May 2026 11:22:40 +0000 (UTC) Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.17505.1779182218158205173 for ; Tue, 19 May 2026 02:16:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=AznFtxxn; spf=pass (domain: gmail.com, ip: 74.125.82.174, mailfrom: saisneha196@gmail.com) Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-2ef2a1cc06dso3313148eec.0 for ; Tue, 19 May 2026 02:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779182217; x=1779787017; 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=czoKg3Q7zWCJLdmR/QP8+RLXIZoo+mHJycOBG86st/c=; b=AznFtxxnq9vaHoXtcD+NUgS781G2fak4RzcE9mqIITdBxBMrZHhJvqu/sXgjcTbVEi 7nUy17KjsVVYx2+ZoXyKvG9N6s8PTe8C6srehb2EqVp0pnIW7utRkMzR0BJS76brfTBd EOdkiZE5txUQjhu98X6YVy+bXeDgD3eMXwL5KILM8wXjG8Y5cQmwKsNXZ3G0CfezY4u4 Z8ov2UHoVr3+UpPvQo7rcDotBbZI9jq0qoafyDcpIsvhiHWU0Zw3cYlAQJMURUO3wQFA HQGWZyJcNYwH5Plm8rxDgnXjko0cS2yH8iZKp7JtpxhpIYCsHq1AiRwetEOb0ivhitF4 Cd6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779182217; x=1779787017; 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=czoKg3Q7zWCJLdmR/QP8+RLXIZoo+mHJycOBG86st/c=; b=nt0QBV+ymofHXp9if2KVIbzfxdyGJibucdXCiAuyeE/uSjGFz/fYqDgCi6xrRCl39y cUncU1HdQyeMqxmhIOW1QqgYkRfm0opIVKi0ImFOWn94A9f3Fnm/n9guXmWD3rTnN5eP GAdappvYaIG1RuIrmpO+VzUiiF1FYv4Q3jdRWzexKrxqkyhkHM8125al5aBzHH5PLXFw Ny9UAblLEWFNaGGaJkWGzWy8Nwy7jqIpIO2uIARfyqxd7q9vBuETm5yb8AIv179sQ52k Rdpv0Nhc/ixj9dUA8IiL5panZHfcttOCp8v8tYSIsGmxXadUX6hAH4pq3x9fhNPiqtEt 5KjA== X-Gm-Message-State: AOJu0YzFCosf/0FaUISmifivnVcAKZKaNeErUAf4C+4cv7b+qnOklWaZ yXGee5/oEU7OuAPPuNr0q8yAVfjqh/fkLYA4nuVqUGVwL4cQ4MmHhzlEnDnpt9zh X-Gm-Gg: Acq92OH/bUmzsXaWx4bY7nNylmESBk/C/4wnpK/ObD1FoUllSIZGcXGQvtvAkaWNmAK vTUAn5b7S9Miat1OBuuWlRsqg+D+MRfI4K4MzJEsEhSObM8HBiCSCMCi1KDH+S5HU8yBlRf+J4g EqEb80GF2gN8c14YNh0T6WIVttAW27GMpfY34+R1wYmLtAm/zCHYFsQcmOZzkQOsKZGDC6mZpbp mWhuX37ie5xlyDSxhRXQMCeKikcQJmAGvx0p6FZJ40Pv3OKH4FPJDqC+ZULqiZLOytPFS6uVmDR tf7rha4zQrpB7l3ttPycPFMH+UOZDa9pm8cc4HxPV6eZ+wYBIq/PTPPKhD/nPUD7fc0iuxrMGDQ Do+RndVR4wVIqy5iy1sGEuGo20t1dok7g1rt5V/4X0AcsqArCyQl+uML64DYoa/w8AOWRl4HYjx 0DYV1SjBpoyylecfm73gx/cc9lbs0AXDg1iV9nTn1jdiqv5TXhI8cnpWyOsg== X-Received: by 2002:a17:902:f788:b0:2bc:f1ef:2e64 with SMTP id d9443c01a7336-2bd7e7d683amr214115725ad.12.1779181772596; Tue, 19 May 2026 02:09:32 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.247]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5cfe4935sm187342225ad.42.2026.05.19.02.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 02:09:31 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH 2/3] insane.bbclass: add missing-srcrev QA check for SCM URIs Date: Tue, 19 May 2026 14:39:17 +0530 Message-Id: <20260519090918.235880-3-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519090918.235880-1-saisneha196@gmail.com> References: <20260519090918.235880-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 11:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237314 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 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 09:09:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88369 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 42BE0CD5BA4 for ; Tue, 19 May 2026 11:23:00 +0000 (UTC) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.17513.1779182252435060548 for ; Tue, 19 May 2026 02:17:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=PK1M0Idk; spf=pass (domain: gmail.com, ip: 209.85.222.169, mailfrom: saisneha196@gmail.com) Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-90fbf21d9d3so610712785a.1 for ; Tue, 19 May 2026 02:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779182251; x=1779787051; 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=qPkJWDQFJp/4U8GVa5Un2SoUehIl1YUMQsIBS+tLq14=; b=PK1M0IdkwvX9t4NDpIXnrJZf4DJoytUtx75rla+qhgiyewHPZXQ1DBUQ0ablweR7vv wHJFVVT0masl7rt942N/9Q17wfhXvXirNrH34lsQ/vgDyBMv2cZvolurGiQ3KiQFH7pp +EGasA7PHIrnICv1mf0EtEHfUfdctBx0cziZEg93tyhBPuThFvTAqcRXNnmoKkKBJ/ib iIBUSyx+4Nym+TJ0qkIVpO1hV9LToQTLrKbpn4aYZVC+gvEKjikhdR2CQS2lHGOJxiCQ UMGaqqnWqhxdsH/Eismkl2CzPw3QrZNMEu85ucyY4UBs9r7fWSposiSH4LN0+QJk3Pjy xubQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779182251; x=1779787051; 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=qPkJWDQFJp/4U8GVa5Un2SoUehIl1YUMQsIBS+tLq14=; b=nrwwxVfvinQVRsd//5NSSNJJHrhbKo/ex0JaytzI2nAmOHJ0K2zMEZqbNnfyvTi5QH 9/tQ+Ba06Tw1fBDhVos+s2nV9FdL+zRDVAVyp1CpEsWZQMxp4G5E2NOeq+5w45LhqRh6 9XTAx67UC+1lZ8mBaS3njbDZn+7XGgJt0opttWiBs/deY6SnBY4fIVqMyFVDc1D5JGbq v6svgc6MYLDjvt9b+lJreCeuN+zJ7NJ8lxJxWCJhPJKM1m0GLJ9VVAPvpg9MuBBjGI7x ikEqHhhCgf/Z7jQSSghm1cxWjxc5mBH0eBFlfK7+aZ4Ow46GRprpfcQkPMpzVnGopDIy ACnw== X-Gm-Message-State: AOJu0YzziwbAQMURxH0x1Z0fX6VWTa1DB9gb2AAFkI6jqyYsLJXg4N2H y80SG375CSGv15nEW+97CakQhXaSHXJ1nWeRCbYyYTApFf2AgitROATcVq3kjppN X-Gm-Gg: Acq92OFO2IIftc1+3M6DjGhLEnWBjUO0DV1hCHmUoCeYbnhkju+hHkjOMtw3xR/8UbS Sw5ojdt/qy7v4qNMP+HXHgBWmHqM096jN596nQ6PISpjkVjLf2wzT2E2vRpxGeTl2Y3fmZcePBw OGQ023XCYr7mNhw5M1exUuLQtbHCUONRXDspokbFgpYsXqiM8/yQtYYymRh4tENrTAek/qsC+Ms vpW1ZHDI8gz7SK1Q3TqIrLNWE3q8tLJz37F9KZe9xy6XafMFLf+aW0W8ErzfhxEUT/XtmBUrnrv Hqp+SRDnWkagM0/V1L5nGOEry10r9Ranaf6YfwJpgW703oIhQHNUXDi/0Agi9ZepIP1g4Nb0gqj DpmJ0EiY6YmdYNmjzCD3p+HgACyrmCfSJu8KsJsdMNLRhgjVUVsrQ0WlcMVNap0t5iq3qtq4fNi 2lNSkStUP/91DlX2GrsOMJKRGM3qfxTtGyhvVPORVMrX2degs= X-Received: by 2002:a17:903:2ecf:b0:2ba:b643:1f81 with SMTP id d9443c01a7336-2bd7e84407dmr197948325ad.15.1779181776106; Tue, 19 May 2026 02:09:36 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.247]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5cfe4935sm187342225ad.42.2026.05.19.02.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 02:09:35 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH 3/3] yocto-check-layer.bbclass: enforce missing SRCREV check during layer validation Date: Tue, 19 May 2026 14:39:18 +0530 Message-Id: <20260519090918.235880-4-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519090918.235880-1-saisneha196@gmail.com> References: <20260519090918.235880-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 11:23:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237316 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 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) }