diff options
author | Ross Burton <ross.burton@arm.com> | 2024-11-14 21:53:53 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-18 22:09:03 +0000 |
commit | 121ffba74375eae51145daa3a889f88151c7ba02 (patch) | |
tree | e9cb4d78e5b142c2548404b3dde2ffd197dc6c79 | |
parent | 3975cc6f4f1e6e3a4ac84feb9d5b5108db8b6723 (diff) | |
download | poky-121ffba74375eae51145daa3a889f88151c7ba02.tar.gz |
classes-recipe/cython: handle builds with no .c sources
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.
(From OE-Core rev: f1c1bdb05ea8f79a14a4b53e110889b70881f4d7)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes-recipe/cython.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes-recipe/cython.bbclass b/meta/classes-recipe/cython.bbclass index f37ebeb23f..53b84f5f5e 100644 --- a/meta/classes-recipe/cython.bbclass +++ b/meta/classes-recipe/cython.bbclass | |||
@@ -7,5 +7,5 @@ do_compile[postfuncs] = "strip_cython_metadata" | |||
7 | strip_cython_metadata() { | 7 | strip_cython_metadata() { |
8 | # Remove the Cython Metadata headers that we don't need after the build, and | 8 | # Remove the Cython Metadata headers that we don't need after the build, and |
9 | # may contain build paths. | 9 | # may contain build paths. |
10 | find ${S} -name "*.c" -print0 | xargs -0 sed -i -e "/BEGIN: Cython Metadata/,/END: Cython Metadata/d" | 10 | find ${S} -name "*.c" -print0 | xargs --no-run-if-empty --null sed -i -e "/BEGIN: Cython Metadata/,/END: Cython Metadata/d" |
11 | } | 11 | } |