openembedded-core.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/2] python_hatching: remove empty site-packages workaround
Date: Tue,  8 Sep 2026 14:49:26 +0100	[thread overview]
Message-ID: <20260908134926.200628-2-ross.burton@arm.com> (raw)
In-Reply-To: <20260908134926.200628-1-ross.burton@arm.com>

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 <ross.burton@arm.com>
---
 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"
-- 
2.43.0



      reply	other threads:[~2026-09-08 13:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 13:49 [PATCH 1/2] python3-iniconfig: remove obsolete DEPENDS Ross Burton
2026-09-08 13:49 ` Ross Burton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260908134926.200628-2-ross.burton@arm.com \
    --to=ross.burton@arm.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).