From patchwork Thu Sep 17 04:24:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S0FaVVlPU0hJIEFLSVlBTUEgKOeni+WxsSDlkozmhbYp?= X-Patchwork-Id: 98503 X-Patchwork-Delegate: yoann.congal@smile.fr 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 DF056C982D1 for ; Thu, 17 Sep 2026 04:25:05 +0000 (UTC) Received: from mx0b-006e0602.pphosted.com (mx0b-006e0602.pphosted.com [148.163.140.78]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.32198.1789619095940802658 for ; Wed, 16 Sep 2026 21:24:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@jp.honda header.s=PoD-DKIM-Selector header.b=OKC/b/Aj; dkim=pass header.i=@jp.honda header.s=selector1 header.b=Ay3CRnCf; spf=pass (domain: jp.honda, ip: 148.163.140.78, mailfrom: kazuyoshi_akiyama@jp.honda) Received: from pps.filterd (m0469182.ppops.net [127.0.0.1]) by mx0b-006e0602.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GM08Zj862736; Thu, 17 Sep 2026 04:24:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jp.honda; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PoD-DKIM-Selector; bh=QAnkny+vRvZmp8GC0tk/G2aFR0nnllE/rJemeeZ9/1 4=; b=OKC/b/AjfvPutMNYseDpeO4TIDO3ijXGMbKf5Fke6mZOBoUOFn3+OdtFo2 pWPjM3QsMhcxLNaAR0UikBdrkSpVgaccGH+6DJshxNfkjBReoei5he9h4Z6DSUZ+ nLvUpOfJIOA8298/NAEjQKPRN2uj6+VqaBJy+HF/POdWMLnMQmlOLPylkHswnx57 RaCK8HPp7d9C6J1yJsRNKKF0vsu127ObFcO++nL04WoezTQ82PBTnl4xRjWB8zaU vG+kWWWSvv8f+j+OMuB+1Z40FMmLzrLF7K1eO5YsV9RcJpsfUrQpTrHDVxD2LFbV qMpzl+aCbb9y6PqWZOgTbs9xPlbw== Received: from os0p286cu010.outbound.protection.outlook.com (mail-japanwestazon11011042.outbound.protection.outlook.com [40.107.74.42]) by mx0b-006e0602.pphosted.com (PPS) with ESMTPS id 4gqrrt201y-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 17 Sep 2026 04:24:46 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XEQ0Nt2a4+n1qccKYO6EAoSPb5HuNAcCHirFUaBsRv5G4bfkBAdJ27ZX10XfaJpwJFRjFwTBxTfqu67o1e1ZU4uGSGhyUIFU1O6anoae3igweIONDUXhCLQk/XVssH4Pw0hy0x29dLO61U3sw2YWoKSyjy9ZlpFgh7fUN2J9tDWGQM+6UfH83Gpb/WRzhv35b6zf6K/+z68vjOcDD4fVY8qTBNRyrZRdVZ0EAuod3Wt6plKbcG0bHwPygmmB6Zgj+xuJJqjZpq9NNQFAxKfQl65g3a5J3SPg34s2KEHjSnLyNLS6kr17hOb7sYo4XN7RniDOl2e9KjqUX/ryuo/lng== 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=QAnkny+vRvZmp8GC0tk/G2aFR0nnllE/rJemeeZ9/14=; b=lzzCfz553JK5tktOEjht90GrKX5/3YulAB7H/oRzMLzE94zhPLxCcMtXaekV9Qk1sXhnGERZ3MRvG5RaoDwgFC8koS/VXIDscFdmiUUldLiudlZjmEwEqwgAWXro/ZNA579hJNpDtA6UZ9oFivrMhbdNrI62jdmUbiVYN3TF40ASaIo/0fjOw4ZRTuCH97OeQiCKA4uNIYVjS5wPLU3gzmiVJ4mw6Fq7UAGMgJFhGe27QYugEgVvDOD7VGzh22wudJFWeZflwN1+Oh6/YapxErUqHRoCTqFQ5KVgzWefnRtqj38rQFxk1m3vqD+Cvi803tM0cpCpoeYJw0SMVolXVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 103.113.246.104) smtp.rcpttodomain=bootlin.com smtp.mailfrom=jp.honda; dmarc=pass (p=none sp=none pct=100) action=none header.from=jp.honda; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jp.honda; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QAnkny+vRvZmp8GC0tk/G2aFR0nnllE/rJemeeZ9/14=; b=Ay3CRnCfbcKaNc4Yv7ie2YNI8fXee3d4a1YS//GpWPIYRyIUefAP9/9KmuImKXR3OosIFcfV4Eha026cWY7IMjgV83XEtqutdiMNJ+6R26j8ZVMAFYKCvZrWSeA5LmB0gLzvcPEjNPuGLVkslHwH9BuP1Cbvh/zw6M/RDWQt9rQmyvzBljwC7zIIOQWFRDVzSzMV1dFuDBGKJz++2RGJhDEFYb8uzl8ST5zkL/FY2LyYGpAhpvhwD1jHeEJfygMC1mPeGpuYsdvLQDETMFMKp0ivKQP12HkwOw1l6NPDkjMg20NhEeCPQ7SinHJXPChq50cY2MkThLb4HtT+U933qQ== Received: from OS7PR01CA0235.jpnprd01.prod.outlook.com (2603:1096:604:25d::7) by OS9P301MB1565.JPNP301.PROD.OUTLOOK.COM (2603:1096:604:3ff::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.12; Thu, 17 Sep 2026 04:24:42 +0000 Received: from OS1PEPF0000D210.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:25d:cafe::d) by OS7PR01CA0235.outlook.office365.com (2603:1096:604:25d::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.11 via Frontend Transport; Thu, 17 Sep 2026 04:24:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 103.113.246.104) smtp.mailfrom=jp.honda; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=jp.honda; Received-SPF: Pass (protection.outlook.com: domain of jp.honda designates 103.113.246.104 as permitted sender) receiver=protection.outlook.com; client-ip=103.113.246.104; helo=JPPFSMTPS02.hm.jp.honda.com; pr=C Received: from JPPFSMTPS02.hm.jp.honda.com (103.113.246.104) by OS1PEPF0000D210.mail.protection.outlook.com (10.167.240.39) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Thu, 17 Sep 2026 04:24:40 +0000 Received: from JPPFSMTPS12.hm.jp.honda.com (unknown [10.127.161.38]) by JPPFSMTPS02.hm.jp.honda.com (Postfix) with ESMTPS id 901C6D000656; Thu, 17 Sep 2026 13:24:40 +0900 (JST) Received: from srdserv1.hm.jp.honda.com (srdserv1.hm.jp.honda.com [10.121.66.58]) by JPPFSMTPS12.hm.jp.honda.com (Postfix) with ESMTPS id 8B65EA3A0CC; Thu, 17 Sep 2026 13:24:40 +0900 (JST) Received: from RL25041301.jpn.mds.honda.com ([10.109.174.205]) by srdserv1.hm.jp.honda.com (8.14.4/8.14.4) with ESMTP id 68H4Oeh4028153; Thu, 17 Sep 2026 13:24:40 +0900 From: kazuyoshi_akiyama@jp.honda Date: Thu, 17 Sep 2026 13:24:39 +0900 Subject: [PATCH wrynose 1/4] spdx_common: simplify get_patched_src() implementation MIME-Version: 1.0 Message-Id: <20260917-backport-wrynose-v1-1-bb7d640c2719@jp.honda> References: <20260917-backport-wrynose-v1-0-bb7d640c2719@jp.honda> In-Reply-To: <20260917-backport-wrynose-v1-0-bb7d640c2719@jp.honda> To: openembedded-core@lists.openembedded.org Cc: Kazuyoshi Akiyama , Benjamin Robin , Richard Purdie X-Mailer: b4 0.16.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D210:EE_|OS9P301MB1565:EE_ X-MS-Office365-Filtering-Correlation-Id: eed4db31-e484-403e-757c-08df147397b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|1800799024|36860700016|82310400026|6133799003|10067099003|56012099006|11063799006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: y5XLls89P6Amwc0XJJk7yc/adXQnhHvOwFZ71c3MGTPjyx9DJD6SdrP8hcdxQ7xtTdxaPPLf/R+3DXCsUtiixlwUuZ7dmY6IeFgP0Vu6nYltg3h1NmgRgtFRRE+Zx91v8j1lBvO+YtaMj2QQeqQz5g4pqmjANux9uwKlVin7M6G8Y+GZieaFPDTRYaUIF6eXIJzOnoOTSF98mODCFkk0VQLD0dCldxNYUiE9nFN9kiUSK1ImAZv7aVezDxSqAUgHpq/dRCscFXAe2lQKZmYxVaGgtNrbTNAocWHwTO9hYmWHHsNUAcA0x2Jc/erOGBs73oAZdnw3UaG/rKjvv3FoPJu2oeMs1aiKMDxXvzjqw7F3tb88uvEFF8geZaC3AfLsZ2YLIE6yDV4pH8AMr7sx/SUIWNzJtfoAXO6SGeGOP8Rn72XSlHfpDccE87HQpN6eD2GMI8lM/Biuw7k6qOu4wTH0nQPBZXaxJmjl/xeMNsszno0rZarUbfYkp7RStoEetvpl/BXWY1Wxw2JEHqgXnpJKrcXR1tLnHlqup24C0q4mNj7JKI09+MSMQfMy3YsHUlNx/zMciHgGsTtBdj750n/xi6F8nEcAUV9ZbJqGqV1g8DFNScvPsLCfzp1WWQroO5IRexx1HNEoelujfgLllcdsNuUEoqLvTTx7N8WF0BT0GIFFvVn3FoJXe1Ctb2l/TQ1LEPnW8LIOmtQGzTY/kg== X-Forefront-Antispam-Report: CIP:103.113.246.104;CTRY:JP;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:JPPFSMTPS02.hm.jp.honda.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(36860700016)(82310400026)(6133799003)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sefomI5UEPNt2GycnpLAfXHcZLgeC/ISZWgsvwjF+hM/7j2XRYIFgI/N1+8GJJoHclQ2VRR1RXBW0XQUE+DGj3Quc4Hrp+cNGRILC10oi3kSOJbIrLS+a+4qBZPinUyWlO2m8FCBUqIJOSPRjAA9+0rZ+n1qCzwGZHPHgJbrAfTbpgd0SenToxiaRShaBjTMu92c1PZglj7N5vskZRKDVM71vaCyurtra9b+PiYmNh9kFceU0iDCf6pDztxBLu1x2+ESz5IXgNX5vWab8LceUlkb4gg1PcXijgmai3HV7/BAmTbUTQTV3rxo7QHiWaOmBtmWXd5Q5ZG0Q7b/ofTsIvnD8SzO/PsaR0ZzcI/qRQU3Or4LkLpD9lfxeU6Fe1vbUimDo433kLv/NzB1l8MJSBREy+OyA116Y0PClJwnMWBO3aQkaudFDjo+xd4+IIS8 X-Exchange-RoutingPolicyChecked: SMpiho3/G07N4p2QbHvrAJ5u5hpLy4uiqtOsyRDtqJgJcuFu8t8Rb/G8DSUQM8LTIoS3UKugSDzWRUF69bROMp3JYm9r2h01F/8l4hK8UFBI28d2pQfP4v26iyqTRkiuH7HguZD8cD5pZR82s+/oo/tqs3xF+NGkbn3taWrB3/uo8gq2+6gGFQjVIGjv2/iNxviq8Pl2zNY+wyHxNiGzyycRfO4a6furBbHSrjTcVklXAsGPpVQ8YWxZYD7wU8kAJf/jC85OoIjJy8DhtlonLwVe9oDHd8nZ+hN2v7GI+xeAyOq6qaRTtq6Term3mzIdqlQ+z1ilgBJbn0QVKgbcPw== X-OriginatorOrg: jp.honda X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2026 04:24:40.8191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eed4db31-e484-403e-757c-08df147397b3 X-MS-Exchange-CrossTenant-Id: cc138ffb-9c4d-433b-b211-d4549ae62e8b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=cc138ffb-9c4d-433b-b211-d4549ae62e8b;Ip=[103.113.246.104];Helo=[JPPFSMTPS02.hm.jp.honda.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D210.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P301MB1565 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 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, 17 Sep 2026 04:25:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246005 From: Benjamin Robin The behavior remains unchanged: - Instead of saving and restoring the values of various variables, use a copy of the data store via `d.createCopy()`. This prevents side effects for other tasks. - This allows removing the `try ... finally` block. - The function `is_work_shared_spdx()` no longer needs to be called twice. - In the work-shared case, there is no need to modify `WORKDIR` since no task is executed from that branch. Signed-off-by: Benjamin Robin Signed-off-by: Richard Purdie (cherry picked from commit e0bf8e7c5be3d87376a6c2aab5aca07fd0813763) Signed-off-by: Kazuyoshi Akiyama --- meta/lib/oe/spdx_common.py | 81 ++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/meta/lib/oe/spdx_common.py b/meta/lib/oe/spdx_common.py index 6b1a409c40..9d1e22629b 100644 --- a/meta/lib/oe/spdx_common.py +++ b/meta/lib/oe/spdx_common.py @@ -172,50 +172,47 @@ def get_patched_src(d): Save patched source of the recipe in SPDX_WORKDIR. """ spdx_workdir = d.getVar("SPDXWORK") - spdx_sysroot_native = d.getVar("STAGING_DIR_NATIVE") - workdir = d.getVar("WORKDIR") + # The kernel class functions require it to be on work-shared, so we don't change WORKDIR + if not is_work_shared_spdx(d): + spdx_sysroot_native = d.getVar("STAGING_DIR_NATIVE") + localdata = d.createCopy() - try: - # The kernel class functions require it to be on work-shared, so we dont change WORKDIR - if not is_work_shared_spdx(d): - # Change the WORKDIR to make do_unpack do_patch run in another dir. - d.setVar("WORKDIR", spdx_workdir) - # Restore the original path to recipe's native sysroot (it's relative to WORKDIR). - d.setVar("STAGING_DIR_NATIVE", spdx_sysroot_native) - - # The changed 'WORKDIR' also caused 'B' changed, create dir 'B' for the - # possibly requiring of the following tasks (such as some recipes's - # do_patch required 'B' existed). - bb.utils.mkdirhier(d.getVar("B")) - - bb.build.exec_func("do_unpack", d) - - if d.getVar("SRC_URI") != "": - if bb.data.inherits_class("dos2unix", d): - bb.build.exec_func("do_convert_crlf_to_lf", d) - bb.build.exec_func("do_patch", d) - - # Copy source from work-share to spdx_workdir - if is_work_shared_spdx(d): - share_src = d.getVar("S") - d.setVar("WORKDIR", spdx_workdir) - d.setVar("STAGING_DIR_NATIVE", spdx_sysroot_native) - # Copy source to ${SPDXWORK}, same basename dir of ${S}; - src_dir = spdx_workdir + "/" + os.path.basename(share_src) - # For kernel souce, rename suffix dir 'kernel-source' - # to ${BP} (${BPN}-${PV}) - if bb.data.inherits_class("kernel", d): - src_dir = spdx_workdir + "/" + d.getVar("BP") - - bb.note(f"copyhardlinktree {share_src} to {src_dir}") - oe.path.copyhardlinktree(share_src, src_dir) - - # Some userland has no source. - if not os.path.exists(spdx_workdir): - bb.utils.mkdirhier(spdx_workdir) - finally: - d.setVar("WORKDIR", workdir) + # Change the WORKDIR to make do_unpack do_patch run in another dir. + localdata.setVar("WORKDIR", spdx_workdir) + # Restore the original path to recipe's native sysroot (it's relative to WORKDIR). + localdata.setVar("STAGING_DIR_NATIVE", spdx_sysroot_native) + + # The changed 'WORKDIR' also caused 'B' changed, create dir 'B' for the + # possibly requiring of the following tasks (such as some recipe's + # do_patch required 'B' existed). + bb.utils.mkdirhier(localdata.getVar("B")) + + bb.build.exec_func("do_unpack", localdata) + + if localdata.getVar("SRC_URI") != "": + if bb.data.inherits_class("dos2unix", localdata): + bb.build.exec_func("do_convert_crlf_to_lf", localdata) + bb.build.exec_func("do_patch", localdata) + + # Copy source from work-shared to spdx_workdir + else: + share_src = d.getVar("S") + + if bb.data.inherits_class("kernel", d): + # For kernel source, rename suffix dir 'kernel-source' to ${BP} (${BPN}-${PV}) + dir_name = d.getVar("BP") + else: + # Copy source to ${SPDXWORK}, same basename dir of ${S} + dir_name = os.path.basename(share_src) + + src_dir = f"{spdx_workdir}/{dir_name}" + bb.note(f"copyhardlinktree {share_src} to {src_dir}") + oe.path.copyhardlinktree(share_src, src_dir) + + # Some userland has no source. + if not os.path.exists(spdx_workdir): + bb.utils.mkdirhier(spdx_workdir) def has_task(d, task): From patchwork Thu Sep 17 04:24:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S0FaVVlPU0hJIEFLSVlBTUEgKOeni+WxsSDlkozmhbYp?= X-Patchwork-Id: 98500 X-Patchwork-Delegate: yoann.congal@smile.fr 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 937C1C982CF for ; Thu, 17 Sep 2026 04:25:05 +0000 (UTC) Received: from mx0b-006e0602.pphosted.com (mx0b-006e0602.pphosted.com [148.163.140.78]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.32197.1789619094977010414 for ; Wed, 16 Sep 2026 21:24:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@jp.honda header.s=PoD-DKIM-Selector header.b=h4et8faJ; dkim=pass header.i=@jp.honda header.s=selector1 header.b=pIm2ruCn; spf=pass (domain: jp.honda, ip: 148.163.140.78, mailfrom: kazuyoshi_akiyama@jp.honda) Received: from pps.filterd (m0469181.ppops.net [127.0.0.1]) by mx0b-006e0602.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H0fBNa2283088; Thu, 17 Sep 2026 04:24:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jp.honda; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PoD-DKIM-Selector; bh=tA/fbX++5QMNwGh9MwQPID1L988TVA5Ll8/8/RNy8j I=; b=h4et8faJ9EANG8k+4Snye2qEOlYDlltITkB2AyM0axyrRtGUmU6v28WqZR Igctl13TPRybfBYNMDY9VzRRKUkakFqPtFrIWr/X0FN6I8FZ6BBTf7BajkNqaZ1D 4tDlkKVI++1TJVsQrYMd2tAsbyPst8+8y28OchKD4MsjJhGrvJM/yq7blfui0OJv WpAVRxs6itR/usb1tO29YCCsUHMy3gqiTZ+ZSHaTIBTbR9RwFtmr9PYSTGoo9tlh 8aWYxBV+YhbPKbe+ukagMDDP/ebAzDq860T9MZthqcp5mmpjMm5MGBNurU3vm/BQ tpWEIjdztsLnwppcLlxJhQPhyYiA== Received: from tyvp286cu001.outbound.protection.outlook.com (mail-japaneastazon11011017.outbound.protection.outlook.com [52.101.125.17]) by mx0b-006e0602.pphosted.com (PPS) with ESMTPS id 4gr5vk8tm2-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 17 Sep 2026 04:24:45 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tVCJfpgI2nGU/Ow8POuZfJGtZe6hzuZ3w/NnblxjMg3mOfjT/VKSR/pwEpzGNHrciUV7yDYvE3ItnXyD8Z/i7WqjzkSN1D0jI7VTec9m3vBzzEsz5+ExIxBMRe6Z6Fa2ja0BCow3GDI+jprnmQ7OS9oG8/7cMyR/pOz4+W0egOD0hdFokveu8mCrc6AoopoJJFcFXxwCnbLtBlvPCuYTovMaDM7zPkS07mZuyftQeHVzFVvMU1ITmE0SHndK493mX/h/Ri1OTPfBE21frc3sA0YUVf2VE3ubAkDtpwZkiqyOFHEqOPuMnqg8VmaHiEem5FMxc6JiUvV1SKUDfdzY6w== 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=tA/fbX++5QMNwGh9MwQPID1L988TVA5Ll8/8/RNy8jI=; b=TgSqc186o2qHxpT4aAq5mZTNvWCG6IiUEB5DNhI8AAW0m49UprRvy2OsJbRsmY2ZbOB25vAV+UaBrGkuQ3IlnT3T4XQTwIYbCtfN8I3ZLReA+cglqUjifU3P2mpwkykQ2ghdCYyfDdfv5hXndok6usbM0rvsND0dVuynhH9h6QA868IAd17R+wQw16f500Q8tiAnUmvn0irWwXy77Wz+N8nke5sY9K7DZC6hKyNKUP+oDITX7QH/4mjmg0FLVR6K4sJ56lrm/e1WhDxuasjPWNp3GNiNj+ppYj63++CylN2JjJt6Bj0KZEt3YezximMojFO/jYXg2vS43tNErSxEoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 103.113.246.103) smtp.rcpttodomain=bootlin.com smtp.mailfrom=jp.honda; dmarc=pass (p=none sp=none pct=100) action=none header.from=jp.honda; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jp.honda; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tA/fbX++5QMNwGh9MwQPID1L988TVA5Ll8/8/RNy8jI=; b=pIm2ruCnG6uL/NeRkDDzALzXT8ko/TXwvTlrpfO/9KBWCDZ9VpmBoXy5REG1Zd7cOurkt2yJXPCnpc1fhQbC2tyI/xlrx9LAlB/zCXxW2loqf9i6lmYy1C01aqr7JYioG80mmt+K05t9U702fYO9ft+Y/il7wxsUqQhEKcPVsWfPxZ4fkXPbnf0JPGa7eRisw4wDy1NY/VBQEI0MVowAzTZrvWFUSpLruN3dL8oFx+QHUS5ke6K4qtjwdWnVEdk2TnsCBLmI9diBs07pr7yko+sX+2DmgYaE1pUCNDDGA8qu0tCS/KuLbH5u+nGEbb87Vxj9oVy/tgfgWlYC1gb7og== Received: from OS0P286CA0061.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:9f::12) by TYTP301MB1073.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:186::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.12; Thu, 17 Sep 2026 04:24:42 +0000 Received: from OS1PEPF0000D20E.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:9f:cafe::a1) by OS0P286CA0061.outlook.office365.com (2603:1096:604:9f::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.11 via Frontend Transport; Thu, 17 Sep 2026 04:24:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 103.113.246.103) smtp.mailfrom=jp.honda; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=jp.honda; Received-SPF: Pass (protection.outlook.com: domain of jp.honda designates 103.113.246.103 as permitted sender) receiver=protection.outlook.com; client-ip=103.113.246.103; helo=JPPFSMTPS01.hm.jp.honda.com; pr=C Received: from JPPFSMTPS01.hm.jp.honda.com (103.113.246.103) by OS1PEPF0000D20E.mail.protection.outlook.com (10.167.240.37) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Thu, 17 Sep 2026 04:24:40 +0000 Received: from JPPFSMTPS11.hm.jp.honda.com (unknown [10.127.161.37]) by JPPFSMTPS01.hm.jp.honda.com (Postfix) with ESMTPS id B1417933F22; Thu, 17 Sep 2026 13:24:40 +0900 (JST) Received: from srdserv1.hm.jp.honda.com (srdserv1.hm.jp.honda.com [10.121.66.58]) by JPPFSMTPS11.hm.jp.honda.com (Postfix) with ESMTPS id A31B44000083; Thu, 17 Sep 2026 13:24:40 +0900 (JST) Received: from RL25041301.jpn.mds.honda.com ([10.109.174.205]) by srdserv1.hm.jp.honda.com (8.14.4/8.14.4) with ESMTP id 68H4Oeh5028153; Thu, 17 Sep 2026 13:24:40 +0900 From: kazuyoshi_akiyama@jp.honda Date: Thu, 17 Sep 2026 13:24:40 +0900 Subject: [PATCH wrynose 2/4] spdx_common: modify UNPACKDIR instead of WORKDIR in get_patched_src() MIME-Version: 1.0 Message-Id: <20260917-backport-wrynose-v1-2-bb7d640c2719@jp.honda> References: <20260917-backport-wrynose-v1-0-bb7d640c2719@jp.honda> In-Reply-To: <20260917-backport-wrynose-v1-0-bb7d640c2719@jp.honda> To: openembedded-core@lists.openembedded.org Cc: Kazuyoshi Akiyama , Benjamin Robin , Richard Purdie X-Mailer: b4 0.16.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D20E:EE_|TYTP301MB1073:EE_ X-MS-Office365-Filtering-Correlation-Id: 904e1b6e-aa8f-4d82-f81d-08df147397b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|23010399003|1800799024|376014|3023799007|10067099003|6133799003|22082099003|18002099003|11063799006|56012099006; X-Microsoft-Antispam-Message-Info: 6b+th6d2Z/8ar6g2PPzW7+sgdPjvaSBxmo8Z/KcjdgjlLXjFE6nO76SVXd1DgjdHexHPTX9hMf39jiAJHtQmSqZd4JYYqbIUKa70KVubabXUAkojyvv8YgMIh8CFeQ/BJYzKc2SZ+2uasXX71x6NnA6WR5nD/+uEZad5Imybgt1zBqWUwFnkVOPSIPVy5o/OHC+ydIier2V1WBVQ9lywL7oF5pcNWv3ablT9qtsyngUJw9O6H65Q8DbyjaMszTsaEfGHhr24vQaQBqAAgkasuZPAH48QQ+bJ4Dknp4atdvn5JcYCQB+Fn4mzPNg2IcMCCAmdihyiJYdj4QDxl5PabPf5nyLWQkWogpl5GaAh2iboC1c1ND/9x7nzk09ZOzKEec+DEHNs3j5ynSz26enRGVdjdO0OnEx5UhNCay8Eru58OM0mobqgceKDWV8OtYizusa8RaPwaQY0Rsx2N5pNTs12aAqrDHjFkJWo4L9J8MIs11E1229lpE+MxOhZ0h8ejbQgjbtlJFYh5gl/7Qtk52cy9oKTmoiqFX3MK5FwrALAr+nj4/MJ7PvXgA3P5tZE5gjn5tuZpse/N7XiVecdLG5vcDS7BhIz/l0Os8UeeDswPz18m1H9PaAI3ghjE/d/ImPMOIE4jKWHrlZ7mVeBaKhF4dtgpbB3mJzx9LCK/z8233qCeyZVpWq7EMK2G/544XJ50xoB1IWuFW7WgLwk5A== X-Forefront-Antispam-Report: CIP:103.113.246.103;CTRY:JP;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:JPPFSMTPS01.hm.jp.honda.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(23010399003)(1800799024)(376014)(3023799007)(10067099003)(6133799003)(22082099003)(18002099003)(11063799006)(56012099006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dUd13e6A6LTIHrnXaLpTm43QlkkVuEAHTybqRVz2SyYwXPQNR2r96tRPCnBAzshvt6KcZ6X+ajw2lxPnnh0OFjLW/ZQvosjYC9eknDBOwDN5acxNIkhICQDMt0fo9+lkWozPVJvYe37UoLP8lq+iorfxSn83uP5KX0MJ5yubfzLNAz4rewSAcL0Y1jD6q/Mdj8DBcZ13IS6DpLQLEIfHvcJNbETVe/3nFu7QVVjEyl6+hBBVNJwFYMK5lZbEmAP3AyQsxqxwKiiTQgYdpXwMD/pkvf4vslRO7tSVr6KbRkm/KhQWU3qBiTgE94aYjXOEZm+5v58iGk7fzPoB3NTxNGzW+oQhxO82KLRpXj8Q+BRdd2DdHWP+SWWjP2BbaN4zO4yahXIQyzO2b/AYsv6ajBuhxiJ5sBcGD5oEnufU77x4vk+HPSyNoajrFru30+l/ X-Exchange-RoutingPolicyChecked: bNkvvkSiMdepo0Z4h2N7B5DTzWMcsKfTvjOmLAFxAoNblKlA5tqQmerHi+pwKCBUCmicsR/6BUkmAto1Sj3WFF9+1oVc3lqptG5NjxrTiMGkW4bueQC1BV9ymuJMvbciBOkoOKsrNPhyzldMxN5gkHRblXg/sdTF0MdLh8TLOEpQRMi5kCbM7vrh+dMuRxAaLHXoxx5plD91n1WlmKzFBqRqhMhGTHJnwhPcsGN3ySxTA/D8tOHSPPOp/SZDpu6xQdJ/6KJWQmRPwujQWCBBlnfd6OSR7JrKl58Fa0Hnk3C4EfLSI1Ep8fpW/aEdmEu8fZ4B/LJkztuRIMGQvXUSzg== X-OriginatorOrg: jp.honda X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2026 04:24:40.8602 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 904e1b6e-aa8f-4d82-f81d-08df147397b9 X-MS-Exchange-CrossTenant-Id: cc138ffb-9c4d-433b-b211-d4549ae62e8b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=cc138ffb-9c4d-433b-b211-d4549ae62e8b;Ip=[103.113.246.103];Helo=[JPPFSMTPS01.hm.jp.honda.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D20E.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYTP301MB1073 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 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, 17 Sep 2026 04:25:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246003 From: Benjamin Robin This change will affect the SPDX output: the source file path will no longer be prefixed by `sources/`. The rest of the changes are safe because: - `S` should reference `UNPACKDIR` and not directly reference `WORKDIR`. - After analyzing all public layers, no `do_unpack()` or `do_patch()` was found to reference the `${B}` variable. The comment mentioning the `${B}` variable traces back to [1] (though no further explanation was provided). Additionally, this ensures proper capture of sources if the recipe modifies `UNPACKDIR` outside of `WORKDIR` (though such cases should be rare). With these changes, SPDXWORK is no longer a working directory which is "temporary" replacing WORKDIR, it is now a "temporary" directory containing unpacked source files. The run.do_patch.XXXX and associated files are now stored in ${WORKDIR}/temp. [1] https://github.com/doubleopen-io/meta-doubleopen/blob/ e84f0c32663da9c743e4f1802042b733df0e36d7/classes/doubleopen.bbclass#L285 Signed-off-by: Benjamin Robin Signed-off-by: Richard Purdie (cherry picked from commit aa44a0f0eb5e260959ebd77f439a5d25b3c1aa2a) Signed-off-by: Kazuyoshi Akiyama --- meta/lib/oe/spdx30_tasks.py | 1 - meta/lib/oe/spdx_common.py | 18 +++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py index 1821dd7de4..862e57c3d1 100644 --- a/meta/lib/oe/spdx30_tasks.py +++ b/meta/lib/oe/spdx30_tasks.py @@ -873,7 +873,6 @@ def create_spdx(d): lambda filepath: [oe.spdx30.software_SoftwarePurpose.source], license_data, ignore_dirs=[".git"], - ignore_top_level_dirs=["temp"], archive=None, ) build_inputs |= files diff --git a/meta/lib/oe/spdx_common.py b/meta/lib/oe/spdx_common.py index 9d1e22629b..013f23ae7c 100644 --- a/meta/lib/oe/spdx_common.py +++ b/meta/lib/oe/spdx_common.py @@ -169,28 +169,20 @@ def collect_package_providers(d, direct_deps): def get_patched_src(d): """ - Save patched source of the recipe in SPDX_WORKDIR. + Save patched source of the recipe in SPDXWORK. """ spdx_workdir = d.getVar("SPDXWORK") - # The kernel class functions require it to be on work-shared, so we don't change WORKDIR + # Do not unpack the sources again for the recipe using work-shared if not is_work_shared_spdx(d): - spdx_sysroot_native = d.getVar("STAGING_DIR_NATIVE") localdata = d.createCopy() - # Change the WORKDIR to make do_unpack do_patch run in another dir. - localdata.setVar("WORKDIR", spdx_workdir) - # Restore the original path to recipe's native sysroot (it's relative to WORKDIR). - localdata.setVar("STAGING_DIR_NATIVE", spdx_sysroot_native) - - # The changed 'WORKDIR' also caused 'B' changed, create dir 'B' for the - # possibly requiring of the following tasks (such as some recipe's - # do_patch required 'B' existed). - bb.utils.mkdirhier(localdata.getVar("B")) + # Change the UNPACKDIR to make do_unpack do_patch run in another dir. + localdata.setVar("UNPACKDIR", spdx_workdir) bb.build.exec_func("do_unpack", localdata) - if localdata.getVar("SRC_URI") != "": + if localdata.getVar("SRC_URI"): if bb.data.inherits_class("dos2unix", localdata): bb.build.exec_func("do_convert_crlf_to_lf", localdata) bb.build.exec_func("do_patch", localdata) From patchwork Thu Sep 17 04:24:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S0FaVVlPU0hJIEFLSVlBTUEgKOeni+WxsSDlkozmhbYp?= X-Patchwork-Id: 98501 X-Patchwork-Delegate: yoann.congal@smile.fr 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 D2544C982C1 for ; Thu, 17 Sep 2026 04:25:05 +0000 (UTC) Received: from mx0b-006e0602.pphosted.com (mx0b-006e0602.pphosted.com [148.163.140.78]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.32196.1789619094959792499 for ; Wed, 16 Sep 2026 21:24:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@jp.honda header.s=PoD-DKIM-Selector header.b=kW5W7nz1; dkim=pass header.i=@jp.honda header.s=selector1 header.b=Ok2Pqeml; spf=pass (domain: jp.honda, ip: 148.163.140.78, mailfrom: kazuyoshi_akiyama@jp.honda) Received: from pps.filterd (m0469181.ppops.net [127.0.0.1]) by mx0b-006e0602.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H0f1Rj2282625; Thu, 17 Sep 2026 04:24:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jp.honda; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PoD-DKIM-Selector; bh=8ZR7TC5rpaM+Fwv2p+RavXMbwCkx5ll1Of0nA5Y9+L 0=; b=kW5W7nz1OXZBHPhqXXLuku1M3aoQRi0e5bebSZR4PFgdWWKzw+c2idJvI0 iHm8jPm3mchk8rOtmjzUkhI7sgtJ3Iz+EjjFRH1J8FnBIE/+72UOPyplQI+dtsGH 9Nc53Fn1sM+PxLwql9ZQ1qVFkOPjJuk6Ib5P4emaImZQVhahGJ1KFOdePuHcbpYX OuZ0owNY89gt9cY9qZyiILSfr4hZtB3CcEkAdaNQiHKMsuNCeCPru1nyd66RzsVb nVhc4irgm3m3J/RCZldz8e6kD/1F/OaQRwSKrbKW2V9/xGfWuoMroLrlFG1orqPw bt92PEF6fPs0eLKH3HJwI8R9gkXw== Received: from tyvp286cu001.outbound.protection.outlook.com (mail-japaneastazon11011024.outbound.protection.outlook.com [52.101.125.24]) by mx0b-006e0602.pphosted.com (PPS) with ESMTPS id 4gr5vk8tm3-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 17 Sep 2026 04:24:46 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gGj2YhNtwNG24XAVPnd2Hg0qZ3swz1tvwqVErU1SUU91OHFRcpH/rMLZ/wSkxpz1ZM+Zc4bF0I7T+xWf4n/fr1jekZLSdILoZuSnqjbaCpZnP2b5bvdluJ7XXMmXtBSJgQzdGTcjAJLnJWc85N4gFAiLILgRihNZ1lD+r0/1dzshjA8hbrvwKeZxzl09N09wc4e3uuXogHys3FtcAvoUv05ZwAymj2r4amxucVFqkyn70ZsKC0OpOrleIcucH+lek8djR/f95PBv8AH6Huf62U4/Zy6NAyaul0LtBpP7n+NZ/vfJS0upjz2M1FZL+iuv96+ogDVY73EZ5tvs8Rn8+g== 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=8ZR7TC5rpaM+Fwv2p+RavXMbwCkx5ll1Of0nA5Y9+L0=; b=Xe8gSW25/oK43Gkr90TmKjClo13850ICdemgmm2C7FTnvljCjGkXSFH0HhsdoHhOF9/RNSP637DDgqFQMPcYSaWB7fEdV4fazr217Xv7f8TVD5CqShIDdQTC+/7bqSo2NG8g4AyaMlPpbJTxswgV19Sn+AyDzeRSVmf/lpdif2aDcXL9WJ5Wn+tvuONQutuSRBNW9fRY200OzLwfLTBOgwGpE7LBb7L5YLcIqk1kziyN0bZLlyGVsEhFBXGzAA17Cd6qhyWYG/7g7P4Eyzxz4Jx7GWh5ACz21HRcO6BVDEbkR4jttPueYSwyaK0r3lcAa2iTFhe/g92WkSHmkRXatQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 202.74.253.75) smtp.rcpttodomain=bootlin.com smtp.mailfrom=jp.honda; dmarc=pass (p=none sp=none pct=100) action=none header.from=jp.honda; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jp.honda; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8ZR7TC5rpaM+Fwv2p+RavXMbwCkx5ll1Of0nA5Y9+L0=; b=Ok2Pqemlno/8RZCuGoY1xv2mm1fdyhxGBdBbLPk90R4FpVwmgdAOlaF425GT1hIg/eFjjnOnUtOc0N29l1RmAu82q6V3crFDrXjnCvudZvWiPn8ss3w7Q24TlNVf/DrcePKWElswegmRuyCqGeqJeuk0w+PkiTxGsctHYhFYkM+JM6RI0fSzUDkV7g+QTuQhI4GFUHYeJtRJK1E5ZkWCdzqFMOgiKCRK5Fcciiusq2aIPI+Vq5IXHCOLMKwX93WINvIYLQpO2sDUsZkc1kglwdyHXFbuqqfRax+eDmQUOJd7IXgelPLVExSjS4NuhMUz5wVXLPu4Rwa2xg0y82McdQ== Received: from TYCP286CA0035.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::8) by OSOP301MB1935.JPNP301.PROD.OUTLOOK.COM (2603:1096:604:468::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.12; Thu, 17 Sep 2026 04:24:41 +0000 Received: from TYO1EPF00005023.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d:cafe::37) by TYCP286CA0035.outlook.office365.com (2603:1096:400:29d::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.11 via Frontend Transport; Thu, 17 Sep 2026 04:24:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 202.74.253.75) smtp.mailfrom=jp.honda; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=jp.honda; Received-SPF: Pass (protection.outlook.com: domain of jp.honda designates 202.74.253.75 as permitted sender) receiver=protection.outlook.com; client-ip=202.74.253.75; helo=JPPFSMTPY01.hm.jp.honda.com; pr=C Received: from JPPFSMTPY01.hm.jp.honda.com (202.74.253.75) by TYO1EPF00005023.mail.protection.outlook.com (10.167.240.20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Thu, 17 Sep 2026 04:24:40 +0000 Received: from JPPFSMTPY11.hm.jp.honda.com (unknown [10.126.162.186]) by JPPFSMTPY01.hm.jp.honda.com (Postfix) with ESMTPS id C0C0310000645; Thu, 17 Sep 2026 13:24:40 +0900 (JST) Received: from srdserv1.hm.jp.honda.com (srdserv1.hm.jp.honda.com [10.121.66.58]) by JPPFSMTPY11.hm.jp.honda.com (Postfix) with ESMTPS id BE01510F6723; Thu, 17 Sep 2026 13:24:40 +0900 (JST) Received: from RL25041301.jpn.mds.honda.com ([10.109.174.205]) by srdserv1.hm.jp.honda.com (8.14.4/8.14.4) with ESMTP id 68H4Oeh6028153; Thu, 17 Sep 2026 13:24:40 +0900 From: kazuyoshi_akiyama@jp.honda Date: Thu, 17 Sep 2026 13:24:41 +0900 Subject: [PATCH wrynose 3/4] spdx_common: In get_patched_src() ensure kernel dir name to be ${BP} MIME-Version: 1.0 Message-Id: <20260917-backport-wrynose-v1-3-bb7d640c2719@jp.honda> References: <20260917-backport-wrynose-v1-0-bb7d640c2719@jp.honda> In-Reply-To: <20260917-backport-wrynose-v1-0-bb7d640c2719@jp.honda> To: openembedded-core@lists.openembedded.org Cc: Kazuyoshi Akiyama , Benjamin Robin , Richard Purdie X-Mailer: b4 0.16.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYO1EPF00005023:EE_|OSOP301MB1935:EE_ X-MS-Office365-Filtering-Correlation-Id: c5a12db4-e247-4150-56d8-08df147397be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|1800799024|82310400026|376014|36860700016|22082099003|18002099003|13003099007|3023799007|11063799006|10067099003|56012099006; X-Microsoft-Antispam-Message-Info: brkwU/zbIJAyrK3CKX10fFeJN+5j79msSs6lUjM3s3gv6uKhTlNNVB6bHW9wGDCiyAX3Csbr4shgZFC4CcQthTgJmdpfoXL/xPVxeQQCjA/6puCMcdEhjNqEZBtWmOzvlEW9zAODh0rGRFMWGzRK8zHe2f0cLr0OCvBTetl3qMLaXNpiGA3HHHr58dRkO2kdhGE0V5qN6yub772c2Bt7M65MzcpTDO7UHBnn8p7XnoVkFqpiRGacEx7gB0EJRcex70oqRZIBT0AAwBJpkVCUpNueZXhwzOvDCr7/KYyGIaqDOVQ7YYpZ46AO0zCN1zEG6wMFAsWlu/fszgAQipD+F+Mwh+ZtQHkfiODJVi+Y4m80TYgrRqq0PS3GdbZ4mYbrS1IZybm9cJtUc7+NPIBqwoBOvYghrK4aELCcFcu0WgSBiVWUQ8vu0BgyTAUh/dh0aD4sWKwt574eRSLkApjAfFF5tIRBYDOFuh2+xyBHLrtntaSRWDOfk2yAy0lhEMIszxALKNY6jwRsNvvkbm1YAK35osOeNiW0CTJApRC6QYSYaCAa/uKDH6aNu1TuQrRr9O92IW0wfEJe8C69cRXtSch1U6nfRC9i/SBi+ej/NIUO+blWtQa3fnsJMgGw/x59IL29/asVAf0pMZKbjfS8heNbhSZIJLP51rp+IBWeUMfbo/oB/OaqM8cZINrBi4lw X-Forefront-Antispam-Report: CIP:202.74.253.75;CTRY:JP;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:JPPFSMTPY01.hm.jp.honda.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(82310400026)(376014)(36860700016)(22082099003)(18002099003)(13003099007)(3023799007)(11063799006)(10067099003)(56012099006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +Rsq3TG+F9S/79NkA6EqmYNC7LcWwM0b0ROoUm+cPBbNkygFBz2Uk+d9CUneUprsmmqivliRIUfU2RGPKwTRdPSzGLzOIGyVNxSJPNhqMzw2XfaDBvXSkzCT6JjCt+t2DZRL1gvNw7Mb5Dz43ShuY2wfb08edzPyrMpxwpCaChdwb9I8JQ3ntsn0FL9yVrkXIVgImugJ8D92Lclt2e4EB5gTpL3+lw2CBKA3jMZRHw6OH04uo5z4ne0ipE8v4cYbEDKXFcxQnjIBk0Vuo66G2bRpbNl/zOGyh3eemvW6nSjMG16XaHiwpZVT/jfFyp5/dviLo0uE46Cc4zi3ygXG/tiE7/vhZ09hbt3gAxYgB+ackH3r2feejDP0diZ8fkoWppvW+crZBc4Ls3oDCTUPt90cdJiWG1gxk9GVkyahQ2R/rXEmYR7XFybN3LcwquKs X-Exchange-RoutingPolicyChecked: VFJO5XToAqtU35P5gyQ97PF3nh1hGQq1cswPyEnFEtyJe/Ie3Iu6zWNkayioV7Txz/zEMbGcWQxcdHLFhrV9y50dYaedotwVTebwWLKmfQ8bRAc1AuNcX44KSqa8e7BTLX9UXbhiTtp29rFYwge/jvLpWisMo/vv7h6g6DA3jgNhDN0lk7pkRRPL/G9J15qLDgZBQt58Ke1b73+C9z5x7lEnsjR17WTrZaRGWnROw4pkWc0gFuQxRnwpuEWzJu+gVtnodBmEM6W1miOgMJDicHAqNvsrFjjCPGJ7efTdIPjHlKs06Okc9RW0TzpfhF4j6B8IDgzNjUHwoBnb4T3neQ== X-OriginatorOrg: jp.honda X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2026 04:24:40.9038 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5a12db4-e247-4150-56d8-08df147397be X-MS-Exchange-CrossTenant-Id: cc138ffb-9c4d-433b-b211-d4549ae62e8b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=cc138ffb-9c4d-433b-b211-d4549ae62e8b;Ip=[202.74.253.75];Helo=[JPPFSMTPY01.hm.jp.honda.com] X-MS-Exchange-CrossTenant-AuthSource: TYO1EPF00005023.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSOP301MB1935 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 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, 17 Sep 2026 04:25:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246004 From: Benjamin Robin If a kernel recipe is using a tar file instead of git repository, it is necessary to override `S` to point to the unpacked tar archive. In this case `${S}` is not going to be in work-shared. So we must handle this case in get_patched_src() to ensure that the kernel is extracted in the following path: `${SPDXWORK}/${BP}`. For a full detailed analysis see [1], but in summary this change is necessary because: - In `save_debugsources_info()` the sources are extracted from the debug symbol. For the kernel Linux the source file path is modified to look like `${BP}/init/main.c` (`${KERNEL_SRC_PATH}` is replaced by `${BP}`). - In `get_patched_src()` the sources of the recipe are extracted (again) in a sub-directory of `${SPDXWORK}`. If `${S}` is in work-shared and if the recipe inherits the kernel class, then the sources are extracted in `${SPDXWORK}/${BP}`. - In `add_package_files()`, with topdir equal to `${SPDXWORK}`, all the files (recursively) found in topdir are listed. For each source file, if the file path (relative to topdir) is in the list of source files retrieved by save_debugsources_info, then the file is added to the SPDX SBoM. - If we are using a tar archive, `${S}` is set for example to `${UNPACKDIR}/linux-${PV}`, so in `get_patched_src()` the sources are extracted in `${SPDXWORK}/sources/linux-${PV}` since `UNPACKDIR = ${WORKDIR}/sources`. `${BP}/init/main.c` is not in `${SPDXWORK}`, but `sources/linux-${PV}/init/main.c` is. [1] https://github.com/bootlin/yocto-kiss/pull/26#discussion_r3626224833 Signed-off-by: Benjamin Robin Signed-off-by: Richard Purdie (cherry picked from commit 9bb9763c4c857edfc64aa2ad189a78a4bfb0c897) Signed-off-by: Kazuyoshi Akiyama --- meta/lib/oe/spdx_common.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meta/lib/oe/spdx_common.py b/meta/lib/oe/spdx_common.py index 013f23ae7c..e40cf36bba 100644 --- a/meta/lib/oe/spdx_common.py +++ b/meta/lib/oe/spdx_common.py @@ -187,6 +187,14 @@ def get_patched_src(d): bb.build.exec_func("do_convert_crlf_to_lf", localdata) bb.build.exec_func("do_patch", localdata) + if bb.data.inherits_class("kernel", localdata): + # For kernel source, rename suffix dir to ${BP} (${BPN}-${PV}) + dir_name = localdata.getVar("BP") + kernel_dst_path = f"{spdx_workdir}/{dir_name}" + kernel_src_path = localdata.getVar("S") + if not os.path.exists(kernel_dst_path): + shutil.move(kernel_src_path, kernel_dst_path) + # Copy source from work-shared to spdx_workdir else: share_src = d.getVar("S") From patchwork Thu Sep 17 04:24:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S0FaVVlPU0hJIEFLSVlBTUEgKOeni+WxsSDlkozmhbYp?= X-Patchwork-Id: 98502 X-Patchwork-Delegate: yoann.congal@smile.fr 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 EF34BC982D2 for ; Thu, 17 Sep 2026 04:25:05 +0000 (UTC) Received: from mx0b-006e0602.pphosted.com (mx0b-006e0602.pphosted.com [148.163.140.78]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.32199.1789619095981094663 for ; Wed, 16 Sep 2026 21:24:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@jp.honda header.s=PoD-DKIM-Selector header.b=Us/kk4gg; dkim=pass header.i=@jp.honda header.s=selector1 header.b=cDMzutke; spf=pass (domain: jp.honda, ip: 148.163.140.78, mailfrom: kazuyoshi_akiyama@jp.honda) Received: from pps.filterd (m0469177.ppops.net [127.0.0.1]) by mx0b-006e0602.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GMwE6f1670600; Thu, 17 Sep 2026 04:24:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jp.honda; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PoD-DKIM-Selector; bh=Vj8GoE15dit6sTjVL84LmdE2NmP6TFKOM98dXiCxKB 4=; b=Us/kk4ggx0X5FxjqtLb1ziNPeDghnzcYSgmnwHu9zJHJO0qGW7El9y6v0P HC9r/oP+FCsDSxKCFZmAweaeNqnAk4/3XyuWHDp5hRzYZG5RA+uhzW4S06n0ejU7 zvr16bvQZF+I4xwjpj15qguBtObHc52bbPdQ4a5yv9WQ7B2w7FjhjudWUBlaIF7m f/MFyKNn89tdRx6Bh0rd4IM+aqu7LUm5Pw5rx6B2vTx+1HqKfB234liCvr4uCE5X o2pREPIfqoYoRd8URFYVofqTly2oNerzE5pmoSS/A3ZvdF0EaFuvTJ2UA/1VLKEZ HSO0LE+1Sb8Zris+0rKPgMFZwABg== Received: from tyvp286cu001.outbound.protection.outlook.com (mail-japaneastazon11011020.outbound.protection.outlook.com [52.101.125.20]) by mx0b-006e0602.pphosted.com (PPS) with ESMTPS id 4gr3yj173q-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 17 Sep 2026 04:24:46 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TP3+ZCOwVY1AP8CXmbOIxOJniP+HUbEVVY27hfdHt7bJDLApzQFacvwhTfhnuAqM0IkCEtWuUG64RMulwOW45+jE3pPfRf/v7Lbi881vMvHh1Lmn2s04OUmXZT+RyDDGoQlphMms+ClkF9SXhvdbn/1T4r+p5En54IPeLyDo3oeqMok0rL6bgyUf22OQE6HxfH74k+RWWvumaCIkmEHwhC9OUMoTA76P309LgfeHndiP36NrtMEPtx/953K5/sPWNQAuS2AvvD667DP5P5bICSXxTKM6VrUYrqbn7p5RMcrAMgMZNuFYY4Uw9wTbjHYFhcSh1skLCVDjKy18xEGWPA== 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=Vj8GoE15dit6sTjVL84LmdE2NmP6TFKOM98dXiCxKB4=; b=niKuvGBJAxjQSpRol4ItisTY/419TA0OmQT+fiP+tznLLNd3+wge1Oy3kBg9/JJn4CzhBhjEPKO2+KfVOS3uUebKHs/D/tomf6bES+3pw4gjaXt/N0MxL4rrmHqU1VBKpwb4JedzFmZKoDQuTaGyhP1wnAoSAp6hlx3QYVSTQm4bNsEDoeMbVnyFYTY2JGISzvqKy2OcDO7UjOcrMghMEfFXJfLPzUlbalrLAC1Srm9e+muTBxoz9GQ2o6tM2G8rrDO3h8C2WmYB5cc8dpolOEJu7MGXnhekgzbQXhXyJ7fRmbNspI7X3P1uAoSCONImKJJjprXjf/GwYYfUhs1dhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 103.113.246.104) smtp.rcpttodomain=bootlin.com smtp.mailfrom=jp.honda; dmarc=pass (p=none sp=none pct=100) action=none header.from=jp.honda; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jp.honda; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vj8GoE15dit6sTjVL84LmdE2NmP6TFKOM98dXiCxKB4=; b=cDMzutkemtKjlyy6j1avzy13l+YLyyBZRXwyKMwi5wrSZaXs8hvh6n89fwwb7fvkbpTbRzb6YxRBFrBTFCTO5i+w0bYIMQvolcLATqwFFwkA/5Pgsf09vtee8jZwf1jtrzQWrlizU2jD+kcntBn6w4iJKwlFW4hG05JvBgCRxNbQr9jV2Aij//bc5ee30/+MuEuigknVFvhGyxyccDJ2dL9/5UEPSpJJxzrOszq3JkvZSE2oTO/SuFVqCb9O0x+kb8te1sKrkvlxTI7zqooyjyE1+P9mBK2XXkIjtOGpINe3DEvNQeSw8hkvrjJ1lqXnabQghTJ5fazQ+WcODhTRTQ== Received: from OS3P286CA0081.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:1f6::7) by TY4P301MB1692.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:332::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.12; Thu, 17 Sep 2026 04:24:42 +0000 Received: from OS1PEPF0000D215.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:1f6:cafe::32) by OS3P286CA0081.outlook.office365.com (2603:1096:604:1f6::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.11 via Frontend Transport; Thu, 17 Sep 2026 04:24:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 103.113.246.104) smtp.mailfrom=jp.honda; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=jp.honda; Received-SPF: Pass (protection.outlook.com: domain of jp.honda designates 103.113.246.104 as permitted sender) receiver=protection.outlook.com; client-ip=103.113.246.104; helo=JPPFSMTPS02.hm.jp.honda.com; pr=C Received: from JPPFSMTPS02.hm.jp.honda.com (103.113.246.104) by OS1PEPF0000D215.mail.protection.outlook.com (10.167.240.22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Thu, 17 Sep 2026 04:24:41 +0000 Received: from JPPFSMTPS12.hm.jp.honda.com (unknown [10.127.161.38]) by JPPFSMTPS02.hm.jp.honda.com (Postfix) with ESMTPS id E2C15D00064B; Thu, 17 Sep 2026 13:24:40 +0900 (JST) Received: from srdserv1.hm.jp.honda.com (srdserv1.hm.jp.honda.com [10.121.66.58]) by JPPFSMTPS12.hm.jp.honda.com (Postfix) with ESMTPS id DE723A3A0CC; Thu, 17 Sep 2026 13:24:40 +0900 (JST) Received: from RL25041301.jpn.mds.honda.com ([10.109.174.205]) by srdserv1.hm.jp.honda.com (8.14.4/8.14.4) with ESMTP id 68H4Oeh7028153; Thu, 17 Sep 2026 13:24:40 +0900 From: kazuyoshi_akiyama@jp.honda Date: Thu, 17 Sep 2026 13:24:42 +0900 Subject: [PATCH wrynose 4/4] package: no longer modify paths in save_debugsources_info() MIME-Version: 1.0 Message-Id: <20260917-backport-wrynose-v1-4-bb7d640c2719@jp.honda> References: <20260917-backport-wrynose-v1-0-bb7d640c2719@jp.honda> In-Reply-To: <20260917-backport-wrynose-v1-0-bb7d640c2719@jp.honda> To: openembedded-core@lists.openembedded.org Cc: Kazuyoshi Akiyama , Benjamin Robin , Mathieu Dubois-Briand , Richard Purdie X-Mailer: b4 0.16.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D215:EE_|TY4P301MB1692:EE_ X-MS-Office365-Filtering-Correlation-Id: bf6eaa2a-62c8-43d2-3900-08df147397d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|23010399003|1800799024|376014|10067099003|6133799003|22082099003|18002099003|11063799006|56012099006|5023799004; X-Microsoft-Antispam-Message-Info: RgZyQ9RwsPGO9waAHCtg+25NlkSobDyKD+rssUWlVZ98+7L47qc5i34452cVnVnlSqw7SirKBnS4Or9iPpPemnx+YZnqCWuhhSHzHpF9OYvZVbezo01AfZhJzX4ugmhcXpehW1Nc+ppn4hYoDEWJi7FUz/Q0WbDh5CPKLH9deIIfe12X4YeyEiFD0tFQ589PpIknZvQoLKFHEztqeNfAwBxj/QvavFFLugPapqkl6gVePhgTtGMrRoWdACizYw8SXTZ040/y6FW3XHeRm3FZsrP7fW55hdt0qhDUH5GXhVmXOxRdEa7jjUShVF9AQqnOMFp4YnU8IldRv+iMrUi+MUxHEd6aYVj8MSHI6nFrpKGDQMKo+eivS0TSW4mbdXKmD7F7ciVV4MC9PP/2/mUfW/+5W8KFnakcldFTcd83VcXGw9szfbWgjYcc/SQOHuxBFs1BUk56tXN+fk+457Vbi8p9UUwSOhdRVV+pOUwZMxkDbi2YUcVUA5wn5Evg7W4RM9Tup2iX8srbiKpt7jkV/tbJ/uNKr4bbhbyG47+sTVF/WfNrclb4/NBFtL2GCM9eJHsDC5CuoPsjaVRTN9RDfDDFoSpUuLD87jsNk3DB1/kxv05t+F3ZJdoIR/v30IkItjOaLGZW5dJhsulzJgX4Fai7j5Cl2FZ+Z1pXBGmM/Ab88o9GWx56Ztthj2KH3VEbdodwqfuYHazGnHz4deuTRA== X-Forefront-Antispam-Report: CIP:103.113.246.104;CTRY:JP;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:JPPFSMTPS02.hm.jp.honda.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(23010399003)(1800799024)(376014)(10067099003)(6133799003)(22082099003)(18002099003)(11063799006)(56012099006)(5023799004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iN91W7yNOlF2AyuYpa79eZewd4xB4o9jMuoxTMl0elrj2ZXpc8uvPev9wMixMsfgpA2rW1s1yR8+of2XrUfW7N7Uzq3jZybpmBShFCmPm10dzLhHkw48rTVsUr6mOvvpwNuvrD1IPRkhQMCDWZN4CZ6DyHfKpw9NOcqBnNrmck3vyI7snT2P19GVeauV5A37I+ESTjIrFJlUb4EtIJwppZVK156F5RuKhcrs2swF8RvrAK8kBA3YKJdnPNeVbNA/dsenggUQEnP9XALdVtGHFU06+KhGAu4ff8KeuFL7HECbb7Kv6Hg3afyAE9B7B+2uJ4rhLhlS5kh4kP2J/Ru1uotdisYGh+2L8rf34cWLE4ScjDU5ERV/d5Gk/krmgA54FNhJp4JaFxsZfx0qWrO2Esi10DMHBoSEDDO24gatfMpoi/5UrmYSicI5Q9BaNNB4 X-Exchange-RoutingPolicyChecked: XzF6bwm3DRXXMd8ynKqO8Bef6DYDJQ01t/RvAkKl5zX8QsAQwigyZDUyrD3RyJF3kGl7tde5s0FfSGVzuebjzdal7+0djtC2wCNI8GXNnWoyC4mYFOcj7xfhp/HitXPuECNmN/RwkN6qRGidKqOdmapDUiIXhN/7fpJw67Q6e9/K0dSxRyKO1y2rnqncX/kylluRB0C0iDppHQzlnx/ffHeFwgo34Dm31lym7O6Dt4IvWmiIvjwEly6ofCV3mmPQk982Gajb+/duaF26Q0FYVLkEr9otiJXOSg4UZInJ2t/3pWGdPa+r9Fl4LnFc49no3dcJ1tv7rdUT9HKJ5Ma+Rg== X-OriginatorOrg: jp.honda X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2026 04:24:41.0674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf6eaa2a-62c8-43d2-3900-08df147397d9 X-MS-Exchange-CrossTenant-Id: cc138ffb-9c4d-433b-b211-d4549ae62e8b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=cc138ffb-9c4d-433b-b211-d4549ae62e8b;Ip=[103.113.246.104];Helo=[JPPFSMTPS02.hm.jp.honda.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D215.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY4P301MB1692 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 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, 17 Sep 2026 04:25:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246006 From: Benjamin Robin The source files saved in `${PN}-debugsources.json.zstd` are now saved as is: "/usr/src/kernel/" is no longer replaced by "${BP}/". However, the file list is still filtered to exclude "" or "", ... With this modification, the content of `${PN}-debugsources.json.zstd` is no longer specific or tied to SPDX generation. The logic that modified the source file paths to match what SPDX generation expects is now in `oe.spdx_common.get_compiled_sources()`. Furthermore, previously, for all non-kernel recipes the source paths were never "resolved", since the KERNEL_SRC_PATH variable is always defined. So the returned source file paths always started with `/usr/src/debug/${PN}/${PV}` (the value of TARGET_DBGSRC_DIR). Update the source file paths to match what the SPDX generation expects: - In `get_patched_src()`, the sources of the recipe are extracted (again). The unpack task runs in a modified local context with UNPACKDIR set to the value of `${SPDXWORK}`, so the sources end up extracted in a sub-directory of `${SPDXWORK}`. - In `add_package_files()`, all files below topdir, set to `${SPDXWORK}`, are (recursively) listed. For each source file, if its path (relative to topdir) is in the list returned by `get_compiled_sources()`, the file is added to the SPDX SBoM. Handle this by replacing ${TARGET_DBGSRC_DIR} with the relative path of ${S} relative to ${UNPACKDIR}. If ${S} is not relative to ${UNPACKDIR}, do nothing. Signed-off-by: Benjamin Robin Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (cherry picked from commit b567c2f0d91fbf36886d0c3a6f6ea90c07771044) Signed-off-by: Kazuyoshi Akiyama --- meta/lib/oe/package.py | 54 +++++++++++++++++++++------------------------- meta/lib/oe/spdx_common.py | 42 ++++++++++++++++++++++++++++++------ 2 files changed, 61 insertions(+), 35 deletions(-) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index c375acc124..bef3c92a25 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -1060,37 +1060,33 @@ def copydebugsources(debugsrcdir, sources, d): os.rmdir(p) @bb.parse.vardepsexclude("BB_NUMBER_THREADS") -def save_debugsources_info(debugsrcdir, sources_raw, d): +def save_debugsources_info(sources_raw, d): import json import bb.compress.zstd - if debugsrcdir and sources_raw: - debugsources_file = d.expand("${PKGDESTWORK}/debugsources/${PN}-debugsources.json.zstd") - debugsources_dir = os.path.dirname(debugsources_file) - if not os.path.isdir(debugsources_dir): - bb.utils.mkdirhier(debugsources_dir) - bb.utils.remove(debugsources_file) - workdir = d.getVar("WORKDIR") - pn = d.getVar('PN') - - # Kernel sources are in a different directory and are special case - # we format the sources as expected by spdx by replacing /usr/src/kernel/ - # into BP/ - kernel_src = d.getVar('KERNEL_SRC_PATH') - bp = d.getVar('BP') - sources_dict = {} - for file, src_files in sources_raw: - file_clean = file.replace(f"{workdir}/package/","") - sources_clean = [ - src.replace(f"{debugsrcdir}/{pn}/", "") - if not kernel_src else src.replace(f"{kernel_src}/", f"{bp}/") - for src in src_files - if not any(keyword in src for keyword in ("", "")) and not src.endswith("/") - ] - sources_dict[file_clean] = sorted(sources_clean) - num_threads = int(d.getVar("BB_NUMBER_THREADS")) - with bb.compress.zstd.open(debugsources_file, "wt", encoding="utf-8", num_threads=num_threads) as f: - json.dump(sources_dict, f, sort_keys=True) + if not sources_raw: + return + + debugsources_file = d.expand("${PKGDESTWORK}/debugsources/${PN}-debugsources.json.zstd") + debugsources_dir = os.path.dirname(debugsources_file) + if not os.path.isdir(debugsources_dir): + bb.utils.mkdirhier(debugsources_dir) + bb.utils.remove(debugsources_file) + + workdir = d.getVar("WORKDIR") + + def _filter_src_file(src): + if src.endswith("/"): + return False + return not any(keyword in src for keyword in ("", "")) + + sources_dict = {} + for file, src_files in sources_raw: + file_clean = file.replace(f"{workdir}/package/", "") + sources_dict[file_clean] = sorted(filter(_filter_src_file, src_files)) + num_threads = int(d.getVar("BB_NUMBER_THREADS")) + with bb.compress.zstd.open(debugsources_file, "wt", encoding="utf-8", num_threads=num_threads) as f: + json.dump(sources_dict, f, sort_keys=True) @bb.parse.vardepsexclude("BB_NUMBER_THREADS") def read_debugsources_info(d): @@ -1337,7 +1333,7 @@ def process_split_and_strip_files(d): copydebugsources(dv["srcdir"], sources, d) # Save source info to be accessible to other tasks - save_debugsources_info(dv["srcdir"], results, d) + save_debugsources_info(results, d) # # End of debug splitting # diff --git a/meta/lib/oe/spdx_common.py b/meta/lib/oe/spdx_common.py index e40cf36bba..f885f1832a 100644 --- a/meta/lib/oe/spdx_common.py +++ b/meta/lib/oe/spdx_common.py @@ -277,14 +277,44 @@ def get_compiled_sources(d): bb.debug(1, "Do not have debugsources.list. Skipping") return [], [] - # Sources are not split now in SPDX, so we aggregate them - sources = set(itertools.chain.from_iterable(source_info.values())) - # Check extensions of files + unpackdir = d.getVar("UNPACKDIR") + srcdir = d.getVar("S") + bp = d.getVar("BP") + kernel_src = d.getVar("KERNEL_SRC_PATH") + dbgsrc_dir = d.getVar("TARGET_DBGSRC_DIR") + + # Compute the relative path of source directory from ${UNPACKDIR}. + # The goal is to replace ${TARGET_DBGSRC_DIR} by this relative path. + srcdir_rel = None + if srcdir and unpackdir: + srcdir_rel = os.path.relpath(srcdir, unpackdir) + if srcdir_rel.startswith(".."): + srcdir_rel = None + + sources = set() types = set() - for src in sources: + + # Sources are not split now in SPDX, so we aggregate them + for src in set(itertools.chain.from_iterable(source_info.values())): + # In the common case, the sources are located in ${S}. To format them as + # expected by SPDX, we replace /usr/src/debug/${PN}/${PV} with the path + # of ${S} relative to ${UNPACKDIR}. + if dbgsrc_dir and srcdir_rel: + src = src.replace(f"{dbgsrc_dir}/", f"{srcdir_rel}/") + + # Kernel sources are in a different directory and are special case + # we format the sources as expected by spdx by replacing /usr/src/kernel/ + # into ${BP}/ + if kernel_src and bp: + src = src.replace(f"{kernel_src}/", f"{bp}/") + + sources.add(src) + + # Check extensions of files basename = os.path.basename(src) ext = basename.partition(".")[2] - if ext not in types and ext: + if ext: types.add(ext) - bb.debug(1, f"Num of sources: {len(sources)} and types: {len(types)} {str(types)}") + + bb.debug(1, f"Num of sources: {len(sources)} and types: {len(types)} {types!s}") return sources, types