On 2023-05-04 12:03, Frederic Martinsons wrote:


Le jeu. 4 mai 2023, 11:31, Frédéric Martinsons <frederic.martins...@gmail.com> a écrit :



    On Thu, 4 May 2023 at 11:00, Alexander Kanavin
    <alex.kana...@gmail.com> wrote:

        On Thu, 4 May 2023 at 10:41, Peter Bergin
        <pe...@berginkonsult.se> wrote:

        > At
        >
        
https://github.com/pyca/cryptography/blob/f816b457494e010b655cd7fdcd30e3446f86a703/src/rust/build.rs#L46
        > the path to python includes is defined by calling 'python3
        -c "import
        > sysconfig; print(sysconfig.get_path('include'))"' (but from
        inside
        > rust). With print-debugging this seems to return the bad string
        > '/usr/include/python3.11' which is then passed to cc::Build
        >
        > I executed this in recipe context:
        >
        > do_compile:prepend() {
        >      which python3
        >      python3 -c "import sysconfig;
        print(sysconfig.get_path('include'))"
        > }
        >
        > and then I got the correct return value:
        >
        > |
        >
        
/work/yocto/poky/build/tmp/work/core2-64-poky-linux/python3-cryptography/40.0.2-r0/recipe-sysroot-native/usr/bin/python3-native/python3
        > |
        >
        
/work/yocto/poky/build/tmp/work/core2-64-poky-linux/python3-cryptography/40.0.2-r0/recipe-sysroot-native/usr/include/python3.11

        This is pointing to the native sysroot in a target build, so it is
        most likely not actually correct. I believe 'inherit
        python3targetconfig' may help, as it substitutes most places where
        native python gets queried by components with target-specific
        values.

        Alex


    Unless I'm mistaken , in the error message we can see that the
    compiler specified the sysroot correctly (recipe-sysroot and
    recipe-sysroot-native)


recipe-sysroot and NOT recipe-sysroot-native

'--sysroot' is specified correct but that is not automatically add search paths to '-I' directive, if I'm not misreading this: https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html . When you use --sysroot with gcc you have to add = or $SYSROOT to your -I directive in order to add it to search path for headers. With that information I guess '-I =/usr/lib/python3.11' or '-I \$SYSROOT/usr/lib/python3.11' can work but '-I /usr/lib/python3.11' will point to your host.

/Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#180866): 
https://lists.openembedded.org/g/openembedded-core/message/180866
Mute This Topic: https://lists.openembedded.org/mt/98667212/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to