<?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>12084</bug_id>
          
          <creation_ts>2017-09-14 05:54:39 +0000</creation_ts>
          <short_desc>distutils/setuptools recipes may try to fetch code during do_compile</short_desc>
          <delta_ts>2018-07-31 02:25:27 +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>2.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Backport to YP 2.4 and 2.5</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.6 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <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>76816</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-09-14 05:54:39 +0000</bug_when>
    <thetext>Recently I have dealt with failures to build two recipes (python-paho-mqtt in meta-python and python-restrictedpython in meta-homeassistant, plus python3 variants of both) where if you did not have pytest-runner installed on your host then it attempted to use pip to download it, and since I happened to be building these on a machine where a proxy was required, this failed as the proxy variables aren&apos;t set in the do_compile environment and thus the connection was blocked. If I&apos;d built these on a machine which had direct access to the internet I suspect the issue wouldn&apos;t be apparent. Adding an explicit DEPENDS on python(3)-pytest-runner-native fixed the problem:

http://cgit.openembedded.org/meta-openembedded/commit?id=2951fb898e7c761e3071521b58c9aa6cc746fba3

Proxy issues aside, we want full control over what gets downloaded during a build, so we definitely don&apos;t want to be downloading anything outside of do_fetch. Thus we need to prevent pip from being called here - if a dependency is missing then it should fail immediately.

(This was the trigger that exposed bug 11978, although that is a separate issue.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76839</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-09-14 15:00:46 +0000</bug_when>
    <thetext>Did a few minutes of digging as I was curious: python-paho-mqtt is using setuptools and the setup_requires argument, where setuptools will use pip to fetch the module if it isn&apos;t present.  Not sure if setuptools has a way to disable this, we may need to patch it into setuptools-native and then pass a special argument to disable fetching.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81212</commentid>
    <comment_count>2</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2018-07-31 02:25:27 +0000</bug_when>
    <thetext>commit 9d556092fcc6f04c487afd126d52935bac133165
Author: Hongxu Jia &lt;hongxu.jia@windriver.com&gt;
Date:   Thu Jul 26 22:50:21 2018 +0800

    distutils/distutils3: do not try to fetch code during do_configure
    
    For distutils3, any setup.py invoking will cause setup_requires
    argument to trigger a code fetching. Since the following commit
    applied in oe-core, code fetching occurs during do_confugire
    before the do_compile.
    ...
    b805cef distutils: clean the build tree in do_configure
    ...
    
    Refer what do_compile did, add var-NO_FETCH_BUILD to do_configure.
    
    Sync with distutils3, add do_configure to distutils also.
    


commit 57414f4a1c549e6faaa110e6e95ff601b05b7361
Author: Hongxu Jia &lt;hongxu.jia@windriver.com&gt;
Date:   Tue Jul 17 21:36:35 2018 +0800

    distutils/setuptools-native, distutils3/setuptools3-native: do not try to fetch code during do_compile
    
    If a python recipe is using setuptools and the setup_requires argument, where
    setuptools will use easy_install to fetch the module if it isn&apos;t
    present.
    
    The build failed on a machine where a proxy was required, but succeeded on a
    machine which had direct access to the internet
    
    Add var-NO_FETCH_BUILD, and set it in distutils_do_compile which does not
    allow to fetch code from internet during do_compile.
    
    Example result:
    ...
    ERROR: Do not try to fetch `pytest-runner1&apos; for building. Please add its native recipe to DEPENDS.
    Traceback (most recent call last):
      File &quot;setup.py&quot;, line 56, in &lt;module&gt;
    ...
    
    The improvement is flexible for test_requirements argument (used at
    `setup.py test&apos;), where use easy_install also.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>