<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12627</bug_id>
          
          <creation_ts>2018-03-26 05:02:38 +0000</creation_ts>
          <short_desc>python3 distutils INCLUDEPY native wrong path</short_desc>
          <delta_ts>2018-03-26 15:59:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Runtime</product>
          <component>build-appliance</component>
          <version>2.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>luzik</reporter>
          <assigned_to name="Juro Bystricky">juro.bystricky</assigned_to>
          
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>79980</commentid>
    <comment_count>0</comment_count>
    <who name="">luzik</who>
    <bug_when>2018-03-26 05:02:38 +0000</bug_when>
    <thetext>STAGING_INCDIR=/opt/oe-core4/build/tmp/work/armv7vehf-neon-poky-linux-gnueabi/python-pyside2/5.9-r0/recipe-sysroot/usr/include STAGING_LIBDIR=/opt/oe-core4/build/tmp/work/armv7vehf-neon-poky-linux-gnueabi/python-pyside2/5.9-r0/recipe-sysroot/usr/lib /opt/oe-core4/build/tmp/work/armv7vehf-neon-poky-linux-gnueabi/python-pyside2/5.9-r0/recipe-sysroot-native/usr/bin/python3-native/python3
Python 3.5.3 (default, Mar 21 2018, 17:25:54) 
[GCC 5.4.0 20160609] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import distutils.sysconfig
&gt;&gt;&gt; distutils.sysconfig.get_config_var(&apos;INCLUDEPY&apos;)
&apos;/python3.5m&apos;
&gt;&gt;&gt; distutils.sysconfig.get_config_var(&apos;LIBDIR&apos;)
&apos;/opt/oe-core4/build/tmp/work/armv7vehf-neon-poky-linux-gnueabi/python-pyside2/5.9-r0/recipe-sysroot/usr/lib&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79983</commentid>
    <comment_count>1</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2018-03-26 08:17:38 +0000</bug_when>
    <thetext>Can you please document exact steps to reproduce the problem?
The more details, the better, not entirely sure what to make of this bug report.
(I am a bit puzzled with the GCC being of version 5.4.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79985</commentid>
    <comment_count>2</comment_count>
    <who name="">luzik</who>
    <bug_when>2018-03-26 09:57:34 +0000</bug_when>
    <thetext>You can try build wayland or any other package contains &apos;recipe-sysroot/usr/lib/python3.5/config-3.5m/Makefile&apos;. Problem is that this Makefile sets INCLUDEPY=  $(INCLUDEDIR)/python$(LDVERSION)
And if there is no INCLUDEDIR ENV defined then python distutils return wrong value. In my special case pyside2 using this to setup build env.
Maybe poky/meta/classes/distutils3.bbclass should contains INCLUDEDIR next to STAGING_INCDIR and STAGING_LIBDIR ?

Was it done to manipulate INCLUDEDIR between recipe-sysroot/ and recipe-sysroot-native/  ? 

gcc5.4 is my system compiler. Should that python3-native also be recompiled using internal gcc ?

Sorry for a mess in my messages. Yocto is quite new for me again and I am still trying to get into it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79986</commentid>
    <comment_count>3</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2018-03-26 10:39:04 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; You can try build wayland or any other package contains
&gt; &apos;recipe-sysroot/usr/lib/python3.5/config-3.5m/Makefile&apos;. Problem is that
&gt; this Makefile sets INCLUDEPY=  $(INCLUDEDIR)/python$(LDVERSION)
&gt; And if there is no INCLUDEDIR ENV defined then python distutils return wrong
&gt; value. In my special case pyside2 using this to setup build env.
&gt; Maybe poky/meta/classes/distutils3.bbclass should contains INCLUDEDIR next
&gt; to STAGING_INCDIR and STAGING_LIBDIR ?
&gt; 
&gt; Was it done to manipulate INCLUDEDIR between recipe-sysroot/ and
&gt; recipe-sysroot-native/  ? 
&gt; 
&gt; gcc5.4 is my system compiler. Should that python3-native also be recompiled
&gt; using internal gcc ?
&gt; 
&gt; Sorry for a mess in my messages. Yocto is quite new for me again and I am
&gt; still trying to get into it.

I&apos;m sorry, I am still a bit confused about the nature of the problem.
Are you using the BuildAppliance for your builds? (The bug report is filed BuildAppliance)
Which Yocto distro are you using/ What is your Build Configuration?
What are you trying to build/achieve? (Please list all your exact steps, so I can reproduce the problem!).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79987</commentid>
    <comment_count>4</comment_count>
    <who name="">luzik</who>
    <bug_when>2018-03-26 11:03:08 +0000</bug_when>
    <thetext>Oh, I missunderstud what BuildAppliance is. Could you please help me move this to correct one ?

I&apos;m using Rocko.
I&apos;m trying to cross compile Pyside2 on my Karo-TXUL (imx6ul) board using customized machine configuration, so it will be quite hard to fully reproduce, but I do believe that my issue is not related to any specific MACHINE so..

1. Create env with poky, meta-qt5, meta-clang.
2. Create python-pyside2_5.9.bb with:
LICENSE = &quot;LGPLv2.1&quot;
LIC_FILES_CHKSUM = &quot;file://LICENSE.LGPLv21;md5=fb91571854638f10b2e5f36562661a5a&quot;
SRC_URI = &quot;git://code.qt.io/pyside/pyside-setup.git;tag=b09fde6260b255e8b93b0d20a337e701bc940a99;branch=${PV} \
        file://cmake_params.patch&quot;

EXTRA_OECMAKE_prepend = &quot; \
    -DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \
&quot;
DISTUTILS_BUILD_ARGS = &quot;--qmake=${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qmake --ignore-git --cmake-params=&apos;${EXTRA_OECMAKE}&apos;&quot;
inherit distro_features_check qmake5_base cmake-native clang setuptools3
S = &quot;${WORKDIR}/git&quot;
B = &quot;${S}&quot;
TOOLCHAIN = &quot;clang&quot;
DEPENDS = &quot;qtbase qtbase-native python3-setuptools-native libxslt-native python3-numpy-native qtxmlpatterns-native libxml2-native icu-native python3-native&quot;
REQUIRED_DISTRO_FEATURES = &quot;x11&quot;

and cmake_params.patch:

diff --git a/setup.py b/setup.py
index ffb561c..734100a 100644
--- a/setup.py
+++ b/setup.py
@@ -257,6 +257,8 @@ OPTION_RELWITHDEBINFO = has_option(&apos;relwithdebinfo&apos;)
 OPTION_QMAKE = option_value(&quot;qmake&quot;)
 OPTION_QT_VERSION = option_value(&quot;qt&quot;)
 OPTION_CMAKE = option_value(&quot;cmake&quot;)
+OPTION_CMAKE_PARAMS = option_value(&quot;cmake-params&quot;)
+OPTION_INCLUDE_PY = option_value(&quot;include-py&quot;)
 OPTION_OPENSSL = option_value(&quot;openssl&quot;)
 OPTION_ONLYPACKAGE = has_option(&quot;only-package&quot;)
 OPTION_STANDALONE = has_option(&quot;standalone&quot;)
@@ -669,6 +671,8 @@ class pyside_build(_build):
                 py_libdir = os.path.join(py_prefix, &quot;libs&quot;)
             else:
                 py_libdir = os.path.join(py_prefix, &quot;lib&quot;)
+        if OPTION_INCLUDE_PY:
+            py_include_dir = OPTION_INCLUDE_PY
         if py_include_dir is None or not os.path.exists(py_include_dir):
             if sys.platform == &quot;win32&quot;:
                 py_include_dir = os.path.join(py_prefix, &quot;include&quot;)
@@ -1019,6 +1023,9 @@ class pyside_build(_build):
             &quot;-DCMAKE_INSTALL_PREFIX=%s&quot; % self.install_dir,
             module_src_dir
         ]
+        if OPTION_CMAKE_PARAMS:
+            for extra_cmake_param in OPTION_CMAKE_PARAMS.split():
+                cmake_cmd.append(extra_cmake_param.strip())
         cmake_cmd.append(&quot;-DPYTHON_EXECUTABLE=%s&quot; % self.py_executable)
         cmake_cmd.append(&quot;-DPYTHON_INCLUDE_DIR=%s&quot; % self.py_include_dir)
         cmake_cmd.append(&quot;-DPYTHON_LIBRARY=%s&quot; % self.py_library)


and as You can see in this patch I have to pass extra include-py to properly configure python include directory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79993</commentid>
    <comment_count>5</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2018-03-26 15:59:29 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Oh, I missunderstud what BuildAppliance is. Could you please help me move
&gt; this to correct one ?
&gt; 
&gt; I&apos;m using Rocko.
&gt; I&apos;m trying to cross compile Pyside2 on my Karo-TXUL (imx6ul) board using
&gt; customized machine configuration, so it will be quite hard to fully
&gt; reproduce, but I do believe that my issue is not related to any specific
&gt; MACHINE so..
&gt; 
&gt; 1. Create env with poky, meta-qt5, meta-clang.
&gt; 2. Create python-pyside2_5.9.bb with:
&gt; LICENSE = &quot;LGPLv2.1&quot;
&gt; LIC_FILES_CHKSUM =
&gt; &quot;file://LICENSE.LGPLv21;md5=fb91571854638f10b2e5f36562661a5a&quot;
&gt; SRC_URI =
&gt; &quot;git://code.qt.io/pyside/pyside-setup.git;
&gt; tag=b09fde6260b255e8b93b0d20a337e701bc940a99;branch=${PV} \
&gt;         file://cmake_params.patch&quot;
&gt; 
&gt; EXTRA_OECMAKE_prepend = &quot; \
&gt;     -DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \
&gt; &quot;
&gt; DISTUTILS_BUILD_ARGS = &quot;--qmake=${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qmake
&gt; --ignore-git --cmake-params=&apos;${EXTRA_OECMAKE}&apos;&quot;
&gt; inherit distro_features_check qmake5_base cmake-native clang setuptools3
&gt; S = &quot;${WORKDIR}/git&quot;
&gt; B = &quot;${S}&quot;
&gt; TOOLCHAIN = &quot;clang&quot;
&gt; DEPENDS = &quot;qtbase qtbase-native python3-setuptools-native libxslt-native
&gt; python3-numpy-native qtxmlpatterns-native libxml2-native icu-native
&gt; python3-native&quot;
&gt; REQUIRED_DISTRO_FEATURES = &quot;x11&quot;
&gt; 
&gt; and cmake_params.patch:
&gt; 
&gt; diff --git a/setup.py b/setup.py
&gt; index ffb561c..734100a 100644
&gt; --- a/setup.py
&gt; +++ b/setup.py
&gt; @@ -257,6 +257,8 @@ OPTION_RELWITHDEBINFO = has_option(&apos;relwithdebinfo&apos;)
&gt;  OPTION_QMAKE = option_value(&quot;qmake&quot;)
&gt;  OPTION_QT_VERSION = option_value(&quot;qt&quot;)
&gt;  OPTION_CMAKE = option_value(&quot;cmake&quot;)
&gt; +OPTION_CMAKE_PARAMS = option_value(&quot;cmake-params&quot;)
&gt; +OPTION_INCLUDE_PY = option_value(&quot;include-py&quot;)
&gt;  OPTION_OPENSSL = option_value(&quot;openssl&quot;)
&gt;  OPTION_ONLYPACKAGE = has_option(&quot;only-package&quot;)
&gt;  OPTION_STANDALONE = has_option(&quot;standalone&quot;)
&gt; @@ -669,6 +671,8 @@ class pyside_build(_build):
&gt;                  py_libdir = os.path.join(py_prefix, &quot;libs&quot;)
&gt;              else:
&gt;                  py_libdir = os.path.join(py_prefix, &quot;lib&quot;)
&gt; +        if OPTION_INCLUDE_PY:
&gt; +            py_include_dir = OPTION_INCLUDE_PY
&gt;          if py_include_dir is None or not os.path.exists(py_include_dir):
&gt;              if sys.platform == &quot;win32&quot;:
&gt;                  py_include_dir = os.path.join(py_prefix, &quot;include&quot;)
&gt; @@ -1019,6 +1023,9 @@ class pyside_build(_build):
&gt;              &quot;-DCMAKE_INSTALL_PREFIX=%s&quot; % self.install_dir,
&gt;              module_src_dir
&gt;          ]
&gt; +        if OPTION_CMAKE_PARAMS:
&gt; +            for extra_cmake_param in OPTION_CMAKE_PARAMS.split():
&gt; +                cmake_cmd.append(extra_cmake_param.strip())
&gt;          cmake_cmd.append(&quot;-DPYTHON_EXECUTABLE=%s&quot; % self.py_executable)
&gt;          cmake_cmd.append(&quot;-DPYTHON_INCLUDE_DIR=%s&quot; % self.py_include_dir)
&gt;          cmake_cmd.append(&quot;-DPYTHON_LIBRARY=%s&quot; % self.py_library)
&gt; 
&gt; 
&gt; and as You can see in this patch I have to pass extra include-py to properly
&gt; configure python include directory.

Thanks, I see now. You created your own recipe and ran into the problem. So definitely a misfiled bug, nothing to do with BuildAppliance. The recipe uses meta-qt5, so I would contact meta-qt5 developers regarding building pyside-setup. Also, please note that there are various python recipes in meta/recipes-devtools/python you can consult. Generally, the heavy lifting is done by &quot;inherit setuptools3&quot;, it should set up all needed dependencies and paths. 

I am going to close this bug report as RESOLVED/INVALID as Yocto does not maintain meta-qt5.

However, if you feel strongly this is truly an oe-core bug, you can re-open it under oe-core category. (but be prepared to demonstrate exact steps to reproduce the problem.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>