From patchwork Tue Sep 8 20:10:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 97643 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 9E245C79F82 for ; Tue, 8 Sep 2026 20:10:20 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.951.1788898212797377546 for ; Tue, 08 Sep 2026 13:10:13 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=sH9tKZct; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6044D1476 for ; Tue, 8 Sep 2026 13:10:08 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B9E723F7B4 for ; Tue, 8 Sep 2026 13:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1788898212; bh=Fm/LZRx2vaDomUQ0SOU/HrxOhVz6aaCMPUCH8TRUhJg=; h=From:To:Subject:Date:From; b=sH9tKZctHSxsu70KEe6EZDusLnvbdEHm8TunyXdHK+KpPb/dFhx8bC3yEBOFjucok 1W9eb0itGhP1mka6TWP3YZ54dQopsSWN7RFlpSCOkrG7qJ9Kv5CsA3SZ3T7gm4H1Uq FCaCzPQvdEkyF672alzBXfqRwv5OkK5Bsxhef36w= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH v2] classes/python_hatchling: remove empty site-packages workaround Date: Tue, 8 Sep 2026 21:10:08 +0100 Message-ID: <20260908201008.3855510-1-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 08 Sep 2026 20:10:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/245388 Back in 2023 there were random failures from empty directories in the python site-packages directory, which at the time was believed to be specific to hatchling and so worked around in this build class[1]. This is not the case, but changes to hatchling and upgrades would result in rebuilds, which expose the issue if the build tree is not cleaned. Since then fixes have been added to python3[2] and python3-build[3] which resolve this issue at a lower level, so the workaround in this class should be no longer needed. [1] oe-core 3ded8b83ceb ("python_hatchling: remove empty python sysroot dirs") [2] oe-core 73de8daa629 ("python3: backport the full fix for importlib scanning invalid distributions") oe-core 855d1111c3d ("python3: prefer valid dists when searching for entry points") [3] oe-core bd7225f5b84 ("python3-build: verify that found dependencies are valid") Signed-off-by: Ross Burton --- meta/classes-recipe/python_hatchling.bbclass | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/meta/classes-recipe/python_hatchling.bbclass b/meta/classes-recipe/python_hatchling.bbclass index 6765ddbe8ce..8ad3ac7fbbb 100644 --- a/meta/classes-recipe/python_hatchling.bbclass +++ b/meta/classes-recipe/python_hatchling.bbclass @@ -7,21 +7,3 @@ inherit python_pep517 DEPENDS += "python3-hatchling-native" - -# delete nested, empty directories from the python site-packages path. Make -# sure that we remove the native ones for target builds as well -hatchling_rm_emptydirs:class-target () { - find ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete - find ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete -} - -hatchling_rm_emptydirs:class-native () { - find ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete -} - -# Define a default empty version of hatchling_rm_emptydirs to appease bitbake -hatchling_rm_emptydirs () { - : -} - -do_prepare_recipe_sysroot[postfuncs] += " hatchling_rm_emptydirs"