This didn't seem to be possible considering the entire point of Cython
is to generate C bindings, but some Python build systems remove the
build tree once the wheel has been generated, so we never get to see the
sources. As xargs will call the specified command even without any files
this results in sed failing.

Pass --no-run-if-empty so that this case doesn't result in an error.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/classes-recipe/cython.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-recipe/cython.bbclass 
b/meta/classes-recipe/cython.bbclass
index f37ebeb23fe..53b84f5f5eb 100644
--- a/meta/classes-recipe/cython.bbclass
+++ b/meta/classes-recipe/cython.bbclass
@@ -7,5 +7,5 @@ do_compile[postfuncs] = "strip_cython_metadata"
 strip_cython_metadata() {
     # Remove the Cython Metadata headers that we don't need after the build, 
and
     # may contain build paths.
-    find ${S} -name "*.c" -print0 | xargs -0 sed -i -e "/BEGIN: Cython 
Metadata/,/END: Cython Metadata/d"
+    find ${S} -name "*.c" -print0 | xargs --no-run-if-empty --null sed -i -e 
"/BEGIN: Cython Metadata/,/END: Cython Metadata/d"
 }
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207177): 
https://lists.openembedded.org/g/openembedded-core/message/207177
Mute This Topic: https://lists.openembedded.org/mt/109582751/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to