Skip to contentSkip to conversation

glib-2.0: Support bbappends again

PATCH New Peter Kjellerstedt 1 participant 1 message Mar 5, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 glib-2.0: Support bbappends again

In commit 314cfc7d (glib-2.0: replace THISDIR instead of COREBASE in find_meson_cross_files --cross-file paths), find_meson_cross_files() was modified to give an error for files that are not relative to ${THISDIR}. However, this did not take into account bbappend files. As soon as a bbappend was used for the glib-2.0 recipe, a huge number of errors would be produced. This was due to not checking if the files actually existed.

Avoid this whole problem and the need for bb.error() by making the paths to the cross-files relative to ${THISDIR}.

---
 meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb +2 -5
index 882a89da7a..af73e4bef9 100644
@@ -39,11 +39,8 @@ def find_meson_cross_files(d):
     for path in d.getVar("FILESPATH").split(":"):
         for element in sitedata:
             filename = os.path.normpath(os.path.join(path, "meson.cross.d", element))
-            sanitized_path = filename.replace(thisdir, "${THISDIR}")
-            if sanitized_path == filename:
-                bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir))
-                continue
-            files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename)
+            sanitized_path = "${THISDIR}/" + oe.path.relative(thisdir, filename)
+            files[sanitized_path] = os.path.exists(filename)
 
     items = ["--cross-file=" + k for k,v in files.items() if v]
     d.appendVar("EXTRA_OEMESON", " " + " ".join(items))