On Sat, 11 Jul 2020 at 02:58, Taras Kondratiuk (takondra) <takondra@cisco.com> wrote:
Oh, thanks. Now it makes a bit more sense. I didn't realize that
python3native class uses target-specific configuration and target
sysroot. Shouldn't it be called something like python3cross then?

Nope - the purpose of python3native itself is to provide native python to recipes for which host python may not be good enough (for example when they need 3rd party modules, or exact version supplied by oe-core).

If they also poke into target configuration, then that is provided by adding a DEPENDS on *target* python3, and having this patch that makes native python load the target sysconfigdata:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch

I understand it is not intuitive, but this is one of those legacy oe-core things that nobody has time to clean up. You are welcome to do so. I didn't invent this approach, I just replicated it when I rewrote the python3 recipe from scratch, throwing away all the other baggage that nobody remembered the purpose of, so that python3 could be upgraded again without going insane :)

Alex