Skip to contentSkip to conversation

meson.bblcass: Remove empty egg-info directories before running meson

PATCH Peter Kjellerstedt 1 participant 1 message Oct 27, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 33 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 25 oktober 2021 16:07
To: [email protected]
Subject: [OE-core] [PATCHv2 1/2] meson.bblcass: Remove empty egg-info directories before running meson

sstate.bbclass no longer removes empty directories to avoid a race (see commit 4f94d929 "sstate/staging: Handle directory creation race issue"). Unfortunately Python apparently treats an empty egg-info directory as if the version it previously contained still exists and fails if a newer version is required, which Meson does. To avoid this, make sure there are no empty egg-info directories from previous versions left behind.

---

PATCHv2: Ignore all errors from rmdir since apparently egg-info may be
files rather than directories.

 meta/classes/meson.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/classes/meson.bbclass +3 -0
index e124d18144..da58cb4bec 100644
@@ -103,6 +103,16 @@ meson_do_configure() {
     # https://github.com/mesonbuild/meson/commit/ef9aeb188ea2bc7353e59916c18901cde90fa2b3
     unset LD
 
+    # sstate.bbclass no longer removes empty directories to avoid a race (see
+    # commit 4f94d929 "sstate/staging: Handle directory creation race issue").
+    # Unfortunately Python apparently treats an empty egg-info directory as if

meta/classes/meson.bbclass meson_do_configure() { · line 118

Quoted 10 lines
meta/classes/meson.bbclass +7 -0
+    # the version it previously contained still exists and fails if a newer
+    # version is required, which Meson does. To avoid this, make sure there are
+    # no empty egg-info directories from previous versions left behind. Ignore
+    # all errors from rmdir since the egg-info may be a file rather than a
+    # directory.
+    rmdir ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/*.egg-info 2>/dev/null || :
+
     # Work around "Meson fails if /tmp is mounted with noexec #2972"
     mkdir -p "${B}/meson-private/tmp"
     export TMPDIR="${B}/meson-private/tmp"

Can this patch and the corresponding qemu.inc patch please be backported to Honister now that they have been accepted for master?

//Peter