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}.

Signed-off-by: Peter Kjellerstedt <[email protected]>
---
 meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb 
b/meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb
index 882a89da7a..af73e4bef9 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb
@@ -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))
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149021): 
https://lists.openembedded.org/g/openembedded-core/message/149021
Mute This Topic: https://lists.openembedded.org/mt/81099990/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to