From patchwork Mon Jun 8 17:52:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 89489 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 48482CD8C9F for ; Mon, 8 Jun 2026 17:53:26 +0000 (UTC) Received: from MRWPR03CU001.outbound.protection.outlook.com (MRWPR03CU001.outbound.protection.outlook.com [40.107.130.32]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.60944.1780941199980528318 for ; Mon, 08 Jun 2026 10:53:20 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=Q9YkEg6F; spf=pass (domain: axis.com, ip: 40.107.130.32, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ivc0i6TaUdbvQCHdkyXoWWGUV5t0Smys8DbqdKmB63izCuguc1YQldzBHmYdmCVLcDr4JEk/No1NR9f+KHxE245J4SmQTotkoU2oInNVX8Q+cXnDIAdKbpMkwFw1UxbfvZq886dU5TlbjZ57ILS9L/ytOPTBJTT5ixdYBwzuUE2dgjGproQyJclCcuJPn1W7Bvw6nmpS2Nda5viJNpkpWgdh+r+jUVKE5AHUdZ+i8QSBS4B5ZMQNHhqQe1Dcc+JG2WavvcHLMXH+44AVNM9WK5TsC8cEXI1QiwnWUBTUwAx6TOw2kGn0nnD4u10yb58vn+xxrtgVHESRCs88iLbdOg== 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=uZtJGEkIZSUGKbsUA8K7478+OWBrY1K+vozAnz9u4Zs=; b=H0IUMa4yunSgaEsnby1mDW+fMvSVfeSeWfREfDd5KYaGoXU1nKS2RWt6GCdzja3DKEKBUh4GvSJMY8TyZJ3q8S9dZwIFhsYtyGGxwxC76pS8t63K0uuDhw4MSJqttIQ2OJBj/EQGequS6SrJlzJlirrxE6azrlp/U0605HtY0ql1AeYPZilPgMco2HyOhZdACAWfo3490SpENR7deTBpiCBPxPKszRVwih2A1Ii+qfaImQK3s3Dw7F2r8EbDn+EijRFmSkt9/+G+AmUs9lTiPNaaA1xFH0uikK6zq0eTyxBCtRHe4LhhRNCkvpIrDnDrQhsvxFHJJhzB9CX0aVj+8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uZtJGEkIZSUGKbsUA8K7478+OWBrY1K+vozAnz9u4Zs=; b=Q9YkEg6FhkVQEkMkm80l1RRfwcgmU2YzvnFj1OF1OltKHToaX/yQ2igbBrtDzxwweUgU4iIltk/Y0m4LpcZYrn+1pCQyOAHROIiS/5aYbp9uXIdwzcWDNTBVBDa9LG0zRE4Re6Upz2McTI+Tx2mgLzGP2rNUsccOwzf9NdOmB2Y= Received: from DUZPR01CA0207.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::9) by VI0PR02MB11116.eurprd02.prod.outlook.com (2603:10a6:800:25a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.14; Mon, 8 Jun 2026 17:53:11 +0000 Received: from DB1PEPF000509F3.eurprd02.prod.outlook.com (2603:10a6:10:4b6:cafe::2e) by DUZPR01CA0207.outlook.office365.com (2603:10a6:10:4b6::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.92.13 via Frontend Transport; Mon, 8 Jun 2026 17:53:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB1PEPF000509F3.mail.protection.outlook.com (10.167.242.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.7 via Frontend Transport; Mon, 8 Jun 2026 17:53:11 +0000 Received: from se-mail10w.axis.com (10.20.40.10) by se-mail10w.axis.com (10.20.40.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.39; Mon, 8 Jun 2026 19:53:10 +0200 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail10w.axis.com (10.20.40.10) with Microsoft SMTP Server id 15.2.1748.39 via Frontend Transport; Mon, 8 Jun 2026 19:53:10 +0200 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 33F001D47 for ; Mon, 8 Jun 2026 19:53:10 +0200 (CEST) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 2ADFC12C4F1; Mon, 8 Jun 2026 19:53:10 +0200 (CEST) From: Peter Kjellerstedt To: Subject: [PATCH 1/3] archiver.bbclass: Properly remove artifacts when configuration changes Date: Mon, 8 Jun 2026 19:52:57 +0200 Message-ID: <20260608175259.3238900-1-pkj@axis.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F3:EE_|VI0PR02MB11116:EE_ X-MS-Office365-Filtering-Correlation-Id: 9307265f-5b80-449b-eab0-08dec586ceb2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700016|376014|82310400026|18002099003|6133799003|11063799006|56012099006|3023799007; X-Microsoft-Antispam-Message-Info: llbqBi5ihy9lAwLkivSbybeCtTRtmHjfHWdm2pzlovcNQj34jEQCQDtLTxbsG+M4b0rDWix2zy+Mv8AVcde5DKbkpw3etNVmHatyLT6GQvxwx3Sk5rwiuFKUxrrakLcSRYzcmMOqzy0lVZiZxaYiyHSKneKSiVjuVbSZWZBjSkdbizfz46UFVILK4nub+iZ7oMUXTzgU5FgQvn0BSkAY+6u6YTBr5li2u90S0QdGxc/Rmev+8Vesg9IhuJle+Aclknk5IJCDQeRlVBymxVbTyQ6Qr3mu5QZzIla77JsWj6oeg+IyPlUXQbP92J+QcQU9lpQ8w17Jv0yWh1UIxPe0A6MQQjhbbd95C/s2A0zhPEgOMawbJI6cvZtF0qol7qpnVvVzdSYTyYB4kagsvVcXz3Y8GVdkNZscc0xLC8xEWbM3iY7CysfT6NML7zW2m/JP1XKldTxb+Y9jLYOva8rpAR9L1QnqZ9PzfiUhEDD4bZDo8vHaOcFRZfkNczR0+2yDmDxL0VbqLi3PTy2Z0wUwB6a/PyW6puOiCvF89+r9K5c85IHHuTJInX3D8XduZ9FCwOwIVJcNdBhk5LmlPjRp4iPHPzOOlU3SVxGUs6eIR4HbpWcWnK46ylONPRFiHvC1TZW+WskVDDOFq0KMeem4qlOyA9eyHtdyoNIm/DHFrWs9VboFlq1le8BD53894HZm0Smq/BLyWWep3lD3mrcCZp4vlv6vIMyZDjB6bxqBbbA= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700016)(376014)(82310400026)(18002099003)(6133799003)(11063799006)(56012099006)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qdVEcECQy2GhCTlVQYFoJUXVTMo0pz3Y/XkE0pZAPSX1q+cXI63b+A0TMfL+C0hf5Fnn2wL4TTJu++hV4xfrnK0ljWmQb+9131a6dvkD01yl3WVs8LJo+8+FmFYWTP377lf/XT5zFeA5PnmrpeDt6DpAkVh2zEoFrGKdErdJFvGofxphnDVVCK1qslDA73qkUVMq6R0doJkaKJT7A+ZRtUY8RzXZhC3d6eoA2k1XPcWkG0JF1gZALf2/zGNcIKUuKKuyKZzBUlAJy1NHaonznpp7gdmvwg7AggJmb7XIJJDzW5mTXoAzc/SuQy93HDUqoz7HLZK9zsGWtI6Odst8ToFIBT0Lr1/LoJhLtLcpB27pCr35A0a7glpcVtRd4MztHHOvs+HMVOpz/gnD4QpL6kMVGZ8DrdyRWxouFLL9g2eD2GKJF6uVUH+OdMKw1k4b X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2026 17:53:11.6814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9307265f-5b80-449b-eab0-08dec586ceb2 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509F3.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR02MB11116 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 08 Jun 2026 17:53:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/238256 Before, the different archiver tasks that produce artifacts would just add to the common output directory. This meant that changing how the archiver is configured would just add more artifacts, but never remove any. E.g., if "dumpdata" was enabled, it would add the environment data for each built recipe to the artifacts. However, if it was then disabled, all the generated artifacts would remain until each recipe was manually cleaned, or the entire tmp directory was removed. This adds a task that cleans the output directory if needed. It is a separate task that all the other archiver tasks depend on because they all write to the same output directory so it must only be cleaned once. This also means it has to depend on all variables that affect any of the other tasks. Signed-off-by: Peter Kjellerstedt --- meta/classes/archiver.bbclass | 27 +++++++++++++---- meta/lib/oeqa/selftest/cases/archiver.py | 38 ++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index 1f1ee45bd7..a3f8689b19 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass @@ -179,6 +179,20 @@ python () { d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn) } +do_ar_prepare[vardeps] += " \ + ARCHIVER_MODE \ + ARCHIVER_MIRROR_EXCLUDE \ + COPYLEFT_LICENSE_EXCLUDE \ + COPYLEFT_LICENSE_INCLUDE \ + COPYLEFT_PN_EXCLUDE \ + COPYLEFT_PN_INCLUDE \ + COPYLEFT_RECIPE_TYPES \ +" +do_ar_prepare[cleandirs] = "${ARCHIVER_TOPDIR}" +do_ar_prepare() { + : +} + # Take all the sources for a recipe and put them in WORKDIR/archiver-work/. # Files in SRC_URI are copied directly, anything that's a directory # (e.g. git repositories) is "unpacked" and then put into a tarball. @@ -609,14 +623,15 @@ do_deploy_archives[sstate-inputdirs] = "${ARCHIVER_TOPDIR}" do_deploy_archives[sstate-outputdirs] = "${DEPLOY_DIR_SRC}" addtask do_deploy_archives_setscene -addtask do_ar_original after do_unpack -addtask do_unpack_and_patch after do_patch do_preconfigure +addtask do_ar_prepare +addtask do_ar_original after do_unpack do_ar_prepare +addtask do_unpack_and_patch after do_patch do_preconfigure do_ar_prepare addtask do_ar_patched after do_unpack_and_patch addtask do_ar_configured after do_unpack_and_patch -addtask do_ar_mirror after do_fetch -addtask do_dumpdata -addtask do_ar_recipe -addtask do_deploy_archives +addtask do_ar_mirror after do_fetch do_ar_prepare +addtask do_dumpdata after do_ar_prepare +addtask do_ar_recipe after do_ar_prepare +addtask do_deploy_archives after do_ar_prepare do_build[recrdeptask] += "do_deploy_archives" do_rootfs[recrdeptask] += "do_deploy_archives" do_populate_sdk[recrdeptask] += "do_deploy_archives" diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py index 82b0293338..872504808a 100644 --- a/meta/lib/oeqa/selftest/cases/archiver.py +++ b/meta/lib/oeqa/selftest/cases/archiver.py @@ -343,3 +343,41 @@ class Archiver(OESelftestTestCase): ]: target_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], 'mirror', target_file_name) self.assertTrue(os.path.exists(target_path)) + + def test_archiver_cleanup(self): + """ + Test that the archiver removes no longer needed artifacts when its + configuration is modified. + """ + + target = 'selftest-ed-native' + target_file_name = 'selftest-ed-native-1.21.1-r0-showdata.dump' + + def assert_dumpdata_present(expect_present): + bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'BUILD_SYS']) + glob_str = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'], '%s-*' % target) + glob_result = glob.glob(glob_str) + self.assertTrue(glob_result, 'Missing archiver directory for %s' % target) + + archive_path = os.path.join(glob_result[0], target_file_name) + if expect_present: + self.assertTrue(os.path.exists(archive_path), + 'Missing archive file %s' % target_file_name) + else: + self.assertFalse(os.path.exists(archive_path), + 'Unexpected archive file %s' % target_file_name) + + features = 'INHERIT += "archiver"\n' + self.write_config(features) + bitbake('-c deploy_archives %s -f' % target) + assert_dumpdata_present(False) + + features += 'ARCHIVER_MODE[dumpdata] = "1"\n' + self.write_config(features) + bitbake('-c deploy_archives %s -f' % target) + assert_dumpdata_present(True) + + features = 'INHERIT += "archiver"\n' + self.write_config(features) + bitbake('-c deploy_archives %s -f' % target) + assert_dumpdata_present(False) From patchwork Mon Jun 8 17:52:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 89490 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 4FB40CD8C9D for ; Mon, 8 Jun 2026 17:53:26 +0000 (UTC) Received: from OSPPR02CU001.outbound.protection.outlook.com (OSPPR02CU001.outbound.protection.outlook.com [40.107.159.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.61035.1780941196451203723 for ; Mon, 08 Jun 2026 10:53:16 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=gJLMOxX9; spf=pass (domain: axis.com, ip: 40.107.159.48, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JyErK1FVXuvdUGAPn5SxMzlq0a2+Uwn3LYhDV++ElXPlTuieXaTirEB6HQLq3wH3UN9WaJtV9GM4gzfXJmB897TeFS5R3OJ6OuFhhI0OOkENJdlsrnFaoCbENXlZtQRlUizlHCB22zS9dAoQLTyeCheIcnSc1JD1XTqtdThvVwKaW5xJ/sRr2U6zTbw0MbCXAlOTc1ouyDRsjJkPLUW/S45G2ekzDVySTBR4eYfOxAoNZPUWjqVEBU+AvsPEdhJPZXKDnhLHx/9wgsJQ0kjdWm9aGBM6kJewG2TWkjkVTaXCUwVWIBS5K1XZ7IYcaiiRTf5vqDpTpUHbBnolnyEafA== 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=yUuHtvlzjzQyKeNAgb3mHbd53v5x9QTBhs45D+XS+0A=; b=WCClJt4V5dY8JaMT5acomWV+X39OchCYNMG04VVIgbAph2ivFWCe1Hvej63DMk3DTYaumxSlKWoaqMta108dzYH9Q4DvecqXzbUAANjsmRB9u2QZCb8VMWe9onvkgxsentyKE7tZr0TbIiQS5nJsGfLiQedBW1dcjyH+8/9X5GwTjwf9hVFHLso9br8KjHsTX5OB+HbeI0YLtZgFZ/xX0L3tZ9ZbjcutCICJPtTcae/3WR8rEOAcFaQGH9S15tz3TTW7stoNCYI+T3Am0w9Xu0h//MPOdYK22/vfHZnNRmpHw3fu7MsiM5MEggMKcM4joqhAMcMzTRXL830XctQxTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yUuHtvlzjzQyKeNAgb3mHbd53v5x9QTBhs45D+XS+0A=; b=gJLMOxX9fO5lHgJf8TpPhAvS/5ErkWQuzG7UiM0fpedkLBGDHitSW9cHHnRkQHsv5zSdkf3/BZUF87V057vN/hrgwmwCDu/W5bMEv74qDFouZ41Ac6z/VdD+UzpdB+flHP9NipekHJOj//DqmvEZUBkV0+ACyENw0JSGrCvmk7I= Received: from DUZPR01CA0193.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::14) by GV1PR02MB11508.eurprd02.prod.outlook.com (2603:10a6:150:283::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.13; Mon, 8 Jun 2026 17:53:11 +0000 Received: from DB1PEPF000509F3.eurprd02.prod.outlook.com (2603:10a6:10:4b6:cafe::6b) by DUZPR01CA0193.outlook.office365.com (2603:10a6:10:4b6::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.92.13 via Frontend Transport; Mon, 8 Jun 2026 17:53:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB1PEPF000509F3.mail.protection.outlook.com (10.167.242.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.7 via Frontend Transport; Mon, 8 Jun 2026 17:53:10 +0000 Received: from se-mail11w.axis.com (10.20.40.11) by se-mail10w.axis.com (10.20.40.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.39; Mon, 8 Jun 2026 19:53:10 +0200 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail11w.axis.com (10.20.40.11) with Microsoft SMTP Server id 15.2.1748.39 via Frontend Transport; Mon, 8 Jun 2026 19:53:10 +0200 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 36EEB3AD6 for ; Mon, 8 Jun 2026 19:53:10 +0200 (CEST) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 2F59C12C4F2; Mon, 8 Jun 2026 19:53:10 +0200 (CEST) From: Peter Kjellerstedt To: Subject: [PATCH 2/3] oeqa/selftest/archiver: Do not run bitbake -c clean unnecessarily Date: Mon, 8 Jun 2026 19:52:58 +0200 Message-ID: <20260608175259.3238900-2-pkj@axis.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260608175259.3238900-1-pkj@axis.com> References: <20260608175259.3238900-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F3:EE_|GV1PR02MB11508:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f57102e-88f8-4814-fd64-08dec586ce1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|82310400026|376014|1800799024|56012099006|11063799006|3023799007|22082099003|18002099003|6133799003; X-Microsoft-Antispam-Message-Info: wDPv33ByI3vW4kRGmggjvKhBEVaxQ+VvCmakRiJ6SUHpfxBkQ0zTCYZUMlbZZRydhDK1+zTP2NOG0gi1RG9LDEthuUVymZzfjpx7GHf1zjMzrfBOk3WZ9mMssPfAfFi0Q0l7fbySc3TEmjf/OWkkUN/k7LsTYwIyIItTOL77zkXFZ93EZ4zKEk3Yaue6imhYEAmv1CdwcjRIr5wLA1Iz8mPfVSs0b4AMvi7MlDa6+BmZ6WVAV3zWuqBrSPzWW2ap8XFSCjGRCYaCHnsnI8727fI0fOoYX/FWJqH2lEtXqhNFM4BiFESxAnpp6ifbOZAdS0f+sFBnhdQ3bllHoW88fKyfHMuC4xWTUB57uCzx0wxk7hHMOH+2n0Jkm2d+dnqfyzl9njXZIGK9XpH+94LKPciS3+nBbfKi3t/MfwppZrPBRqV12ssmF5zHH0HHMz5Cvw2lFGkUvlKj9rcUoqp4Iea3MTYtJuOyPt9PthHl9HgZFxKRfl5ajCY+46RfO9NXEC8JIGhWI1gtp1Ym6QHpSS7w8GiXQlJo58dGHzedJlCIMA8V6WTRzK+y6maulYFEMcW7zKPky0Jz37Xur8s/ifsofw/gpjtXrzJqlddb1dxMMeC7Mu6KwhxaHCNTOZw149i7PcbbbZ1kQKSZp7jBtO9o3negkNguX86B1wah+RtRbNEd6PlkadeWq1PFKw4bTvhA5CJ0ORM67HdAFa+YBiwfd7bZb+ElqK05M1nnGj4= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(82310400026)(376014)(1800799024)(56012099006)(11063799006)(3023799007)(22082099003)(18002099003)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YAAMSzhOBtMLBiT3LDKRTKKRS/rkc9/Esy9h7NaDY/E/EskNzsL40UeVgriJ8dPoVJwK/yF7bh7Ym7usvLFmh+U+a878NM2onSciE2CS0XA3tNNyEIUoHFqPFEYQZOQl8jfEd0wl51jGQpZSwgbySymXD85PlaqFoqT7Y2pxy9nSHTaqrgRDHV0kBSJPCeKF6v5bwsgGO62dx8zs85JElvvM43K8ZRyjFPS92oVc5uO2YmRl/62xV2pZKlcXmh9pW8U6uqhGO/eqzwOSL9Rh8N9c//IJew7JcCXVYlf/D3DWjuSW22SB1bnl+b+FFFps1QDS/p64INUZzB6U2VJ30PNqeNAFg8zZJcvXY/xmfmiNV4p8IiRr6fqQ9MU7/XdBC5cy4SwyiyEdvnveN97HsXD4xnw+wETm9Nl4TSogdXcunbJ8IW5btejEpKRa91OH X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2026 17:53:10.7058 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f57102e-88f8-4814-fd64-08dec586ce1d X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509F3.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR02MB11508 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 08 Jun 2026 17:53:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/238254 Now that the archiver bbclass properly adapts its output based on its configuration, it should no longer be needed to run `bitbake -c clean` before invoking the archiver. There is one exception, which is due to modifying DL_DIR as it does not automatically trigger a re-fetch. Signed-off-by: Peter Kjellerstedt --- meta/lib/oeqa/selftest/cases/archiver.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py index 872504808a..122d16b655 100644 --- a/meta/lib/oeqa/selftest/cases/archiver.py +++ b/meta/lib/oeqa/selftest/cases/archiver.py @@ -31,7 +31,6 @@ class Archiver(OESelftestTestCase): features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % exclude_recipe self.write_config(features) - bitbake('-c clean %s %s' % (include_recipe, exclude_recipe)) bitbake("-c deploy_archives %s %s" % (include_recipe, exclude_recipe)) bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS']) @@ -62,7 +61,6 @@ class Archiver(OESelftestTestCase): features += 'COPYLEFT_RECIPE_TYPES = "target"\n' self.write_config(features) - bitbake('-c clean %s %s' % (target_recipe, native_recipe)) bitbake("%s -c deploy_archives %s" % (target_recipe, native_recipe)) bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS']) @@ -99,7 +97,6 @@ class Archiver(OESelftestTestCase): features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % target_recipes[1] self.write_config(features) - bitbake('-c clean %s %s' % (' '.join(target_recipes), ' '.join(native_recipes))) bitbake('-c deploy_archives %s %s' % (' '.join(target_recipes), ' '.join(native_recipes))) bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS']) @@ -174,7 +171,6 @@ class Archiver(OESelftestTestCase): features += extra_config self.write_config(features) - bitbake('-c clean %s' % (target)) bitbake('-c deploy_archives %s' % (target)) bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'BUILD_SYS']) @@ -255,7 +251,6 @@ class Archiver(OESelftestTestCase): features += 'ARCHIVER_MIRROR_EXCLUDE = "${GNU_MIRROR}"\n' self.write_config(features) - bitbake('-c clean %s' % (target)) bitbake('-c deploy_archives %s' % (target)) bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS']) @@ -281,7 +276,6 @@ class Archiver(OESelftestTestCase): self.write_config(features) for target in ['selftest-ed', 'selftest-hardlink']: - bitbake('-c clean %s' % (target)) bitbake('-c deploy_archives %s' % (target)) bb_vars = get_bb_vars(['DEPLOY_DIR_SRC']) @@ -302,7 +296,6 @@ class Archiver(OESelftestTestCase): features += 'COPYLEFT_LICENSE_INCLUDE = "*"\n' self.write_config(features) - bitbake('-c clean git-submodule-test') bitbake('-c deploy_archives -f git-submodule-test') bb_vars = get_bb_vars(['DEPLOY_DIR_SRC']) @@ -330,6 +323,8 @@ class Archiver(OESelftestTestCase): features += 'DL_DIR = "${TOPDIR}/downloads-shallow"\n' self.write_config(features) + # Clean the build directory so that fetch is rerun. + # This is needed due to modifying DL_DIR. bitbake('-c clean git-submodule-test') bitbake('-c deploy_archives -f git-submodule-test') From patchwork Mon Jun 8 17:52:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 89491 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 5D6D9CD8CA4 for ; Mon, 8 Jun 2026 17:53:26 +0000 (UTC) Received: from OSPPR02CU001.outbound.protection.outlook.com (OSPPR02CU001.outbound.protection.outlook.com [40.107.159.15]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.60943.1780941198237319574 for ; Mon, 08 Jun 2026 10:53:18 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=AKUD7bHx; spf=pass (domain: axis.com, ip: 40.107.159.15, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nBU9zU9s/eOIFF1PiCrIXOCmEdNi4eeh/zfRBLVvGiethSTwpCgVxbbZ79SELqHl0Zt+GPAW4PSos6GVAKqNo94WyUrf03gnm1OxV0xncNS1gb9XVbzSeknVMv806OCoaeM/RXtfcv0Sfim3pSyXpu+JHYNM4IL0Z2L/e4bkdmVZaQH6brf+cBBRuDCJ48FJzApfIQfLxu3h8eN1UYSba5OXbefS3CjoQCUpUPFOjTuEJ84N3TvG6nD5I0ekmf1SUl4H4TWT9XvtfS2L+52PiKQQ+no2kJeUG38xM1ewMrsQUhyN3DtWI+oZ8yWZWFPVBgpYzzATfmWZX+waFep81Q== 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=4SDzR1YJX/ISKo3jd7uM1/ziFDsM3gfCg9XBr/xcKKM=; b=Uruyu5fu2ZJmxeNgOgYRmCs2M8KtcqbOJujRxyhspuRRHS0dgCj3nBUwyNA/rukCdOxc3jtTHG/eM6M8I+bn5pM9g5YfMWsHFm5MCleVb3nmmfiM4asdi6n9NXVC+IxqEbE3uXX1x3KIs0MwkWsj3g812LsHK1slGd/8fyhweUC/IsWFI8xVLw6B3GSCfwcirlYJmRGnZmcGqA8P8flQnww+w71iuCMDSsAMR47ZeYfJFtUya1jEW7K/icrcnpGaXozKa2YutQ6QK4dL2xceWAaXH87cgRg5fc+L+n8i6vqc4ueBhZlZZWxBk0RY7vA1wfVvfU3f8rcuZ3SWdCc7bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4SDzR1YJX/ISKo3jd7uM1/ziFDsM3gfCg9XBr/xcKKM=; b=AKUD7bHxdYfcFve9YOOCJeOzePygHx05pZ8r7FqblKleO7ieSR8LTw+NgTxbG0puIIlxj3I4gKWXBNnrURqBKFvg6yz9tZ+BSawMloNh74uPfCMCzPTNXJAP6kiUGJArQ56WJcJWU3c19Dlo4vU3NKrMazqoPBIxP8vVMmgb44E= Received: from DUZPR01CA0192.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::15) by DU5PR02MB10906.eurprd02.prod.outlook.com (2603:10a6:10:51b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.12; Mon, 8 Jun 2026 17:53:12 +0000 Received: from DB1PEPF000509F3.eurprd02.prod.outlook.com (2603:10a6:10:4b6:cafe::9c) by DUZPR01CA0192.outlook.office365.com (2603:10a6:10:4b6::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.92.13 via Frontend Transport; Mon, 8 Jun 2026 17:53:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB1PEPF000509F3.mail.protection.outlook.com (10.167.242.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.7 via Frontend Transport; Mon, 8 Jun 2026 17:53:12 +0000 Received: from SE-MAILARCH01W.axis.com (10.20.40.15) by se-mail10w.axis.com (10.20.40.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1748.39; Mon, 8 Jun 2026 19:53:10 +0200 Received: from se-mail10w.axis.com (10.20.40.10) by SE-MAILARCH01W.axis.com (10.20.40.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Mon, 8 Jun 2026 19:53:10 +0200 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail10w.axis.com (10.20.40.10) with Microsoft SMTP Server id 15.2.1748.39 via Frontend Transport; Mon, 8 Jun 2026 19:53:10 +0200 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 351FF1DCB for ; Mon, 8 Jun 2026 19:53:10 +0200 (CEST) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 2E60112C4AC; Mon, 8 Jun 2026 19:53:10 +0200 (CEST) From: Peter Kjellerstedt To: Subject: [PATCH 3/3] archiver.bbclass: Add ARCHIVER_MIRROR_INCLUDE Date: Mon, 8 Jun 2026 19:52:59 +0200 Message-ID: <20260608175259.3238900-3-pkj@axis.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260608175259.3238900-1-pkj@axis.com> References: <20260608175259.3238900-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F3:EE_|DU5PR02MB10906:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b8d15d4-0f51-4637-094d-08dec586cefe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|1800799024|82310400026|376014|13003099007|18002099003|22082099003|11063799006|56012099006; X-Microsoft-Antispam-Message-Info: EhUInc+WH1XO3+TqJpk+VEayY5Ax5tECuocyDqfaL0AzcjoAhR6Y65t+3LYlFnHrDCvxueWIFAWH5IBFrOkGweFPMgXSinXWt7jRmbtDpzfTM5smlerStzzHY6xEI6gGGOuag1KUf1XDtQFB72Zhzbf+MltpvIefYMgaMawyPGuE+hrl1yEuZc4bJEFiJAJd3/Wl68+ccj+XuNKmUm2nkV3lGOQ+hT6jhgq3A5r37jA0j4ac+MME6K0gUvF1Ai9OXuXnY84DW5fiLK1Rl+mLPtStVjP81FPxLHfCYI/wDkj5w7qqAoCmG5/Mv8DT1Xo+I4jAjTqVEfUXgCSPiYN5LPpewMlWY0M2iITee0Otky4WvOzTNK2ntCJpfuenW47hW9aGPmaqsWX+aVprZxzPHVZ3OC2kwmSrw7J4+A3sl2hqh1lLmUM7VnM11hIz66ki9PZRIk2+KYNalZsfDFpt1Z5ehMkjcVl4iYVa8n1OwGvjTeXWjvDLooyjH98NtuVaD+LivIu8q3IM5QiyaP7TYm2d5uo0qqwkh2hhsueThKD8XMvD2oN2BZPRSD/3aZk0GHTvRRoQq9LRZg2kRr6DPmqF41HfOLAUZy8WGxYEIvAVkYuqKsKb4uNtiZ4JlO7idJN7lzkhT5XUYAb5n7NGFo0d9BQxFOS22NslVmsNCsht6y4clabApj7ApOb5DWjX X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(1800799024)(82310400026)(376014)(13003099007)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7ARaco4qsHeVbmlrJmJNmpWcnAsOs7QtqwSsO9vDHUUo+vogxAwkpmRRgKtqumAoFQp2fdj35LBSM2WHOW8vjz9qYVHQaYzyBvN14k498CqFzn7Era3vBqiaWx4ip7erkXgsIUo0dojlAkxBNztQZO/2sAjI4/I1+T30tkOA9nk2cOII40oJzb81p7QpN400IPmEeP+03VtpGFk8XRzxBwmqxI9xUJnR6wFwifk9o997ZqFUhvbCiooTc+qhL0ez01p2ZtlItvNjJF7H2tEligTXjZpCfl03QqVX0ZRZck3+4X2fAPLKWwgD9ysxV+z7X5Ubm1Tny5iaeXmF7SnaNu7M2Zu48Do49Eixdn3/u1iwMBGj5F/5AiOSZ35KB3H1Mjqfg+yGclJsdvrRopY5BH/93a+3RdTl586785gCfyp++V+s9UymxpxYlx/IU/a4 X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2026 17:53:12.1742 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b8d15d4-0f51-4637-094d-08dec586cefe X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509F3.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU5PR02MB10906 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 08 Jun 2026 17:53:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/238255 When using the archiver's mirror mode, ARCHIVER_MIRROR_INCLUDE contains a list of URI prefixes to always include in the mirror. This may be useful if recipes that are included in the mirror (due to their licenses) depend on some recipe that otherwise would not be included in the mirror, and that recipe uses files that are normally only available on a private server. Signed-off-by: Peter Kjellerstedt --- meta/classes/archiver.bbclass | 37 ++++++++++++++++++++++-- meta/lib/oeqa/selftest/cases/archiver.py | 24 +++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index a3f8689b19..035d0dce0f 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass @@ -35,7 +35,13 @@ # ARCHIVER_MODE[mirror] = "combined": All sources are placed into a single # directory suitable for direct use as a mirror. Duplicate sources are # ignored. -# 12) Source mirror exclusions: +# 12) Source mirror inclusions: +# ARCHIVER_MIRROR_INCLUDE is a list of URI prefixes to always include in +# the mirror. This may be useful if recipes that are included in the mirror +# (due to their licenses) depend on some recipe that otherwise would not be +# included in the mirror, and that recipe uses files that are normally only +# available on a private server. +# 13) Source mirror exclusions: # ARCHIVER_MIRROR_EXCLUDE is a list of prefixes to exclude from the mirror. # This may be used for sources which you are already publishing yourself # (e.g. if the URI starts with 'https://mysite.com/' and your mirror is @@ -77,8 +83,9 @@ do_ar_original[dirs] = "${ARCHIVER_OUTDIR} ${ARCHIVER_WORKDIR}" # This is a convenience for the shell script to use it def include_package(d, pn): - - included, reason = copyleft_should_include(d) + included, reason = archiver_should_include(d) + if not included: + included, reason = copyleft_should_include(d) if not included: bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason)) return False @@ -99,6 +106,29 @@ def include_package(d, pn): return True +def archiver_should_include(d): + ar_src = d.getVarFlag('ARCHIVER_MODE', 'src') + if ar_src == "mirror": + src_uri = (d.getVar('SRC_URI') or '').split() + if len(src_uri) == 0: + return False, None + + mirror_inclusions = (d.getVar('ARCHIVER_MIRROR_INCLUDE') or '').split() + + def is_included(url): + for prefix in mirror_inclusions: + if url.startswith(prefix): + return True + return False + + fetcher = bb.fetch2.Fetch(src_uri, d) + + for ud in fetcher.expanded_urldata(): + if is_included(ud.url): + return True, "URL matches ARCHIVER_MIRROR_INCLUDE" + + return False, None + python () { pn = d.getVar('PN') assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split() @@ -182,6 +212,7 @@ python () { do_ar_prepare[vardeps] += " \ ARCHIVER_MODE \ ARCHIVER_MIRROR_EXCLUDE \ + ARCHIVER_MIRROR_INCLUDE \ COPYLEFT_LICENSE_EXCLUDE \ COPYLEFT_LICENSE_INCLUDE \ COPYLEFT_PN_EXCLUDE \ diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py index 122d16b655..e9f178d5c9 100644 --- a/meta/lib/oeqa/selftest/cases/archiver.py +++ b/meta/lib/oeqa/selftest/cases/archiver.py @@ -261,6 +261,30 @@ class Archiver(OESelftestTestCase): archive_path = os.path.join(glob_result[0], target_file_name) self.assertFalse(os.path.exists(archive_path), 'Failed to exclude archive file %s' % (target_file_name)) + def test_archiver_mode_mirror_include(self): + """ + Test that `ARCHIVER_MIRROR_INCLUDE` causes a source URL to be included + in the mirror even when the recipe would otherwise be excluded by the + copyleft license filter. + """ + + target = 'selftest-ed' + target_file_name = 'ed-1.21.1.tar.lz' + + features = 'INHERIT += "archiver"\n' + features += 'ARCHIVER_MODE[src] = "mirror"\n' + features += 'ARCHIVER_MODE[mirror] = "combined"\n' + features += 'BB_GENERATE_MIRROR_TARBALLS = "1"\n' + features += 'COPYLEFT_LICENSE_INCLUDE = "CLOSED"\n' + features += 'ARCHIVER_MIRROR_INCLUDE = "${GNU_MIRROR}"\n' + self.write_config(features) + + bitbake('-c deploy_archives %s' % (target)) + + bb_vars = get_bb_vars(['DEPLOY_DIR_SRC']) + target_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], 'mirror', target_file_name) + self.assertTrue(os.path.exists(target_path), 'Missing archive file %s' % (target_file_name)) + def test_archiver_mode_mirror_combined(self): """ Test that the archiver works with `ARCHIVER_MODE[src] = "mirror"`