From patchwork Thu Jul 23 08:11:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamin Lin X-Patchwork-Id: 93311 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 DCCD3C44524 for ; Thu, 23 Jul 2026 08:11:28 +0000 (UTC) Received: from TYPPR03CU001.outbound.protection.outlook.com (TYPPR03CU001.outbound.protection.outlook.com [52.101.126.87]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18795.1784794286963932835 for ; Thu, 23 Jul 2026 01:11:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b=GtMhnm4h; spf=pass (domain: aspeedtech.com, ip: 52.101.126.87, mailfrom: jamin_lin@aspeedtech.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FI0ijnHRM7iJYsg6fWOo/n1kVn4XK3OJ6j0O+8syoEey+UCHyM5X+uEWFolLpgcx/bMdmwA7BNYtjjE+0nDEFPfUVyuJjsVAdmgdgVNDMKCcZQRGmEAb08KMFDQNKP88hEAdBqCpE4Dtdn0T5rwxdwNLSnccG6j1J2Ra8+pTfUPk9TvY9mVfyI6z8rTPAMAphNO0Ju5t4MXey9wYw+Vu4pILjhjzrYKV/iRDMHPn8RE3DfbIuwKkW0w66mmnnCKOw7UAvBPcTvILHmt61eqhBbdX2C/bPLbSXOxuiB6ItyInwbV+A/lHAGpb3anJEY9FliROlFmfb6p29WK0S/uWwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=49NX/wN4wP8g/j00CMiz1KkFhbizvJ5JJjPsna0tRSU=; b=B4pgS79G8EcnPWZoB2y+3ht96u3hqfYGpZWtqqP8dDitc84Q/dc4d+npRIgwsnst7GVRvhyn4Xab2WLfQ4Vt3DJBmn3j9PlQqDRyJgbRIpAa2Zi3F+TM7lIu4Sm5PpMWY+UNYyGvHbFX5sOrKIlinfF+WCr3aQR0WYTAUhvzYVTxkmnAT/C6XqU05l8hdst/WbmjFJDFY+pw251GJc5mC4o+c9QM59n8b5PlxQxgsbUgdEcPhie491S50YBRLQmEWKbxVAnwKzE5O4gNS90y7nSLMnY1FiVIL8DEsMAEOl4v7xXIRuWQ2JJdNR92+mbM6QOioGKjS5885prJDIfmvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=49NX/wN4wP8g/j00CMiz1KkFhbizvJ5JJjPsna0tRSU=; b=GtMhnm4hgjagXWciOc+HXQttOdY1YvQ16EBURCJM1VpjUSK/XU28Bkp1KXBMNan4Zgcp/njxNtXFvsQw8PCy6luKw5q+AGwYguzyOG/SfO3Yf4hgRuXMF2z6LuutDnXl8LPWXSJ7E1Ui90A5BExhPXzDdx4CEx12sesk5poEcop1sc1XqHCm1MGMTUyFgPl00fu6N+FPcaHECNntNFz/Du8cKhy3Svl8+lZwaOmq+Qyu4rN9PyvnA/F1/TY1u3Pq11kHsAZQjTHzBuGjZh9od70JHksJPZkjs4RRfw9tekYTU4//o4gGS17QTz141Uw5MCabWNUvAOh4S0kjArFkHg== Received: from TYZPR06MB4980.apcprd06.prod.outlook.com (2603:1096:400:1cc::10) by SEZPR06MB5022.apcprd06.prod.outlook.com (2603:1096:101:48::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Thu, 23 Jul 2026 08:11:20 +0000 Received: from TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3]) by TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3%6]) with mapi id 15.21.0245.009; Thu, 23 Jul 2026 08:11:20 +0000 From: Jamin Lin To: "openembedded-core@lists.openembedded.org" , "alex.kanavin@gmail.com" , "paul@pbarker.dev" CC: Troy Lee , Jamin Lin Subject: [PATCH v3 1/5] devtool: Detect nested git repos before the initial workspace commit Thread-Topic: [PATCH v3 1/5] devtool: Detect nested git repos before the initial workspace commit Thread-Index: AQHdGnrYw++KVBeVrk6autu7sEYV3Q== Date: Thu, 23 Jul 2026 08:11:20 +0000 Message-ID: <20260723081118.1558249-2-jamin_lin@aspeedtech.com> References: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> In-Reply-To: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR06MB4980:EE_|SEZPR06MB5022:EE_ x-ms-office365-filtering-correlation-id: 400654c7-81aa-4fe5-1159-08dee891faa3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|6133799003|22082099003|18002099003|38070700021|10067099003|56012099006|5023799004; x-microsoft-antispam-message-info: yx1eXarraH3ruwImPiPgY6b/eGuxPy6rz5yUYzwLToA113Mnc4UVdQMtNoyX37KBMdgrzLJvbjvUJjZjXOZmRuu08wo+M8ntvli7epQf2nDbfJOHhEzrzaa39eQbe4OhX8+TfW3z4YlMDV8pBsAD1PDFKcueKjEjTQATjXH/ZWqTRkrfiLeFduPk6vsgfyVOXvFHFSQApUFpbhRqG5jQSgwo75XPEd2aLl+63VbRpRoAM93KE2/4a4E11fUqy1P0a0S9FaNQ4pcjVixj68ycI/or0/tw6YLID1alEPruTK5pj93C+ghBmXu8Tt98356350m0koJHK/ArZ7qWYHUyhSTZlECyDw8qNtZeXMsTCuZ4GKWNQ7ku5CFC0w4K1PIlYrk5rw435qR9WW4picRHTuFG+KgCKXbphMRSjq5kTys6yYaUMR25UHwYfgHyAS0a80dslVA8pvl/EGqP55aWGh02tMQFYzKWhy3/4FQOZ75k6J0VdJ4kg0fq+oO6avcIDowGuOfyr5xrfYsmzFgUtwgmasBPGgQR7Rg9LpsPRZrWHvv6CtDCmSiAcG7+h5hctxks1YaBgU4zP+RJDgQtd5HgPljVTwaIGa5vfrQxq0+xfDuwk3vw9ywgSBesNDHZRsLK0UeBb360UXQZAVawgPeKFIo6gftFs+PIbcU4F49QklVxfuMAnpIv2vcZtFirqHsxudeWhYM145sJltpk1W67B2EhbdxqBrr5eQb0law= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB4980.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(22082099003)(18002099003)(38070700021)(10067099003)(56012099006)(5023799004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: DEmBiAH5k8joDEqxNHWRsgmmmsACAICP8TZMf2741WuaDF+HeFPljQe81aT1EZCbyt+UQYx2KzMtVG5Ruk2rijklXOP86ocHr5MNP34Gs3ZSUg4yjfHDoQ7ioCUjKufHgWVkeXRIvxjIJEA6dL5rL3rAr/BriOkLTJ89JPhAmcMXZO/IMOEQggem88JTL0eEsCuJ3b4KhOQ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ZwlZ1Sifj7CMj7ebOZ8+snrQ3UsgsQYph1ooNNAQk3PGP/pC4BVOhePT8UlRewAucVC+nQkZumyKGSdKfoqDu74/bfBeV9cnIFTgOamFcISbuIwlbIA7l5l2gsPN421/oRElgjfAlwTxDCeZ2ZS6piCEN4KQUbAIZN3Q3Z+Sv5WeHvxsz1kzKW5XkzQpR8lLj6AY2BjarpGhk9Ht88sLT5G9SkRaYdaTyyk3MRgNmn0RrgOPTdR3/x8DkWcHXSUyYtl99q1UL1RNiWmb9T9SyDoCIF/qEZtOEYCdUAhYD76rA2CCWKxOqhdQN56Ze4ermlsy/iEocjHPFDGIM9GJXtaIZPkWSXcvCGZeGabBjOMQSUxR1IW5UK4t//jvWgOF3b75rYitB1oY/VH0uyM69fqa4+jDewLprwS6NvYC0oI1bf+9umindFRvYeUh5/eN9x6AWubuukXcRU5O/gPMPMYA== MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: JCTS9qJpyjPQC+/dOFxXmoz5/MsaMZfYKZtUDgFyXMM34MZDnfp2xVCC3+pt2uJY6LxCh3rJECyxkmbXiEBGvRbtIYQHJ2vYrGKmy5n7twAYpx2/OshxBjJlG6xknlSjaamA87qcz18BLt/v+6+G+fWWaXcSeXsc8uhSCFB3E3TYXX+F1PiK2FwFc8hhTJ6nysVhWaRJQpvrmXHDBE5D2ZiE9R1bJPq6Ch9bj912WOes0ilB943KyCVg4S+e6XN7U07pFxsj+3hPMctY4fhYT0Fb3FFAOW3L64jZIinX82YCbowxDMJMwR4ZNXFmtnfxLozV+LeNX83Trz3XfR3YWA== X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4980.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 400654c7-81aa-4fe5-1159-08dee891faa3 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2026 08:11:20.5951 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1XhfbPkfuaS94bKmEVNd1JCp70c0azAfKPH7zfDM+JLUPqvfi3lpuNUIqvVSiTF9wDiyV/BLHwiX/bBOHBNv0Oa0BZ8OuxNg7lKzxVeLhCg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5022 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 ; Thu, 23 Jul 2026 08:11:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/241784 setup_git_repo() is meant to convert a git repo that a recipe unpacks inside S (e.g. via multiple git SRC_URI entries with different destsuffix values) into a regular git submodule, so devtool can later tag branches on it and extract patches from it via finish/update. That detection never actually triggers, because of the order the function runs things in: 1. 'git init' 2. 'git add -A .' + initial commit <- commits the nested repo as a bare, unregistered gitlink 3. checkout devbranch, tag basetag 4. scan 'git status --porcelain' for still-untracked directories ("?? /") and convert any that are git repos into submodules By the time step 4 runs, the nested repo was already swept up by step 2's 'git add -A .': git treats a directory containing its own .git as an embedded repo and stages it as a gitlink pointing at its current HEAD, without registering it as a submodule. Once that gitlink is committed, 'git status --porcelain' reports it as e.g. " M leveldir" (already tracked) rather than "?? leveldir/" (untracked), so step 4's "line.endswith('/')" check can never match it, and the conversion to a real submodule silently never happens. This isn't just a missed feature: an unregistered gitlink that has its own untracked content (e.g. a further nested git repo underneath it) shows up as "dirty" to git status even though the tracked commit hash hasn't changed. patch.bbclass's patch_task_postfunc sees that dirtiness after do_patch and tries to commit it, but 'git add' has nothing new to stage for a gitlink whose hash is unchanged, so the follow-up 'git commit' fails with "nothing to commit" and do_patch fails outright. Fix this by moving the nested-repo detection and submodule conversion to run right after 'git init', before 'git add -A .' and the initial commit. At that point the nested repo is still untracked and reported with a trailing "/", so it's correctly picked up and registered via 'git submodule add' before anything commits it as a bare gitlink. Signed-off-by: Jamin Lin --- scripts/lib/devtool/__init__.py | 64 +++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 58b02eb460..0003b7b107 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -200,6 +200,47 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None): if not os.path.exists(os.path.join(repodir, '.git')): bb.process.run('git init', cwd=repodir) bb.process.run('git config --local gc.autodetach 0', cwd=repodir) + + # If the recipe unpacks another git repo inside S (e.g. multiple git + # SRC_URI entries with destsuffix), declare it as a regular git + # submodule now, so we will be able to tag branches on it and extract + # patches when doing finish/update on the recipe. This has to happen + # before 'git add -A .' below: once that runs, the nested repo is + # committed as a bare, unregistered gitlink and 'git status' no longer + # reports it as untracked ("?? /"), so this detection can never + # find it. + # + # Discover nested repos top-down (so we can still skip descending into + # a repo that manages its own submodules via .gitmodules), but do the + # actual 'git submodule add' + commit bottom-up (deepest repo first): + # a parent's commit recording its child's current HEAD must happen + # after that child is fully finalized, otherwise a deeper repo added + # later on gets its own registration commit, moving the child's HEAD + # forward again and leaving the parent's already-made commit pointing + # at a stale, superseded revision of it. + stdout, _ = bb.process.run("git status --porcelain", cwd=repodir) + nested_repos = [] + for line in stdout.splitlines(): + if line.endswith("/"): + new_dir = line.split()[1] + for root, dirs, files in os.walk(os.path.join(repodir, new_dir)): + if ".git" in dirs + files: + nested_repos.append(root) + # Do not descend into nested git repos that have submodules themselves. + if ".gitmodules" in files: + logger.warning('Nested git repository with submodules %s; devtool will not recurse into it', root) + dirs[:] = [] + + for root in reversed(nested_repos): + parentdir = os.path.join(root, "..") + (stdout, _) = bb.process.run('git remote', cwd=root) + remote = stdout.splitlines()[0] + (stdout, _) = bb.process.run('git remote get-url %s' % remote, cwd=root) + remote_url = stdout.splitlines()[0] + logger.error(os.path.relpath(parentdir, root)) + bb.process.run('git submodule add %s %s' % (remote_url, os.path.relpath(root, parentdir)), cwd=parentdir) + oe.patch.GitApplyTree.commitIgnored("Add additional submodule from SRC_URI", dir=parentdir, d=d) + bb.process.run('git add -f -A .', cwd=repodir) commit_cmd = ['git'] oe.patch.GitApplyTree.gitCommandUserOptions(commit_cmd, d=d) @@ -237,29 +278,6 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None): bb.process.run('git checkout -b %s' % devbranch, cwd=repodir) bb.process.run('git tag -f --no-sign %s' % basetag, cwd=repodir) - # if recipe unpacks another git repo inside S, we need to declare it as a regular git submodule now, - # so we will be able to tag branches on it and extract patches when doing finish/update on the recipe - stdout, _ = bb.process.run("git status --porcelain", cwd=repodir) - found = False - for line in stdout.splitlines(): - if line.endswith("/"): - new_dir = line.split()[1] - for root, dirs, files in os.walk(os.path.join(repodir, new_dir)): - if ".git" in dirs + files: - (stdout, _) = bb.process.run('git remote', cwd=root) - remote = stdout.splitlines()[0] - (stdout, _) = bb.process.run('git remote get-url %s' % remote, cwd=root) - remote_url = stdout.splitlines()[0] - logger.error(os.path.relpath(os.path.join(root, ".."), root)) - bb.process.run('git submodule add %s %s' % (remote_url, os.path.relpath(root, os.path.join(root, ".."))), cwd=os.path.join(root, "..")) - # Do not descend into nested git repos that have submodules themselves. - if ".gitmodules" in files: - logger.warning('Nested git repository with submodules %s; devtool will not recurse into it', root) - dirs[:] = [] - found = True - if found: - oe.patch.GitApplyTree.commitIgnored("Add additional submodule from SRC_URI", dir=os.path.join(root, ".."), d=d) - found = False if os.path.exists(os.path.join(repodir, '.gitmodules')): bb.process.run('git submodule foreach --recursive "git tag -f --no-sign %s"' % basetag, cwd=repodir) From patchwork Thu Jul 23 08:11:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamin Lin X-Patchwork-Id: 93314 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 257B4C531CC for ; Thu, 23 Jul 2026 08:11:39 +0000 (UTC) Received: from TYPPR03CU001.outbound.protection.outlook.com (TYPPR03CU001.outbound.protection.outlook.com [52.101.126.87]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18795.1784794286963932835 for ; Thu, 23 Jul 2026 01:11:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b=iMsAoNTc; spf=pass (domain: aspeedtech.com, ip: 52.101.126.87, mailfrom: jamin_lin@aspeedtech.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HI+WlOILC3Ij2fkPx/aL22dKVk1FlftH5c5XDnpaUWUzmbtTwqSRRskI9G9KkQRRNI2c2J3bc6n0rJ+iFQQsCeHkm1AucbzSjjMCTvT6lqgEAQTFLzgov43cNJLMetFBGPIcgPW7fDQVwPlGFB3BVSriOaOfTcNuemi8jUt/7I8O9d/glNLu3sW3dgn8EGbvF/KCo2Tg4iqV07T8nXjpKhSaxSPNye2Hb+isjSo7AfK67LbIVJ/Q6XYveUkIS4qDmkgbEjw534WxFMttAupwby1nG8RAzqMmmMYDOvBD/S2sW8m02i0GscaZTgqR8fsORDrqAEe24pDybNSJNMbdZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tY6iQXP+e3YsnoMSC/GRTy5D2+zf9JPLpJyl12d78Eg=; b=R4m3mwzIHZCjtAseHMRBHzBrfqQvunHyaOebDDxLJjyytvD1AminWDoYyL0ZFhfxTqpt5mWFpQIxHj1KVvkWmvmEMzy9yKHBCBNciEggpXl1AVbZBpCRJnz5w6A3NzdRJJ9GrJBCAkPYEi+s88T9M1UaP4c14CGRJL80pvstp54AYn075aZkAgDkdZ779AFqJHuIIgf3efwQFfArl7DSVvkujIR1f8eyElXa7weacinE+eFg9nKAAeNNHD7UsUOBrKQkD5Z0WF2Hd0wXmpaZ2V9MAh0ddnGstQISxkF948mtrtSLFwOpumZnPUcgD6BRmZqJllnSfCYZXzJo3IH9Nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tY6iQXP+e3YsnoMSC/GRTy5D2+zf9JPLpJyl12d78Eg=; b=iMsAoNTcWpn0AqYHfv6bsbSzBRErBNMpKw1JpSZ9TBWF4L/v7AjBh161afY8kSdNF4cZIX8J6y86XOPX5f2ED9qYlq8b3+FJ3kN/onrRy2q9Z0MLf2WPd7w53VIp1ROYCHv255NZIoOPHUVzpg6g9iBebKSNAFCRlgxUvGnEBnEjgkg1avblesXNBtNWV7Hlkr8ezc8LFj5XsH8/UuR07CvHoCIWY0pve6iZPsMilO2yubJ5b1XW5NU6jK4NdS0mH1N78cEkN97x/ZKd/O84rWiewKDOUhaXx4SfiR1BWH16NAiV+DNMeBRRKiGoTbDR4duwph/39RVRRS1isMgAgQ== Received: from TYZPR06MB4980.apcprd06.prod.outlook.com (2603:1096:400:1cc::10) by SEZPR06MB5022.apcprd06.prod.outlook.com (2603:1096:101:48::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Thu, 23 Jul 2026 08:11:22 +0000 Received: from TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3]) by TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3%6]) with mapi id 15.21.0245.009; Thu, 23 Jul 2026 08:11:21 +0000 From: Jamin Lin To: "openembedded-core@lists.openembedded.org" , "alex.kanavin@gmail.com" , "paul@pbarker.dev" CC: Troy Lee , Jamin Lin Subject: [PATCH v3 2/5] oe/patch: Skip commitIgnored when nothing is actually staged Thread-Topic: [PATCH v3 2/5] oe/patch: Skip commitIgnored when nothing is actually staged Thread-Index: AQHdGnrYvcKwCcy9lESTd8cfpmmSQg== Date: Thu, 23 Jul 2026 08:11:21 +0000 Message-ID: <20260723081118.1558249-3-jamin_lin@aspeedtech.com> References: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> In-Reply-To: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR06MB4980:EE_|SEZPR06MB5022:EE_ x-ms-office365-filtering-correlation-id: 5f333e09-883b-43a4-539b-08dee891fb56 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|22082099003|18002099003|38070700021|10067099003|56012099006|5023799004; x-microsoft-antispam-message-info: mV4SGN9BqQxvRxXLXt9kNBkXTEE+hDFCGJtvpqnO34gsX39YEg+zIJOTgdMFXBF4lG81n0WNPXlOnpcLUsbR406bg2IQGwONpPeg0UtrLAO+XqB7g6S8cZ6kyGGo/z3ksGlBKPMwgthhJGD4Q43pq3+Fq31FI7jB/tbg7qMzX90SnBxOfsqrvuBmH9rxkYObMjeBenpbQ0NLvPnT1PsjtJu3N2jgR7xSR8C6Zfuo+haNk+uO7rMUa9Ij1jKWinspYnDff8oyWzvaDh0THB7wzcmYzdZvgoyIo10tnKx3OXcAwmUPldyEZLxrnqlV16DSWMPaXH7ivRmAjA73MBaVvoKV00JHk4RSoQe5AykEv2xLdwec+l+y9XsVPSAohAeuvngLI9MRUnbMd/E01T3bs4myu3YL636Zb7KvXJTmkxk6O2Uo/u8/9QjdvF1dGvuwwB6JIKnk2vL0LM7UP4zTW/aPffOx7gAc5W6QC2VzI16I/MruHjbVaACVSEu8d2EMLF8LoOwRIu/Zo+6Iadi+1ZW7PbtRs4q8wUdzAf0d3XLmh+v/wYUxKLsaZseZVM7zSzVbYutQbyxLDgrzM3EgG8XzqxE5dkG7TWdJSuJcsPKzhnEh8PhK/HTqD+NGWX3eXmUreutV6T8NbLyR61JJ44ZHsP/2AAwOguQi9eTzu4Bz4lyo8iLUFlD25f6t4Mwkc//A396oCmM8BmTVR9eD4zq6xCcpmMvfGHbKtvR9Vyo= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB4980.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(22082099003)(18002099003)(38070700021)(10067099003)(56012099006)(5023799004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: T/wwp4j1wJKNdaA7wA4TXeZDsBg6PloZCG/Qh7UXJ8VJr3JGnPk12h49kPDgWZ1DXOdtnjI05Pz+r2qR9JmiMxt0XHA8yLKX7TbjJ3F+ir0DWQmO8w6SDwsvoyan5P71+YFc9DJeFftNiZZ3CNdgemUPt46yAEuIZFfJ0Ezhuo7LwHt7dG3O04hq0DR6pTyktT8NGGB77OYoAZHQmImhytsojzEB1vgkSlMOZ7HPGdqVX3F8JmveZoFMh/LKF6YAZiI7QxbeEgHlRGMlBwXD5/DsVMcL3iyTH8abGKIVKRSVNey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eTLLvF7Xj3J4iA8TRYssZKdja5daSaUYWszNsvjSh503+ZB/Mcfsf3qp+ca/TprkCEznjGbFftINBa8UdsVqXL/aEFju3jkpdfg+PgFwC9oBOqYB9QHoe48qwlHhUyywBWM8NJkMTFD46VexNXqTfNtAP84Mg0gFElb3nKUxDFzCiTMhAQZ1SOQ7tQFo4ZBSEWKBx02mTlb8BbcoOOofpuWz5Jz8IUYvOukgZBHLMOEylA2JgW65/mO7fsxg0m3Q2mjcADa0v7pgwIY8loa1T/zZPEk0m4G3tN9AIedYslxZ24wFb7i6ZViT4/p5gCuIMjxcW/Odm8uy+Mj0WSpsTTQ0XD/7G3O0+kqxR5wA== MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: IAtXNpXszEvr/e9qXWRk06Gvl5LdN5BzWq14kC9T5NNL9ikd1WIc5aoEIOg/aHCMf0g3SKe/hFj7T0d54EA80To2Fth0sV0fyO6SCpgLbM0CV4lZPjdxdOvknJ9RO0oyou4Ep9BAfOTSXRckFWHjn+VxRCOtvxpbjQKj40+1V51VSw0WRwdUt5aWxevV7VERMkw631rnyo9svQK/VE1xdwuPv2sMKKYzY8Xnd78pcgPM+o1BUAE2N1EO2sWFguJ/dLBvS5fQN/kZGF+wvkC2KTULzjVy0Ci99FHDDwxc6ytnxavnKO7nuE8B7RZpD8yuuL7vdXO//PmLL/MOEOd6Ug== X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4980.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f333e09-883b-43a4-539b-08dee891fb56 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2026 08:11:21.7740 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: h207lFAF/rxeJo5gmRVQY2OHJwTUWlIuchB5stMmqqXYRA/8pHLZNkrGFnpTiFFFRKnHQ8v7anZxl1X0I5sHnK6tpinwEgp3wDB+N2GDf2Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5022 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 ; Thu, 23 Jul 2026 08:11:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/241785 patch.bbclass's patch_task_postfunc calls GitApplyTree.commitIgnored() whenever 'git status --porcelain .' reports the source tree as dirty after do_patch, to snapshot those changes into the devtool tracking repo with 'git add' + 'git commit'. A path can be reported as dirty by git status purely because it is a submodule (or an unregistered embedded git repo) that itself has modified or untracked content - for example a recipe with multiple git SRC_URI entries where one destsuffix places a repo inside another repo's own working tree. The outer repo's tracked commit hash for that submodule hasn't changed, so 'git add' has nothing new to stage for it, and git refuses to fold the submodule's own dirty state into a plain commit without it being resolved first: $ git commit -m ... --no-verify --no-gpg-sign Changes not staged for commit: (commit or discard the untracked or modified content in submodules) modified: level1 (modified content) no changes added to commit (use "git add" and/or "git commit -a") 'git commit' then exits non-zero with nothing to commit, and commitIgnored() propagates that failure straight up, taking the whole do_patch task down with it. Fix by checking 'git diff --cached --name-only' after 'git add': if nothing was actually staged, there is nothing meaningful to snapshot, so skip the commit (and the note it would otherwise add) instead of failing. Signed-off-by: Jamin Lin --- meta/lib/oe/patch.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index 1d50e83ab7..944dde1e03 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -516,6 +516,18 @@ class GitApplyTree(PatchTree): def commitIgnored(subject, dir=None, files=None, d=None): if files: runcmd(['git', 'add'] + files, dir) + + # 'git add' can leave nothing actually staged even though the caller + # saw a dirty status: a path can show as modified purely because it + # is a submodule/embedded git repository with modified or untracked + # content of its own (e.g. a further nested git repo from another + # destsuffix SRC_URI entry) - git refuses to record that via a plain + # 'git add'/'git commit' without resolving the submodule's own state, + # so the commit below would fail with "no changes added to commit". + # Skip the commit if there is nothing actually staged. + if not runcmd(['git', 'diff', '--cached', '--name-only'], dir).strip(): + return + cmd = ["git"] GitApplyTree.gitCommandUserOptions(cmd, d=d) cmd += ["commit", "-m", subject, "--no-verify", "--no-gpg-sign"] From patchwork Thu Jul 23 08:11:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamin Lin X-Patchwork-Id: 93313 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 BDE21C531C7 for ; Thu, 23 Jul 2026 08:11:38 +0000 (UTC) Received: from TYPPR03CU001.outbound.protection.outlook.com (TYPPR03CU001.outbound.protection.outlook.com [52.101.126.87]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18795.1784794286963932835 for ; Thu, 23 Jul 2026 01:11:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b=O4dWAYzV; spf=pass (domain: aspeedtech.com, ip: 52.101.126.87, mailfrom: jamin_lin@aspeedtech.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oYPzWAkVSZP4Nzsef9VM25hN1exHGQUkC/526GjiyAsoangt7nkaxshYfyNiXQFRfBmHampGmxb9D+EsSGq/MdE/uAnDx5JTJ5SjJ2cQSL/3Minql1+HfBP6ViPejabCitluIHHYRROEqga76tzAAIxX+b/fkUFCiwE+eymrdA2mX7CQY/kP12UaISyfLrtx3h56LacI8NAuTmsvh20GiUzYqvLTzZuFKWLpZTkYybpe27sdKR7JZuQWNZzbDaBUTxl0/GdBsbKuRdeIMYrmel5/rRLeNxDIN6Yq3W5M0x/oSZ7GKtr6Wnf82Ycfr1ngIaFv3p/S9FcNv79fgr9VVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ehwGFgobKnuK1NsPI8i7DPrqoWYo3pkos9f3oUkWiSM=; b=IHDhgE76Hbc2awLlvGX4kwhNmWHU4XIjNnekx8UjkcC6duHnfmTeLh2Rm7e0lMHKz8oeOrEAPIhHi73QcymcG+UymexHGtWu53Iw/XwdLMFNh3yLqqqiU6yl8Fk5FHkP4KEdfmnW45Etn3qhF3NyR6gJG9pEGoqeUb2kOdR4lfg9BX/wZx9C5bAg+q8XgD5MFgwSb6ke53NFvmIsy7NucEj9Kja85RhD9ibkqB4jC5UcV2QYTJZNe/+OwkwgX825HIWhtEvVzk0iaofEGm34DrR2+QvGwBr7Jsj9Sv8aWnOCQLKcbNjHlQT0nOrAxRQhSalnzmDVq3wQJLknIlRAcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ehwGFgobKnuK1NsPI8i7DPrqoWYo3pkos9f3oUkWiSM=; b=O4dWAYzVZebc4xX725wjs3YtVDu9HazxZQBikNPj1lfneOnk5kElf7UtbWa8wApkw2plZdswnpe/nvEu4o8Pk4tzXDtkMtV9V7lz/k6fNGRmtC6lCklGo1iH2Ja9I1AfvsPDxUyaWOQtqrwLQ65ngN8tWyu0kHVEP7sa+QRD05roZA7Sw2K4LS4ntkSyc+bHWJc+NBnteusck7RCjYljRFpOfbUlilfpvy1HiL5rxbWux2ZSrPDHMWb+sjHcIX/vwJDewqjOPAsnxM0LYlfTu3Z/UB7+vY9W8dyT6hzTsdXMNZcGKe+evoL/YK3OWuMQXVXyGjIDKMoSSkqA/Eaatw== Received: from TYZPR06MB4980.apcprd06.prod.outlook.com (2603:1096:400:1cc::10) by SEZPR06MB5022.apcprd06.prod.outlook.com (2603:1096:101:48::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Thu, 23 Jul 2026 08:11:23 +0000 Received: from TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3]) by TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3%6]) with mapi id 15.21.0245.009; Thu, 23 Jul 2026 08:11:23 +0000 From: Jamin Lin To: "openembedded-core@lists.openembedded.org" , "alex.kanavin@gmail.com" , "paul@pbarker.dev" CC: Troy Lee , Jamin Lin Subject: [PATCH v3 3/5] devtool-source: Convert nested git SRC_URI destsuffix repos to standalone clones Thread-Topic: [PATCH v3 3/5] devtool-source: Convert nested git SRC_URI destsuffix repos to standalone clones Thread-Index: AQHdGnrZtiIoNhwZ3EODfKkGkiR5+g== Date: Thu, 23 Jul 2026 08:11:23 +0000 Message-ID: <20260723081118.1558249-4-jamin_lin@aspeedtech.com> References: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> In-Reply-To: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR06MB4980:EE_|SEZPR06MB5022:EE_ x-ms-office365-filtering-correlation-id: b72a21aa-ab71-4bd8-37f2-08dee891fc45 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|22082099003|18002099003|38070700021|10067099003|56012099006; x-microsoft-antispam-message-info: 0ALcLFD+JIdyws1Ww1ZXbUBi42qHS60+x+962vHiXoeAx0jcpdSBk64EcTCZZvHUR3RfLuM03eX5OEps3HggC5+IVzlEFaMuA6lKWfAOmBrKyfVk+XiNC7P/CHzO6To7v9ZGB0f2jK16e47pWQt7rRpOpLRjbXrtKDEtgvKCvc7WzfJ1CdlxH5FARHZFQAlauVP4AcQE+JRmuKL0v7l/7/8tGrwWajox1hAGZf2T3wgm/E5uOArdoatcPDl8V2iga2dg1TLL49tvYzUCxynKmPfXTZDuFmzzbptMvf6C6Nsuqbv9NPUsEUvS3Le5uznUBPPi21ipCN5kfYGGTnO2SBLs3+Of+uYu2kFBsSKWX9w3W5pzjkGh6Jno2a8/9T3BCoTK2tmEISgXuB8c5ivS/F2V8BKQURSl7dBdEv1hDGdYRc8FzMQfzbWPHZ+w/lOz+5k4WCupNvVJRowUFb4xcsd7nJ1KL2CV+vw/2wXlWl7+h8ntNIJbsT7y8YQB8elXSWnGWj61mOJwpvVbHMEwxx4bfeS+3LI9raBVaEuLe5H4t1YlB9P2XqFs/Kq3VcZAI/9CLdusuL7m27Z8x2m6C4nRN+UzcxqiumuR1s/o0dSmO1kVY/PBtZrBETq4gv0+6PPqIyMkQrULX0ZYix1TaVK2aNr26Y714nzZlyjSBHGKSa4rUnZlSmh5+kpA+VHtxJ7BLNbzonjE+RY7ce5X9NG0cbgtbz2enyjFwIjUL3o= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB4980.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(22082099003)(18002099003)(38070700021)(10067099003)(56012099006);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: QrT8sMpJNp/LprH2RW7Udo5EWWNQFm9gBlWYA6OMtWUoS5tSlnh+Jy24tyE7lCXMXBoKX4zrpdBC/Xd1InFkHmHf/+awYAX/3O6JeYmkL7K70G+MjMfR7cT66CPfGwty46obadtNPSn3MFSfyWevL92JQgKzfAiay4iJnALiL+H7z4ROZVSw01+vYNurF1DvPpyO+QruYhuZd43bjEl9bDuVr63ManpdXsTn13G8UgvuDX0MvcT2fbFNVRxiv8PpKcsOizvpHYpslU3muJOk40O0faznrCNFCqq7FICXk5efJMpk+A6j6RRp/pb+s9IOO8CAiVVwypDPkU9Yiv9G6MJB28DD3WZXESMxcWw4sz8aEFmyVHDvSpZKiUGZyfnhemdWxlyvtJz82q7YpfRenygQhHRe/MnSf2qzLy7+nEZS9o9yfR3qyTERFXbCDGLOOmkBs8mxvI0N8xiACV4tpK+JsliZ+6JOEKB0LodIgHbTZmJuEHb3ewKnFOYIkkBNKrBYT9Q5C6WpNUnn9s9fwB2ojOX47ABoMDlWNh85jbw4fwIFw1a9XnsT78Fkgrtnwf2B3Wsh/oyQ1WgSnVv1fnq3Z5eFQNarX7/KGrvcegT+1Vv0LXKi781n5mkaFR+vk7ED1RoEnNhiDqBsIjOH4y1EQbzqUngfCoWlaFkUBwfucUcdoPFXoUCs4QuUyZ533PVY0y2kgtIqMokRfJc18A2xDPW+FQfullyrLDF5oE9znkH6ubMo2FWZwqB8ktJY0QFAVCE2c3Vx0h0ZcDTrEnUm+y3mT8AlMv7PuKr2iFx03lkbKVG0vziR9LQoY/Cp8zidyd3H2Ibh09IfFx0FZXebuzEPnRVZBP+MsyO2c4a4r928ptp6Th7+bAjZme7jvQpyvXVEyoeRMKOGinvS20xzCOGekbL7K+LdLo7Vo363nJ6EIBaUm9sa5d4euZT8K/7ZPv9rXlg9NM0czZAVwJdmgUYG75cbf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QB/VMxkyXPEgKDrZkhfLwtAfPwcDdKF48YUOBO1/3wCwdHctz/1Aag== X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4980.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b72a21aa-ab71-4bd8-37f2-08dee891fc45 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2026 08:11:23.2634 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tQjbgjMIbXPjUywX5IcFUve1AjQB9fxKqRSVpGAFjizngxi4CF3bbAy4rnvPQkSXjPEG+WgrGamHRI70jfDC+OKw0Zh1SAt2nFxSAO44WNg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5022 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 ; Thu, 23 Jul 2026 08:11:38 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/241786 When a recipe uses multiple git SRC_URI entries with different destsuffix values (e.g. recipes with separate repositories for the kernel, modules and application), do_unpack clones each source tree with 'git clone -n -s'. The -s flag uses git's shared-object mechanism: instead of copying objects locally it writes a .git/objects/info/alternates file pointing back to the bare repository under the downloads directory (DL_DIR/git2/). scriptutils.git_convert_standalone_clone() is called by devtool_post_unpack to make the top-level source directory standalone: it runs 'git repack -a' to copy all objects into the local object store and then removes the alternates file. However it only processes the top-level source directory. Each nested git repo created by a separate SRC_URI entry retains its own alternates file still pointing into downloads/. Steps to reproduce: 1. devtool modify 2. bitbake -c cleanall 3. bitbake At step 2, 'bitbake -c cleanall' calls fetcher.clean() which deletes the bare repositories from downloads/git2/. The top-level workspace repo is standalone (alternates already removed by the original code), but the nested repos still hold alternates pointing to the now-deleted paths. At step 3, srctree_hash_files() runs 'git add -A .' with a custom GIT_INDEX_FILE. Git internally calls 'git status --porcelain=2' on each nested repo to check for changes; this fails with exit 128 because the nested alternates are broken: error: unable to normalize alternate object path: .../downloads/git2/github.com.example.module//objects fatal: bad object HEAD fatal: 'git status --porcelain=2' failed in submodule modules/lib/module This halts the BitBake parse phase with a CalledProcessError and leaves the workspace in an unrecoverable state without manual intervention. Fix by having devtool_post_unpack() look at the recipe's SRC_URI directly: any git entry with an explicit destsuffix param names an additional checkout nested under the source tree, so convert each of those to a standalone clone the same way as the top-level tree. This is deliberately metadata-driven rather than walking the unpacked source tree looking for '.git' directories: a directory walk has no way to tell a nested checkout from an ordinary subdirectory of one, so it either has to stop at the first git repo it finds - which then misses a destsuffix repo nested inside another repo's own working tree - or keep walking into every repo's contents, which is wasted work for large trees. Reading SRC_URI instead gives the exact, authoritative set of paths that need converting, regardless of how they happen to be nested on disk. Only entries with an explicit destsuffix are handled, since that is the only way a recipe ends up with more than one git checkout under S; this also avoids having to duplicate the git fetcher's internal logic for computing an implicit default destsuffix (which depends on the subdir/ subpath params and BB_GIT_DEFAULT_DESTSUFFIX). Signed-off-by: Jamin Lin --- meta/classes/devtool-source.bbclass | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/meta/classes/devtool-source.bbclass b/meta/classes/devtool-source.bbclass index f29f40588f..940cdedbac 100644 --- a/meta/classes/devtool-source.bbclass +++ b/meta/classes/devtool-source.bbclass @@ -97,6 +97,22 @@ python devtool_post_unpack() { scriptutils.git_convert_standalone_clone(srcsubdir) + # Recipes can use multiple git SRC_URI entries with an explicit destsuffix to + # unpack several repositories as nested subdirectories of the source tree + # (e.g. recipes with separate repos for the kernel, modules and + # application). Each such entry is unpacked as its own 'git clone -s' and + # needs the same standalone conversion as srcsubdir above, otherwise it keeps + # referencing objects in the downloads dir that 'bitbake -c cleanall' removes. + # We only look at entries with an explicit destsuffix param, since that's the + # only way a recipe ends up with more than one git checkout under S - this + # avoids having to duplicate the fetcher's internal default-destsuffix logic. + import bb.fetch2 + fetch = bb.fetch2.Fetch(d.getVar('SRC_URI').split(), d) + for url in fetch.urls: + ud = fetch.ud[url] + if ud.type == 'git' and ud.parm.get('destsuffix'): + scriptutils.git_convert_standalone_clone(os.path.join(unpackdir, ud.parm['destsuffix'])) + # Make sure that srcsubdir exists bb.utils.mkdirhier(srcsubdir) if not os.listdir(srcsubdir): From patchwork Thu Jul 23 08:11:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamin Lin X-Patchwork-Id: 93312 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 DB9C4C44524 for ; Thu, 23 Jul 2026 08:11:38 +0000 (UTC) Received: from TYPPR03CU001.outbound.protection.outlook.com (TYPPR03CU001.outbound.protection.outlook.com [52.101.126.87]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18795.1784794286963932835 for ; Thu, 23 Jul 2026 01:11:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b=Bdv98e7x; spf=pass (domain: aspeedtech.com, ip: 52.101.126.87, mailfrom: jamin_lin@aspeedtech.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tXJ9HH9S9TSlZi1BgHhfzC3j7qudcXCN6KvA+NCicxoL8TGPWMvNbnisE+XHMRsxouJjbso7ONm9m9m10NU3PgWVW3G3P9RHEVqtZtNiEFva0mPyWPhbMtdm1lh3wTvivDD0tzPYA0UVE/CAuuB7ljByEnP2cBoA4tMP3GmRnIH3/sVihUTnrB85ZyNaalNwlfthohVXMwI+ztWxksNn/nUzvtdSl4Qo+XpurZbNXNUng2NmzWtSXx6OtzlTzv8ViyqC5jMIBpxCkRP6y/65OjTfjGZ3NrIcACadZV/VtQnHRR/ecFno26fDPZp1WaOZlPB4wYlUiAQRVRuMiEJ3sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y7z0qXDCsUGyEP/IWYdMXb9lglf+2KPW7OLDoE0YIFo=; b=QJof7St6ty5jkMGYFFQhDImu15uZvpkQp9FEBYmJ9xS1fr7t0w1yuIiClTGiC/XnyHlkbStSNfWo++tWs34/rSsYirXVcQ/NlwLeqhvE8ONQtQWZvvbAUP3CutwW1dcyySr5kKRNeJYPP9HW4bE8SaS+p4LOdfmp+2w8A86Hvzx/N+DGY4FX+v7WirSjIr8R7gmGB5fcWHni517ZvvIkir22clgxbWKyf/gAB+ajw379IkrAUAqisPBtBKNVxtYinI8Kg2mG/obtBb6oURPjbrV3qyoKE2hsBdbZIbPXy3qBMovD9GMMx/Oc0Ld9qkhosD085fBf6E/z5dHtidUnZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y7z0qXDCsUGyEP/IWYdMXb9lglf+2KPW7OLDoE0YIFo=; b=Bdv98e7xdmgiPLWjVV/fC19IRAngupBp/5NcX575+ZIwhFP9rHFISKGU5tU+vqcbgo4Y3TVJO8e/o32z6bn1gh1CP/Ak2yjJH+SALbAKgpB+J9+SGl9vr5dyqEL1PZjFWXoe/dhKpjscQ0aRcMsen4VQta6LBkup4otW4fCj6aMmn+8V93kUuv1bhXiHRGJ4o2WhXQQovGQSYORZhYm+v5mtPByLWBIb1MtB8pIEtKxwOxwGELt7ITXqF7TR52LpCLDT0lRA+ThuEOYSBd8eaMhxMFI5rLreKPCUEta4NPajuKc5iz5tD6co3k5aw1fzUgXezjcH3SSinkSk4vDzbQ== Received: from TYZPR06MB4980.apcprd06.prod.outlook.com (2603:1096:400:1cc::10) by SEZPR06MB5022.apcprd06.prod.outlook.com (2603:1096:101:48::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Thu, 23 Jul 2026 08:11:26 +0000 Received: from TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3]) by TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3%6]) with mapi id 15.21.0245.009; Thu, 23 Jul 2026 08:11:24 +0000 From: Jamin Lin To: "openembedded-core@lists.openembedded.org" , "alex.kanavin@gmail.com" , "paul@pbarker.dev" CC: Troy Lee , Jamin Lin Subject: [PATCH v3 4/5] meta-selftest: Add devtool-test-multi-destsuffix recipe Thread-Topic: [PATCH v3 4/5] meta-selftest: Add devtool-test-multi-destsuffix recipe Thread-Index: AQHdGnraE65wcJCXf0aJDaNEMhkfsg== Date: Thu, 23 Jul 2026 08:11:24 +0000 Message-ID: <20260723081118.1558249-5-jamin_lin@aspeedtech.com> References: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> In-Reply-To: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR06MB4980:EE_|SEZPR06MB5022:EE_ x-ms-office365-filtering-correlation-id: 102257e4-6bfb-45dd-a9b8-08dee891fd06 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|22082099003|18002099003|38070700021|10067099003|56012099006|3023799007; x-microsoft-antispam-message-info: EV7MP1rKVSowymY2mn0Y+FBDaeo+f3tjWnaonmToHJE+dyHVbCwIPlsIyNqeBiXG4WtB7Q5Ablm4AMRcVXM5fC7lYflKhzjfkIO6jFDJh42raPW7fr/Nhi6odee6NLvC6EVFcVNpkXTIiG7leuGkuvKvWv+VdwpIakMSNNQYZibMoMLI3gLqFuNiiwwZXJkGa9C4MTSQ0b6XKb119zV9eAR+Yxob/gdGnLvx4Mu6QeVy9rdrCIIRU+UAvM/wg52HK0aIj6cFbDW6zBsAVAKEHq0yw5lN4F+GUxS55U52oV98auiMcQCcTsWVOzsXGgs3YwtGSvHhAdGtdPCo5RM3LknthR5AhC6wffU1QRcy3nDr2qRvnCWeskuNichyPi3wE57R2Y++BWl5VMxuNPm8bDSo+uZJkZk4tA97hIFuGRlAmSTeX0LyKnkkkB7uwCWuMrovk4gnUrayryTIMw7qeH3Mtqkn1aNQcwkebc224v1+Zg9fBS7RabbhKCcBt1HiLnQSlJaOcUUtNVHIChMQ6567KEP6keBK107yIZXcPVVI2I+axF2HS+x4KMIlFcuKmR/WH89wi+phsorB0YIl2RbhVeHrHm26AVXLNQhLdrNdhlJOhRr24FuyjGDk7Y/pRRlAjyG/NUBNR6ULiGvZStK/KyQbD1Ms2+cZkVRqtfQF6eNH8sFG5i/WnL5z6JvDATtDzk59K74hlVI8wT0byg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB4980.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(22082099003)(18002099003)(38070700021)(10067099003)(56012099006)(3023799007);DIR:OUT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+ewuSK2cZo0hrabizLijkDKaJFOujg== X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4980.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 102257e4-6bfb-45dd-a9b8-08dee891fd06 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2026 08:11:24.5648 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5e66MtNQ5FOA1qPW/6j3Mo9HYPtvxUzkIW5d0eDVV1x6KJ5F7IhkHPcpAyF5lI1vHnxusOViU0/+PlScEiMHu3Wvy9qshKMwUi3IwgtRy2M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5022 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 ; Thu, 23 Jul 2026 08:11:38 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/241787 Add a test recipe with three git SRC_URI entries using nested destsuffix values, where each repo's checkout lives inside the working tree of the previous one (level1, then level1/level2, then level1/level2/level3). This recipe is used by the devtool selftest to verify that devtool modify correctly converts all nested git repos to standalone clones, including the case where a repo is nested inside another repo's own working tree rather than merely under a shared plain directory. Signed-off-by: Jamin Lin --- .../devtool-test-multi-destsuffix_git.bb | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-multi-destsuffix_git.bb diff --git a/meta-selftest/recipes-test/devtool/devtool-test-multi-destsuffix_git.bb b/meta-selftest/recipes-test/devtool/devtool-test-multi-destsuffix_git.bb new file mode 100644 index 0000000000..880f0f0bb4 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-multi-destsuffix_git.bb @@ -0,0 +1,27 @@ +SUMMARY = "Test recipe for multiple git SRC_URI entries with nested destsuffix values" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +# Three git entries genuinely nested inside each other's working tree (not just +# nested by path under a shared plain directory): level2's destsuffix places it +# inside level1's checkout, and level3's destsuffix places it inside level2's. +# This exercises the devtool code path that must convert every nested git repo +# to a standalone clone even when one repo's checkout lives inside another +# repo's working tree: the initial fetch uses a shared clone whose alternates +# point into downloads/git2/; git repack copies those objects locally so the +# workspace survives 'bitbake -c cleanall'. +SRC_URI = "git://git.yoctoproject.org/dbus-wait;nobranch=1;protocol=https;name=level1;destsuffix=level1 \ + git://git.yoctoproject.org/dbus-wait;nobranch=1;protocol=https;name=level2;destsuffix=level1/level2 \ + git://git.yoctoproject.org/dbus-wait;nobranch=1;protocol=https;name=level3;destsuffix=level1/level2/level3 \ +" + +SRCREV_level1 = "64bc7c8fae61ded0c4e555aa775911f84c56e438" +SRCREV_level2 = "64bc7c8fae61ded0c4e555aa775911f84c56e438" +SRCREV_level3 = "64bc7c8fae61ded0c4e555aa775911f84c56e438" +SRCREV_FORMAT = "level1_level2_level3" + +S = "${UNPACKDIR}" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_install[noexec] = "1" From patchwork Thu Jul 23 08:11:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamin Lin X-Patchwork-Id: 93315 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 152E5C531CB for ; Thu, 23 Jul 2026 08:11:39 +0000 (UTC) Received: from TYPPR03CU001.outbound.protection.outlook.com (TYPPR03CU001.outbound.protection.outlook.com [52.101.126.87]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18795.1784794286963932835 for ; Thu, 23 Jul 2026 01:11:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b=nifRXY+C; spf=pass (domain: aspeedtech.com, ip: 52.101.126.87, mailfrom: jamin_lin@aspeedtech.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZYU/dVxv9rP+6qr3u0z0HAgaAnPqr31zJTffCu4ubO72UU41vnp19+omNtXXgj+GPCYrt5EBCMihUSJKfK3lyfALNFxjW3HojCXLoCQ1V14c/zcjScDb7HUS6QGL8Hf5K/8PvO3aAa/hX5+4F+QkUO5yCBW8+mQJlNBRCaeEESgH5j3+nL8aKcU5u4rLPdU/83u129BnQ4wBaXC00BZ8nAJygEbHlTbNCCvsHLZ5WTvBJc2diliybsRLLEID5bc1R4zLdGsqiP3hWPUmcZs1otY0vVwinxJKdN98yrN5LydpVXMubAZI9w8NeRxUmHqoJW0ULPpeRy1Ds1XClKdB1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lq9ZO7jNxShRdTtNupaMSsnhfAFVXlXBEyaRApRWRx0=; b=kW1gCElGhpb+nA5rk0Qzm4hunqrrotZVXvtLuhRRKsbgpENGVDbqH27PBBXX50uWXACZcKMOi1JLL4VCnH2RLXstGHiP8+SH7wv6Cv1pDe0ckEWtzigNnFH/jncJ43YsWqy5BDsGlO+f2x1BSBAmhLEHpNAdH6DeNirCVjzs0LfyzjmKmN/u2pGrb2wOEq3Yu8Aqji0oSzcg2oGZVv7ZtEMpgUTCld6o6dd/mWtXEZRVJsOsP7OfJ3ozfaKjzZoUz3Y1TNn/fGomzHgFY+1ZU+Z//ViO6ICSrcNfB7MnLwzY5Hi71p2cspujlxFugzSdVz11o87iORDuAdoUugFM7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lq9ZO7jNxShRdTtNupaMSsnhfAFVXlXBEyaRApRWRx0=; b=nifRXY+CO9lA/5n33PH8cxGF//Qagu21WHJEhpYllu0Ty3ED4VkMZKtE59Bamt69ZkABkRAK6yimmUwynPTVYnyKQzgO4CQRvc1VlClIvLAKx4Ope3NvxmAsxE59c4RZUlGjlI/fHqsDaLdZftC2pSsExobL+N1DgO+HNj9xrp/X3K8rEwz65QgOWTzJmpBA4rKoAgjgwfWaeDbHf0kRUc1KYEOEaPfs/4HBJgKLx7Vglk1IahPl6419Tky6Mic7l5oHutfq3jAbtqvPAAQBFLUVd4ymef0FYTtyQxMNxwalNncI72va6QeuLg1++P1XPLI1NjZcwX88tYCbq+kyhg== Received: from TYZPR06MB4980.apcprd06.prod.outlook.com (2603:1096:400:1cc::10) by SEZPR06MB5022.apcprd06.prod.outlook.com (2603:1096:101:48::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Thu, 23 Jul 2026 08:11:27 +0000 Received: from TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3]) by TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3%6]) with mapi id 15.21.0245.009; Thu, 23 Jul 2026 08:11:27 +0000 From: Jamin Lin To: "openembedded-core@lists.openembedded.org" , "alex.kanavin@gmail.com" , "paul@pbarker.dev" CC: Troy Lee , Jamin Lin Subject: [PATCH v3 5/5] oeqa/selftest/devtool: Add test for multiple nested git destsuffix repos Thread-Topic: [PATCH v3 5/5] oeqa/selftest/devtool: Add test for multiple nested git destsuffix repos Thread-Index: AQHdGnrbSugve8qM9E2N78daPQFmXg== Date: Thu, 23 Jul 2026 08:11:25 +0000 Message-ID: <20260723081118.1558249-6-jamin_lin@aspeedtech.com> References: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> In-Reply-To: <20260723081118.1558249-1-jamin_lin@aspeedtech.com> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR06MB4980:EE_|SEZPR06MB5022:EE_ x-ms-office365-filtering-correlation-id: 3b647c42-d877-4557-1987-08dee891fe6f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|22082099003|18002099003|38070700021|10067099003|56012099006|3023799007; x-microsoft-antispam-message-info: avpuFYOkzAdHVMkCscVpEC8EUIqM43/pLc3nmqx4fVB7FDX1TKpBOCEL2AWJF0biVpHkw3QSQjbwaTuOMOFOaFLLjpS4kD+ZysVJc30lnr6jklUwfqImSkOwRRLr9ELbQ/uT3NcEIzEFhhAoeyuwuB45NNwiuw/LjCeL6WtbqAG72DmYiwCcDmneZcgDLgOLYa98vP8HfwWRZlq0cdh8LYYX1nm7xwhXa90/isN5AiXbHhrUL3td8JYspz+OtGQ6P0SKX02jG/QpQH/9Dzofcnm5klGMAoztW1fsOH/7lEdexJOyUTSQ8ZxAhw/2mgCJ45PGfe3N+GqQZWpOgahEHe+hIkgnJYefjX7xZI/kKnKpY3S7mW7UdBMevthnhRw44NMmJdjGCL+QUIxGwEhXvUFCZraYnO49KVak+3p5fv8EQaJq+aohQJg5Fm0xwdSq1mZgYo4ECA6xyv/8LQROFanByVUrE+cX68eO+BRi6w+Br0WVft+HgaHtPaOSeVKkuo1ZZ+d/z+Km4ydTr2ZkmsaiU0SFio5cZJmSR95U51rTkhSrU8i4y/FsXbqhmVfPVI85/UAWTWA0MjnFI4AdNRezI6dRY7yDNm5ekG6xHFS8C5gkJR66jpxooHZbVeJiNHt+XT29SOBO6z4BB9GnHc6/fysd7pBPWYYSYNyyyHocV43aVLBqOpKuW82i57sXI91aV6iw6bb8iaFYhVILF2RBPNJmT8nFGjInfqpxdyg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB4980.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(22082099003)(18002099003)(38070700021)(10067099003)(56012099006)(3023799007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: jxcD4q2V7cg6jFKhqF+oTygRz1VYa2Dq1so62ZQ8tFzoaxtmHhVLKCMBSZ7qbRrz5lN2rpDPosFsMqAxD69b/LhicwxsTe0yiRtMhZUyB9LCNhP+QHAUovKMJX5bGQlzXf7eNIhWxuokiMfWEcUDKyoC6IX1p1aBf21z0Rds4aLH+A42PvQ8o4udr0CjeumgzGG2VN+N9UTMEAEK8Icxjc6lL3l9U40KgY/6g5bxNr8/s4V24JzSTU+42+25iiOsQDiWhX6tGRPJ3SMsQU0K43E+JwR19Dt/gq0W7kRp1Xrcyu1IfwtjtthEseduabXuc1BvfKfT3f4eAjjFHSBvjJrrBbp3hEPjT3BKrgEsCWxEK2y48jNhTysZ1ecerzEBemM8YROptRhMlTmqk5GlA70LzbjKIAdJKJD45zIyCx/nmIDiK3q+nMIzNApVq6nrhipFB8fQ900eWQwUA01wje0OC/ZqCRCOpjLPAnUFfbYCYmWSAouqVjH7NAhSiGbB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1G4Hf7kBaTw8R17TYekmIptIppclcrx0fYPF9RIPDXTHzqOPM8vXZYX9qntcBTQUum/PFhhFU37p7m8/s0lFT49Ug1ex9pJPXkSNwCK5/RenGLQPuSi2+gC10Uon/sNSMKz0dI0TE9A3sKgCwimPgVqChbhWvk3j0/72dYsz/NJ5UQ== MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: dWVFRZtT316TjVoKOYN/0owd/POUhmJrJlt4T8lapZiFZNZcUGIePeRrHesoJyAwFw7VDrXuA+lM2cF1lB96LwG5rnJnuE1dAaZKg76JggG3yNOpzJvPMCvAf0vB5suSP5fpX1rZ/eNFhR434ybRy/PUgG9P78KetOZyKB/b/uatZgt+Duvn57xIUv1yZvsbAc8s0oZhFhOv4X/d4iWhzcjOHLOJC1pt98wcg7ZTNYJd95PgkywFYAIGduUe/5V5UV1lItGr0qZSux5IZBDSzSPNL+34vamczSLXhOUPuTxwSygncEv4w7/rd+fn96zVzS09zbUW+wWZAoeLlLVoEw== X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4980.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b647c42-d877-4557-1987-08dee891fe6f X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2026 08:11:25.7635 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: D3e6ac2kKVGXSEfVZ6O74orr1TP173DYjTnYVpKy70dquKZp3CF0OzCgalu0klHiWrHNGe8fr9LTdvhudZXLhno7MA75vgSHgKABSxcYrTY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5022 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 ; Thu, 23 Jul 2026 08:11:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/241788 Add test_devtool_modify_multi_git_destsuffix_standalone to verify that devtool modify converts all nested git repos (from multiple SRC_URI git entries with different destsuffix values, including a repo nested inside another repo's own working tree) to standalone clones so the workspace survives 'bitbake -c cleanall'. Signed-off-by: Jamin Lin --- meta/lib/oeqa/selftest/cases/devtool.py | 64 +++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index a10eb0c784..de73a2e620 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -1265,6 +1265,70 @@ class DevtoolModifyTests(DevtoolBase): self.assertExists(os.path.join(source_repo_gitsm_gitmodules, 'bitbake'), 'Submodule not found') self.assertExists(os.path.join(source_repo_gitsm_gitmodules, 'bitbake-gitsm-test1'), 'Submodule not found') + def test_devtool_modify_multi_git_destsuffix_standalone(self): + """ + Verify that devtool modify converts all nested git repos (from multiple + SRC_URI git entries with different destsuffix values) to standalone clones + so that 'bitbake -c cleanall' does not break the devtool workspace. + + The recipe (devtool-test-multi-destsuffix) has three git SRC_URI entries + with S = ${UNPACKDIR}, each nested inside the previous repo's own + working tree: + destsuffix=level1 -> srcdir/level1/ + destsuffix=level1/level2 -> srcdir/level1/level2/ + destsuffix=level1/level2/level3 -> srcdir/level1/level2/level3/ + + This mirrors real-world recipes that embed multiple module repos + as nested subdirectories of the primary source tree, including the + case where one repo's checkout lives inside another repo's working + tree rather than merely under a shared plain directory. + """ + testrecipe = 'devtool-test-multi-destsuffix' + src_uri = get_bb_var('SRC_URI', testrecipe) + self.assertIn('git://', src_uri, + 'This test expects %s to have git SRC_URI entries' % testrecipe) + self.track_for_cleanup(self.workspacedir) + self.add_command_to_tearDown('devtool reset %s' % testrecipe) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + result = runCmd('devtool modify %s' % testrecipe) + self.assertEqual(result.status, 0, + 'devtool modify failed: %s' % result.output) + srcdir = os.path.join(self.workspacedir, 'sources', testrecipe) + nested_paths = [ + ('level1', 'level1'), + ('level2', 'level1/level2'), + ('level3', 'level1/level2/level3'), + ] + + for name, subpath in nested_paths: + repo_path = os.path.join(srcdir, subpath) + self.assertExists(os.path.join(repo_path, '.git'), + 'Repo %s (.git) not found in devtool workspace' % name) + + # Key assertion: no nested repo should retain a git alternates file. + # devtool modify must repack objects locally so the workspace does not + # depend on the downloads cache, which 'bitbake -c cleanall' will delete. + for name, subpath in nested_paths: + repo_path = os.path.join(srcdir, subpath) + alternates_file = os.path.join(repo_path, '.git', 'objects', + 'info', 'alternates') + self.assertNotExists(alternates_file, + 'Repo %s still has a git alternates file after ' + 'devtool modify' % name) + + # Verify the workspace survives cleanall, which removes the shared + # objects in the downloads cache that alternates would reference. + bitbake('%s -c cleanall' % testrecipe) + + # After cleanall all repos must still be usable. + # A broken alternates file would cause git operations to fail. + for name, subpath in nested_paths: + repo_path = os.path.join(srcdir, subpath) + result = runCmd('git status', cwd=repo_path) + self.assertEqual(result.status, 0, + 'git status failed in repo %s after cleanall: %s' + % (name, result.output)) + class DevtoolUpdateTests(DevtoolBase): def test_devtool_update_recipe(self):