From patchwork Tue May 19 10:09:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88361 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 955D7CD4851 for ; Tue, 19 May 2026 10:09:29 +0000 (UTC) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.17800.1779185360159385623 for ; Tue, 19 May 2026 03:09:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=b9h1wr6k; spf=pass (domain: gmail.com, ip: 209.85.214.181, mailfrom: saisneha196@gmail.com) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2bc7b311e77so13507965ad.0 for ; Tue, 19 May 2026 03:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779185359; x=1779790159; 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=b9h1wr6kycgUH6GBzr1WzeF2ZZRVo7vvwYHFq0rhgmvfL2A9dQAwjZK2WBd32BdXZL GIPsn77Ab4VtJDwqUH6zYnYLO6tMmk+6Vz0SNwN+Hnl7bCwzVjH36v9U2MzItjeJ+96K FBwZ+SgS4kKP/1IiKGgzKw39q05wr+sexxZRbDN2wUgYxdLfV1do1WvfQw4UQefvm9q7 T9cAUGas62nPGgSRPiX1+/nukrE96TW9sybU+UTRxLXQt79iRI6j2p7AQ8F0ooBCB/m/ 32Krf0n+4/FYLkjU+a7PFDxpMgS7vOzWsSxrj6Iv39o9rTAs88yDIi5hbUyeSa7yR7Xy aeHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779185359; x=1779790159; 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=V3BO6wXw+ed9Om1TpdMNrm8nYr6bNKuRZ0D0ItWaUbFxc753mXTjqZyNh0qf3TMDWb atxYav2ghUrP6wR6uhG5QN/4z/d5K8EILMZAOvMCobpL2yTiZmxmUPbCg0LhrTWqlHhJ GMrTR2qJGGFH/vzIraS4is9HmqpbxTNYpeEdZkaELvkwohxh+Ubw2ISjk4/9nmXlSKEz yYx7AyMQjEV5ZlXUVesPh5iNjnIngUPAcBOx87H/yRa1ukIu2p7HUS0S0cD6y7uGtW4h pSuVo0fewqGHKcFqqdDwDOnifMHS7/g8m7Dsya+x4CGUKCbyZtN1ctVcXeVpi87/f7rj NF2g== X-Gm-Message-State: AOJu0Yz+sKB4qWwXHBrFnE9JRj1lw/J1Ft0uSGV5gjEs3B8uqNlB2OL8 9aoyGK/zJaXczdMW/WK400yf9viyYZoteBApE8yLbt4ZX7gxq/X8/X3fV2AlN1FZ X-Gm-Gg: Acq92OHzWuYJ+kzmcW1DfHRyPd6JbXze6a3TUUs5Ylu+0QHMpEaqYbpPc0TODDTw2Tp ktMOT7D3Cs7k9CL7o4IN5+vf7uTLw1V4jwXzbnVWCH69KOpfnnI+JSKZ0aqduA29ECJLQsB/zhw mUiyrBMoUwMsZYz1vzYVjXBxF3gyzdW2P+1s+JDEhKCJNupoOp/lZb4MJbCeNAS+KU/SVdNyGc8 7gfBhdNURQl4zEECm3+0SxrQdsnaTrKUCMncDvDvnATZ+ywpomuzeBeE6YsIoF00k2BTTzrSXlV fQ7eIJPCXzEdCnogSF+80Sp90lpYSJRzAxGnznWpWF7atPzppCLaNFbsXsoV5oJcutcWFnQz1qf 2slk8CVeD2mBV8kuikm4KT0K6qOnsey1qid4MaaLh/tqkwez7U3OQzSU9dlg4SndJ3q4czdpJfH ZzYMGtd35QJmNoC4ZprIj41pnjs+p0KaCuoaXgTCmuWjOOVw== X-Received: by 2002:a17:903:1a83:b0:2bd:5ae4:26d1 with SMTP id d9443c01a7336-2bd5ae4294cmr191888375ad.17.1779185359003; Tue, 19 May 2026 03:09:19 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.62]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5d0fc2bdsm231081355ad.63.2026.05.19.03.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 03:09:18 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH v2 1/3] base.bbclass: warn when SRCREV is missing for SCM URIs at parse time Date: Tue, 19 May 2026 15:39:02 +0530 Message-Id: <20260519100904.235971-2-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519100904.235971-1-saisneha196@gmail.com> References: <20260519100904.235971-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:09:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237301 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 10:09:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88362 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 C253ACD4F57 for ; Tue, 19 May 2026 10:09:29 +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.17802.1779185363369839777 for ; Tue, 19 May 2026 03:09:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=FNTSoxOK; 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-2ba6485d219so23212645ad.3 for ; Tue, 19 May 2026 03:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779185363; x=1779790163; 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=FNTSoxOK/nr9RxJaywbe+caiYT6vjKCzu+UGj/GEduyypLq5hNRhP86kKLx94BX+6B Hf/YY1dbkJMIWDEXWzjX+6bgdAnzHSdWM4vxvdosy663VtY5c9tQFoFmnvaIh3b3dQyW H32vYYYJtxOQs4WVX7DpLhn3Rtbj1F7KC4J7tAT2dG8ByLeUSzmX9FmNMBDMXwiarwFI xhKgfnZ2VSfhxIAbLhqZu+davwoo0NGWwJ4GVIPnGa60+lK7exIu2tiQflpEltgcJhlc Ty6SD2vcBQIiNGz23y6gWArHzetcTrw32RNUHEIxVnkr91GroGEcKD0BGXR9VibmBGff 2cgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779185363; x=1779790163; 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=adDPpfO8dnsbHd4g2KckQOWtmLOB+IYfARc0gWjyUa/r6RzvKRrBX++3SVj4SfNDjc aE6oJHeK42w30VIPWKDo3CCs2/VUcW2cuF5z75KB4v5fD6DNe1oLKI2tvkhGiIPcoib1 O4F4qlofdjuYPMyd+UUPp9vbuzNEp5JjTzOb5ErTeFT6jaAz3vqyRWx55iK9+RBy/C3L 0OKJ9xH3kRjdFvjaSYhODW/wSuh0ho9n72pcxpUrEXqFcPuHnJwbdaMD6FWATtP0dpYB xkCyHZifJcQp5cA/rhYrpeyHEiwUVCc3IlGd+9zKXlvk2/UgbRmWT1GOuy36Fu87Ry/k KLvA== X-Gm-Message-State: AOJu0YyQv6Y5l7el88eT57/kMX6IKQSbj9xGW2psX3XMbUQus0j6YCE0 XYkYEB9UcLgz7OWrMEHvuxr/kqPHsCVs5HIB3BUOMUTxuc53KvmXrqXPA5w+hFHV X-Gm-Gg: Acq92OE2TGnLZl7XTVqvTDhPfxMkWMLXjMe0NOKzQ3sG0EJjFBTU/FC48inSmyF5M5D hsJIjcESoWFwfRw+ceH0qakueX1onAM5oOgf+VMi/JIa32doS9kooTW+kYMya0U+U68BxRop2Yc WQutwRcLCjMuSlh+/Oe3yssjmMvrvceVDn6D/3q/jYkz5rVZztSzav9R8BQg1ZXLJGSI7xoKO63 H1iLumEeAoBZ97f5ZY+HVZuicTx1HkQNXrAwTJ8j7P2V0ga55UGuM6by+ig6XrD/ChiHDBJahvG QT02rf5D7c5kiQL/4yd9gKQCnwt8toYqbwVnyaUURwkEE04AxKgXpKVtpwA0TUpNXueSXVW1afv EnxFj5E67VmoOpt09sRvST6rp9lXYL6tkpCRkYf0S5mY5/MvsWza38fE1SPIQhCSZJEVOWowLvv 0ON7fSix//NWHlOu1wvfO3FmDZVmh/ZgZLuK/CVIVNkzbIcw== X-Received: by 2002:a17:903:388d:b0:2ba:3e50:e3f5 with SMTP id d9443c01a7336-2bd7e9769e2mr193696195ad.30.1779185362724; Tue, 19 May 2026 03:09:22 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.62]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5d0fc2bdsm231081355ad.63.2026.05.19.03.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 03:09:21 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH v2 2/3] insane.bbclass: add missing-srcrev QA check for SCM URIs Date: Tue, 19 May 2026 15:39:03 +0530 Message-Id: <20260519100904.235971-3-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519100904.235971-1-saisneha196@gmail.com> References: <20260519100904.235971-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:09:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237302 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 10:09:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Sneha X-Patchwork-Id: 88360 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 A3E67CD5BA3 for ; Tue, 19 May 2026 10:09:29 +0000 (UTC) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18097.1779185367127337403 for ; Tue, 19 May 2026 03:09:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=ltAfsdeD; spf=pass (domain: gmail.com, ip: 209.85.214.178, mailfrom: saisneha196@gmail.com) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2baef9f5ecdso26896185ad.1 for ; Tue, 19 May 2026 03:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779185366; x=1779790166; 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=ltAfsdeDX/40gp+pgAKiMEDRhB7Vp4fhawD2x0ot254hWs75E/IIbZ+/bJYSkquHLh 9E9oAvCS1nw0yMG+UmeEuHdyUscl5o6J+KjKxUhzDGOl1fNnQeg1ED8xhzAGV8Z7aDF3 hKMDD/OD7ItUM0GSGxqAPjs1CuERl23IP729XjKRDliEOrr0TcWOygsXZAx/qrT3PvyJ jZVeHZkpPoQUyLzQHJpIwU8pAkmgGL1M958W+UikMMJhX1wxsMZ8PIdLp/Yrve9yGr+D jhm0LPhwGLxfLFhHWpj83EIhaJH/Z/Zu2+6EBA434CKIrw2bIDpHJ+0VjzxqiZj1GE6e tBBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779185366; x=1779790166; 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=iolk98Yl9XFFgL2rEJrMzT6ppfCK775LcienHshnoxDjWlOr/UmiAGCIr2VV8HI9g1 qDrtSYpyZjqHOAd+r+r7hhtS+FfIdPrF8/cLjyEulD6PSh/2oc4nKt3CQX/f+6W6G0fK QH/9QEIylr87BTpqwb3V+BqmjD+PVl+3wNtRMVvrVXASYTh5njNmVT/ixKrxoJANQ2MT VRZsHXH6AcUi2cB1EzaayQxhxRsTypEyZMXgFwcPCBi62f8NvPqRAOEVxFEsPgVc2mAo xJ05v94wRve6k2mARJz4cXB/NKC1DwrgaIjvRt2VmM4kWzEIfg4+l5KdJzSAqWHOWWBo vcgA== X-Gm-Message-State: AOJu0YyOq3Nir2znS9yIONl3NMzQmUj+w8mvQ+KwClQ93g/tLliYZyGZ zSZZ/oNFPn2EHxnE89hRAbwI5YDkKwflAfy49JxwusL/BMDoR29unxv2Nk2YWBiQ X-Gm-Gg: Acq92OEAD8dbol4ZfYWp+R9SmXBi1c4cqU0hLGuLmB8Yic2Xn3QFP4TEf+FyhXcsxE4 ggkVzBtG20Yiywo3CJEcLq7T5AvmX2UHUGWcoE9RLMDDqmJms0ZKvzp6HlwdEE/H83sDvD+ITr2 ffl9OXI8yk3oFmyXnBMOYvP8k05EEaG5hXsgAER5YyFJgT0DNJTYhSlugTvZH0P/eE3MC38z3T5 wmdpyZ2doI72rl+YTT/iw/4lA+zs9QFghqsUkfApjDpvoLlUrD9LzKbZx9Y3W1StibJTias41RO fmGLYVpjsjGlfSJfsgQ5N+ry/7RYK7lMtMmtIjZOBdWVhFCFm8uiL4Rl0Z2Tl26QNgee425zIbx KhkQrwAvxuk1ebxS+8dQUxiIZRs9gvvVxlrxvIcm8NGpSTTc1qPxBs8VbsDgcUJep2mwtHPhchf fVTE0+3flubs9fSw4hpVFIF6EPlT9AP6V4ZWfyIRUFsc5NNA== X-Received: by 2002:a17:902:7892:b0:2ba:6518:a6d4 with SMTP id d9443c01a7336-2bd7e87d577mr149151115ad.20.1779185366111; Tue, 19 May 2026 03:09:26 -0700 (PDT) Received: from BLR1RLPT00004.localdomain ([152.57.112.62]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5d0fc2bdsm231081355ad.63.2026.05.19.03.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 03:09:25 -0700 (PDT) From: Sai Sneha To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr, corentin.guillevic@smile.fr, Sai Sneha Subject: [PATCH v2 3/3] yocto-check-layer.bbclass: enforce missing SRCREV check during layer validation Date: Tue, 19 May 2026 15:39:04 +0530 Message-Id: <20260519100904.235971-4-saisneha196@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260519100904.235971-1-saisneha196@gmail.com> References: <20260519100904.235971-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:09:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237303 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) }