<?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>12729</bug_id>
          
          <creation_ts>2018-05-02 23:17:07 +0000</creation_ts>
          <short_desc>testsdkext takes too long time to finish</short_desc>
          <delta_ts>2018-07-07 12:50:34 +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.5</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></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.6 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chen Qi">Qi.Chen</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>stephano</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>80469</commentid>
    <comment_count>0</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-05-02 23:17:07 +0000</bug_when>
    <thetext>Currently if we do a testsdkext task for the image, it would take about half an hour to finish. The time is mostly spent fetching kernel source via network.

We have in testsdk.bbclass:
	# Use our own SSTATE_DIR and DL_DIR so that updates to the eSDK come from our sstate cache
        # and we don&apos;t spend hours downloading kernels for the kernel module test
        # Abuse auto.conf since local.conf would be overwritten by the SDK
        with open(os.path.join(sdk_dir, &apos;conf&apos;, &apos;auto.conf&apos;), &apos;a+&apos;) as f:
            f.write(&apos;SSTATE_MIRRORS += &quot; \\n file://.* file://%s/PATH&quot;\n&apos; % test_data.get(&apos;SSTATE_DIR&apos;))
            f.write(&apos;SOURCE_MIRROR_URL = &quot;file://%s&quot;\n&apos; % test_data.get(&apos;DL_DIR&apos;))
            f.write(&apos;INHERIT += &quot;own-mirrors&quot;\n&apos;)

However, this does not work. The log.do_fetch shows info as below.
DEBUG: Fetcher failure: Unable to find file file:///mnt/buildarea3/build-systemd/downloads/git2_git.yoctoproject.org.linux-yocto.git.tar.gz anywhere.

The .tar.gz file seems to be generated only if BB_GENERATE_MIRROR_TARBALLS is set to &quot;1&quot;. The default value of BB_GENERATE_MIRROR_TARBALLS is &quot;0&quot;, and according to the ref manual, users would choose to set it to &quot;1&quot; only if they are trying to make a source mirror. So generally, this var&apos;s value is &quot;0&quot;.

To solve this problem, we can write to auto.conf some PREMIRRORS setting like below.

diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 2e43343..92671cc 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -157,6 +157,8 @@ def testsdkext_main(d):
             f.write(&apos;SSTATE_MIRRORS += &quot; \\n file://.* file://%s/PATH&quot;\n&apos; % test_data.get(&apos;SSTATE_DIR&apos;))
             f.write(&apos;SOURCE_MIRROR_URL = &quot;file://%s&quot;\n&apos; % test_data.get(&apos;DL_DIR&apos;))
             f.write(&apos;INHERIT += &quot;own-mirrors&quot;\n&apos;)
+            f.write(&apos;PREMIRRORS_prepend = &quot; git://git.yoctoproject.org/linux-yocto.git git://%s/git2/git.yoctoproject.org.linux-yocto.git \\n&quot;\n&apos; % test_data.get(&apos;DL_DIR&apos;))
+            f.write(&apos;PREMIRRORS_prepend = &quot; git://git.yoctoproject.org/yocto-kernel-cache git://%s/git2/git.yoctoproject.org.yocto-kernel-cache \\n&quot;\n&apos; % test_data.get(&apos;DL_DIR&apos;))
 
         # We need to do this in case we have a minimal SDK
         subprocess.check_output(&quot;. %s &gt; /dev/null; devtool sdk-install meta-extsdk-toolchain&quot; % \



Not sure if this is the correct solution. Maybe there are better ones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81025</commentid>
    <comment_count>1</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-07-06 02:07:31 +0000</bug_when>
    <thetext>The patch is in review.
I&apos;ve pinged the patch today.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81031</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2018-07-07 12:50:34 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=ef98f64b71fb4a2bb6efb59d27ec2245ac9b4ddb</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>