<?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>8671</bug_id>
          
          <creation_ts>2015-11-10 08:50:25 +0000</creation_ts>
          <short_desc>python build tries to import target modules and fails</short_desc>
          <delta_ts>2016-02-15 11:32:46 +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>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.0.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Awais">awais_belal</reporter>
          <assigned_to name="Alejandro Hernandez">alejandro.hernandez</assigned_to>
          <cc>bogdanx.a.voiculescu</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          <qa_contact name="Cristina Agurida">cristina-danielax.agurida</qa_contact>
          <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>56342</commentid>
    <comment_count>0</comment_count>
    <who name="Awais">awais_belal</who>
    <bug_when>2015-11-10 08:50:25 +0000</bug_when>
    <thetext>The issue is seen on x86 type of machines passing -march=bdverX (X=3,4 etc) flags but in general this should cause a problem when freshly built target modules are tried for an import during the cross build process.
Aiding the PYTHONPATH (in PYTHON_FOR_BUILD) with CROSSPYTHONPATH which contains the native modules path resolves the issue.
The issue can be reproduced on qemux86-64 builds by adding
TUNE_CCARGS_pn-python=&quot; -m64 -march=bdver4 -msse3 -mfpmath=sse&quot;
to local.conf. Although the failure is shown in do_install this actually is a compilation issue and can be confirmed by running do_compile a second time.
An RFC patch (http://patchwork.openembedded.org/patch/106561/) was sent to OE-Core mailing list and then resent with RFC removed (http://patchwork.openembedded.org/patch/106627/) which I believe takes care of the issue correctly but both went un-answered.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56343</commentid>
    <comment_count>1</comment_count>
    <who name="Awais">awais_belal</who>
    <bug_when>2015-11-10 08:58:09 +0000</bug_when>
    <thetext>Just to add that this can be confirmed through dev-shell once the build fails.
bitbake -c devshell python
edit the (srcdir)/setup.py script to first import sys and the print sys.path which is the path python is going to use for imports. The path does not contain references to sysroot (native) python modules location and then the interpreter tries to import from target&apos;s build dir.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56667</commentid>
    <comment_count>2</comment_count>
    <who name="Alejandro Hernandez">alejandro.hernandez</who>
    <bug_when>2015-11-19 19:39:03 +0000</bug_when>
    <thetext>I can confirm this isn&apos;t working, I do find it interesting this is necessary, since when executing python-native from a devshell and printing sys.path, one can see that it DOES include CROSSPYTHONPATH, but when it is executed via the makefile to install sharedmods, it doesn&apos;t, causing the failure, so I am just wondering if there might be a better fix, in the meantime, the patch seems to work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58194</commentid>
    <comment_count>3</comment_count>
    <who name="Alejandro Hernandez">alejandro.hernandez</who>
    <bug_when>2016-01-25 16:09:50 +0000</bug_when>
    <thetext>Fixed here:
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a1fa8d9ac53625737aab29b4e5e1687fc01bdfc2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58999</commentid>
    <comment_count>4</comment_count>
    <who name="Cristina Agurida">cristina-danielax.agurida</who>
    <bug_when>2016-02-15 11:32:46 +0000</bug_when>
    <thetext>Verified on master: 36b43b233c841b3c09fc17e04686b4b758780963</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>