On 1 Nov 2024, at 10:08, Alexander Kanavin via lists.openembedded.org 
<[email protected]> wrote:
> 2. The second issue is slightly trickier. There's a number of
> generated c files produced by cython and they contain lines like:
> 
> static const char __pyx_k_srv_storage_alex_yocto_build_64[] =
> "/srv/storage/alex/yocto/build-64/tmp/work/core2-64-poky-linux/python3-numpy/2.1.2/numpy-2.1.2/numpy/random/bit_generator.pyx";
> PyObject *__pyx_kp_s_srv_storage_alex_yocto_build_64;
> etc.
> 
> This needs to be fixed by tracking down where in cython this stuff is
> generated, and replacing real paths (or parts of them) with something
> reproducible, like 'reproducible_build_path' or similar. Then this
> should be submitted or raised with upstream.

There’s an upstream ticket already: 
https://github.com/cython/cython/issues/5949.

> 3. We should also drop
> # Python pyx -> c -> so build leaves absolute build paths in the code
> INSANE_SKIP:${PN} += "buildpaths"
> INSANE_SKIP:${PN}-src += "buildpaths"
> 
> from meta/classes-recipe/python_mesonpy.bbclass when point two is addressed.

This should be removed from that class anyway, this is a cython workaround so 
doesn’t have any place in the mesonpy class.

There’s also that .c files generated by cython embed the python include dir 
(thus, build path) inside a “Cython Metadata” blob. A number of recipes in 
meta-python strip this out so I’m wondering if we need a cython.bbclass which 
does something like:

do_compile[postfuncs] = “strip_cython_metadata”
strip_cython_metadata() {
 find ${B} -name \*.c -print0 | xargs -0 sed -i -e "/BEGIN: Cython 
Metadata/,/END: Cython Metadata/d”
}

Alternatively, patch cython to not generate that metadata in the first place.  
Apparently there are tools that read it, so leaving it in the tree but 
stripping it before install seems like the safest option.

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

Reply via email to