From patchwork Mon Jul 13 06:04:43 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babanpreet Singh X-Patchwork-Id: 92373 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 C3FA4C43458 for ; Mon, 13 Jul 2026 06:04:47 +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.msgproc02-g2.4847.1783922686746232514 for ; Sun, 12 Jul 2026 23:04:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=jSVWN4sk; spf=pass (domain: gmail.com, ip: 209.85.214.172, mailfrom: bbnpreetsingh@gmail.com) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2ce98cb8165so22556605ad.1 for ; Sun, 12 Jul 2026 23:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783922686; x=1784527486; darn=lists.openembedded.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=s71LkJpnDcsW0bm+RXnJ7P0wAV0YBhtBxjmNom4U1cs=; b=jSVWN4sk0IOVA3JBh+fCXBne8W6r7S7I22Q8a5wDFbfuJ2HCxpPiHEe0mLrYSnHMKd u0ySfNnSqAnb3upo9cXA3TSIu3efFfcoMa2lFe5gJh0kydXZnYpIrGjgJx1sM4mTvLeK e30UU8h2klnET9rxP3Pz1TO4Bo+btU4UJc9mYSZMihQvm+5+lJ3rtCiulr+Do+0kGRpL vixIMten7/zb4hz+NrPXGMxrZXUW8SzA8XjXFiaJ6HoGtrGhXPy9o8JjS+dW/T61zfIe mAUO9lM0CYqFnWr/uinN0O3zTNdRaRbsxPKHOhistFa71ezaqDQO5N7R3mlcmTRfTL59 kc2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783922686; x=1784527486; h=content-transfer-encoding:content-type: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 :content-type; bh=s71LkJpnDcsW0bm+RXnJ7P0wAV0YBhtBxjmNom4U1cs=; b=QbYlNoo5FY0R2v7G8YoVxF/7AKli1FY2vEIDjXPfbuzNAFHLpW0/+AzLHu80A84iZZ PmfWZ+JY7DCcFnszUVIowk22LIY11Ibf7fe8cMnLvYZgTnyBm+reid85B3Fpa9wFBkPU Z+B2CkdXNqU6mpv+CjTjiANc08s4rT2W5xe0QpXRLyaDkQhAo7kO3NFx2K61VwQyTp1+ AOu8VXEmbLHt/sMzUhS9Z9bV/sRDE1KU7Z3aS1l/SgSTtYj27eEla5hELUgL85j4tIoi AQY68OzAZMLJ6uNsc/QeQTS8PrrgTiwEqO8q7X++0/9OJXFud7sikFil+p6eDpR6Sf5l 2JqA== X-Gm-Message-State: AOJu0YxK4YFdCKFdMx9gpmzfnkN7TWuInSspxqCYRDiOAYjSfrBDNmJI tx1T3dukmejh4f4NRv+Kri5IbpyKaTvNYwqbuYKV+j+MingY6sWSLg/GqOJSkm5g X-Gm-Gg: AfdE7clrCXyVQWHj3WXTdmkfJeICGztF5YZ//rt93V7Iyt2bYkTi9MDFPSl6IKvSa1W ItUIm3AtzNrO2Umrz1ocXvPDwHVcEHk9QA88SGa2vOPOlyolxHzIRXkhEN07bq6P3zgfVE3hTbP H1kUfUcUrND1U/9Snsg6/Xe9Mfz1jnowFKnfmgvK6Rot9Fh275IJv6tk0u5Z3qkoAYW6L1JMNSl s/lNzCuUyCqrVsswl1xMGS1Cea2DYDyDkMYbxOceX0W86hByjNgjsN4RHPMnLaCPquJNOCA0VLp TUPJZmblk3CoFl/D+391JSZGyiN8q7AZ7r8YfpTXxd7XXPBuxygEV3HnV/1S72ez+lZ3XwEjiv2 L2KicvLwxdNaCV4yCH4RC/CBypVER+7vgndajUUqywJwPjzb06c6Al+aw3rdMSwQV/tCzIohyMy VfYGlmnl++Fszq X-Received: by 2002:a17:903:3903:b0:2ce:a6a4:451b with SMTP id d9443c01a7336-2cea6a467a4mr60019545ad.11.1783922686049; Sun, 12 Jul 2026 23:04:46 -0700 (PDT) Received: from ydev.. ([108.180.130.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9bf74cbsm93228515ad.18.2026.07.12.23.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 23:04:45 -0700 (PDT) From: Babanpreet Singh To: openembedded-core@lists.openembedded.org Cc: Randy MacLeod , Gyorgy Sarvari , Chris Laplante , Adrian Freihofer , Peter Kjellerstedt , Babanpreet Singh Subject: [PATCH 1/2] devtool: standard: fix finish/update-recipe for recipes using AUTOREV Date: Mon, 13 Jul 2026 06:04:43 +0000 Message-ID: <20260713060444.7-2-bbnpreetsingh@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260713060444.7-1-bbnpreetsingh@gmail.com> References: <20260713060444.7-1-bbnpreetsingh@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 ; Mon, 13 Jul 2026 06:04:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240826 For a recipe with SRCREV = "${AUTOREV}" (e.g. created by devtool add --autorev), devtool finish and devtool update-recipe in srcrev mode crash: INFO: Updating SRCREV in recipe minit_git.bb ... oe.patch.CmdError: Command Error: 'git format-patch --no-signature --no-numbered AUTOINC -o /tmp/oepatchxu0ig0v0 -- .' exited with 128 Output: stderr: fatal: bad revision 'AUTOINC' _update_recipe_srcrev() uses the recipe's SRCREV as the base revision for exporting patches from the source tree, but for AUTOREV recipes getVar('SRCREV') expands to the literal placeholder "AUTOINC", which is not a valid git revision. Use the initial revision(s) recorded in the workspace bbappend instead, as patch mode already does via _get_patchset_revs(). Do not replace SRCREV with the current source tree HEAD for such recipes either: pinning the revision on finish would silently drop the floating revision the user explicitly asked for. This is not a recent regression: the same crash reproduces at least as far back as kirkstone, so it most likely dates back to the introduction of devtool add --autorev. [YOCTO #16354] Reported-by: Gyorgy Sarvari AI-Generated: Uses Claude (claude-sonnet-5) Signed-off-by: Babanpreet Singh --- scripts/lib/devtool/standard.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 2a3a62d081..386e628d88 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -1530,7 +1530,18 @@ def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wi old_srcrev = rd.getVar('SRCREV') or '' if old_srcrev == "INVALID": raise DevtoolError('Update mode srcrev is only valid for recipe fetched from an SCM repository') - old_srcrev = {'.': old_srcrev} + autorev = old_srcrev == 'AUTOINC' + if autorev: + # SRCREV is set to "${AUTOREV}" so there is no fixed revision to + # use as the base for exporting patches; use the initial revision(s) + # recorded when the source tree was set up, as patch mode does + append = workspace[recipename]['bbappend'] + old_srcrev, _, _, _ = _get_patchset_revs(srctree, append) + if not old_srcrev: + raise DevtoolError('Unable to find the initial revision of the ' + 'source tree for %s in the workspace' % recipename) + else: + old_srcrev = {'.': old_srcrev} # Get HEAD revision try: @@ -1545,7 +1556,8 @@ def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wi destpath = None remove_files = [] patchfields = {} - patchfields['SRCREV'] = srcrev + if not autorev: + patchfields['SRCREV'] = srcrev orig_src_uri = rd.getVar('SRC_URI', False) or '' srcuri = orig_src_uri.split() tempdir = tempfile.mkdtemp(prefix='devtool') From patchwork Mon Jul 13 06:04:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babanpreet Singh X-Patchwork-Id: 92374 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 A5974C43458 for ; Mon, 13 Jul 2026 06:04:57 +0000 (UTC) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.4755.1783922687652242946 for ; Sun, 12 Jul 2026 23:04:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=E+rmFIci; spf=pass (domain: gmail.com, ip: 209.85.216.54, mailfrom: bbnpreetsingh@gmail.com) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-38dc4553f62so1536247a91.0 for ; Sun, 12 Jul 2026 23:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783922687; x=1784527487; darn=lists.openembedded.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ZXb4/TLce6y+gktEHph1KHaAIVNJtgprt0x3/haZxys=; b=E+rmFIci/CC+UHLRQccSmo8mI6k0zsC78ILeADEdX3aibFDrkDxCvRgwC2Bw+zhfhM 1yldMCYa1ytSi0r4/18VKo9n+RisYuRWqc8t8vXQylf7SFK5znfXRaiHjKjEngoSPMC2 focEZcvRviDP9FShd44Vo/meS67yYfsJCvOMKMWfQNRYbUuSSKI/yhqxVfS+dqo2TyQJ 6Nj+2TJlvBnOz3DcQnUoF/UqKPaeZUhFMFqgNwQrvBxJ5sYc05UBiupXZSht//sUqqxJ rWqt+x+2zQcNCTGU0CkFaNnF//sJ5rm3B7Iz8bY/Uuv2cqCawUObbeG9bQpIPY9MdP0R o/DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783922687; x=1784527487; h=content-transfer-encoding:content-type: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 :content-type; bh=ZXb4/TLce6y+gktEHph1KHaAIVNJtgprt0x3/haZxys=; b=RN+SU81DbAwV/CRnyWOGysw9pBhoeqR17LYf8UIAu+lE5Yjx/BHNM5z6JspXlE8J3r dJunpWo9WAc9+z1DebGgZnjxNsRmWkGElgXpDAI1FVS58Jce4jgNdrd1Qf4Y7BI62++p o5kJ4+8jfAKIZhiqOESM/NHOaK/VTV2CK39CKJ1c/YO8ItVI0G6e+ZrB7z6VCD+ApOC9 d1mhEPvBiJuHxe5G8vBxSBQXtFMxWGQGxWTZS4Hcurbs/gZowKtfRmYaiaMioZL9EBOT MjreYK7db1S19Pzl7WPbyUXjHZAnr5uu8XLLUGfjOugIb8ot+zQRBgYq7LEaq19MYlnq 8sXg== X-Gm-Message-State: AOJu0YxuOCuFjpWEmH1rk6K2gHQSxZUIiUjB9hAu/1GzrfZjZMOHeBE7 aHYD+Y+0bniAYDnHf81RvxH8KbQe67oN7GxYmmGKrdEqCAqTzx3PpRNLBA4td9s+ X-Gm-Gg: AfdE7cmbIB9ZNkvP79BuYsMp/+5prdL7KLR9ANWgV5BG0OPhzfPbApMOEWzlgm1XnNn zkqy+UMRMxxxJsqbmfBBSMw8u/L89/SVKOCf2olzX8IlCZMk68QYXSALgvRDDauHBEP3vzs03vY Cqg3egqBl7zoTVDWaPjeqTrYzuImsrR2mx0EojVxeDzIaHp1vHBaX99a6o6n9W+pBSSrX2qEOx1 1ICrOTMXvX/PscJWOdcWHYUaLniJ5xE2TQHLkUVBA6fV0X3FndRG0GnyH2Z/ZZqicerqQMG1m0D Fe303g0PQz1CF0rTDVMz/+zNtNUWy9Hn5lZpFXWAEApuhqJxIrKg5SJRkt4AO6UomA+0I4VaQfz B7+5TDrrZk+UPn66bVgX20N38YUZobjoof7BqR2Jxd294BO8IPpnDndpxGCsOWfkNp2HTEvhXp4 dzs24QOFAGMcIs X-Received: by 2002:a17:90b:4f8e:b0:37f:d262:1e0a with SMTP id 98e67ed59e1d1-38dc74cfe82mr7235380a91.12.1783922686878; Sun, 12 Jul 2026 23:04:46 -0700 (PDT) Received: from ydev.. ([108.180.130.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9bf74cbsm93228515ad.18.2026.07.12.23.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 23:04:46 -0700 (PDT) From: Babanpreet Singh To: openembedded-core@lists.openembedded.org Cc: Randy MacLeod , Gyorgy Sarvari , Chris Laplante , Adrian Freihofer , Peter Kjellerstedt , Babanpreet Singh Subject: [PATCH 2/2] oeqa/selftest/devtool: add test for finishing a recipe using AUTOREV Date: Mon, 13 Jul 2026 06:04:44 +0000 Message-ID: <20260713060444.7-3-bbnpreetsingh@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260713060444.7-1-bbnpreetsingh@gmail.com> References: <20260713060444.7-1-bbnpreetsingh@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 ; Mon, 13 Jul 2026 06:04:57 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240827 Add a test checking that a recipe created with devtool add --autorev can be finished into a layer, that the finished recipe still uses SRCREV = "${AUTOREV}", and that no spurious patch files are generated. Before the previous commit, devtool finish failed on such recipes with: fatal: bad revision 'AUTOINC' Test requested by Randy MacLeod in the bug report. [YOCTO #16354] AI-Generated: Uses Claude (claude-sonnet-5) Signed-off-by: Babanpreet Singh --- meta/lib/oeqa/selftest/cases/devtool.py | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index b2cd13e9a5..a3c7c293c5 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -469,6 +469,38 @@ class DevtoolAddTests(DevtoolBase): checkvars['DEPENDS'] = set(['dbus']) self._test_recipe_contents(recipefile, checkvars, []) + def test_devtool_add_git_autorev_finish(self): + # Test that a recipe created by devtool add --autorev can be finished + # into a layer; this used to fail with "fatal: bad revision 'AUTOINC'" + # because the unresolved AUTOREV placeholder was used as the git + # revision to export patches from [YOCTO #16354] + pn = 'dbus-wait' + url = 'git://git.yoctoproject.org/dbus-wait;protocol=https;branch=master' + self.track_for_cleanup(self.workspacedir) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + result = runCmd("devtool add --autorev %s '%s'" % (pn, url)) + recipefile = os.path.join(self.workspacedir, 'recipes', pn, '%s_git.bb' % pn) + self.assertExists(recipefile, 'Recipe not created by devtool add') + checkvars = {} + checkvars['SRCREV'] = '${AUTOREV}' + self._test_recipe_contents(recipefile, checkvars, []) + # Finish the recipe into a temporary layer + templayerdir = tempfile.mkdtemp(prefix='devtoolqa') + self.track_for_cleanup(templayerdir) + self._create_temp_layer(templayerdir, False, 'selftestautorev') + result = runCmd('devtool finish %s %s' % (pn, templayerdir)) + result = runCmd('devtool status') + self.assertNotIn(pn, result.output, 'Recipe should have been reset by finish but wasn\'t') + newrecipefiles = glob.glob(os.path.join(templayerdir, 'recipes-*', pn, '%s_git.bb' % pn)) + self.assertEqual(len(newrecipefiles), 1, 'Recipe not moved into destination layer by devtool finish') + # The recipe should still use a floating revision and no patch + # files should have been created + checkvars = {} + checkvars['SRCREV'] = '${AUTOREV}' + self._test_recipe_contents(newrecipefiles[0], checkvars, []) + patchfiles = glob.glob(os.path.join(templayerdir, 'recipes-*', pn, '*', '*.patch')) + self.assertEqual(patchfiles, [], 'Unexpected patch files generated by devtool finish') + def test_devtool_add_git_style1(self): version = 'v3.1.0' pn = 'mbedtls'