<?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>10850</bug_id>
          
          <creation_ts>2016-12-22 20:43:32 +0000</creation_ts>
          <short_desc>esdk creation on Toaster does not show necessary file in artifacts</short_desc>
          <delta_ts>2017-04-11 23:54:48 +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>Toaster</product>
          <component>toaster</component>
          <version>2.3</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>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="brian avery">brian.avery</reporter>
          <assigned_to name="David Reyna">david.reyna</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Libertad">libertad.gonzalez.de.la.cruz</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>69343</commentid>
    <comment_count>0</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-12-22 20:43:32 +0000</bug_when>
    <thetext>To replicate:
build core-image-minimal:do_populate_sdk_ext
machine=qemux86,system=x86-64

Goto Build Summary for the above build.
Artifacts listed are:
Image files - ext3,ext4,jff2,tar.bz

kernel artifacts -
bzImage--4.8.12+git0+926c93ae07_021b4aef55-r0-qemux86-20161222184253.bin (6.7 MB)
modules--4.8.12+git0+926c93ae07_021b4aef55-r0-qemux86-20161222184253.tgz (4.3 MB)

SDK artifacts:
x86_64-buildtools-nativesdk-standalone-2.2.host.manifest (5.1 KB)
x86_64-buildtools-nativesdk-standalone-2.2.sh (24.8 MB)
x86_64-buildtools-nativesdk-standalone-2.2.target.manifest (0 B)
x86_64-nativesdk-libc.host.manifest (311 B)
x86_64-nativesdk-libc.tar.bz2 (2.4 MB)
x86_64-nativesdk-libc.target.manifest (0 B)

----
Unfortunately, the file one actually needs to download in order to install and use the esdk is:
build-toaster-2/tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.2.sh

and it&apos;s associated manifest files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69998</commentid>
    <comment_count>1</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-01-23 10:12:20 +0000</bug_when>
    <thetext>When I ran this from the command line under the debugger, all of the expected SDK files were found scan_sdk_artifacts() and added.

When I ran this from within Toaster, the ESDK files were indeed not found. However, after much debugging I discovered they were in fact _not_ there when the event handler scan_sdk_artifacts() was executed, even thought that handle ran at least one minute after the date/times of the ESDK files.

It seems that the ESDK files are being moved to the &quot;sdk&quot; directory _after_ the Toaster handle is executed, which would explain why the timestamps are correct but misleading.

This was the definitive test:

   def scan_sdk_artifacts(self, event):
       ...
       logger.info(&quot;SDK_DATE:&quot;+str(subprocess.Popen(&quot;date&quot;, \
           stdout=subprocess.PIPE, shell=True, \
           executable=&quot;/bin/bash&quot;).stdout.read()))
       logger.info(&quot;SDK_LS:&quot;+str(subprocess.Popen(&quot;ls -la /opt/dreyna \
           /toaster_master/poky/build-toaster-2/tmp/deploy/sdk&quot;, \
           stdout=subprocess.PIPE, shell=True, \
           executable=&quot;/bin/bash&quot;).stdout.read()))

The &quot;date&quot; says the files should have been found, the the &quot;ls&quot; shows that they were not there yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70168</commentid>
    <comment_count>2</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-01-26 04:26:53 +0000</bug_when>
    <thetext>In examining the event flow against the actual SDK_EXT file placement, plus the DEBUG information in &quot;work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_populate_sdk_ext&quot;, it is clear that the population of &quot;tmp/deploy/sdk&quot; now happens after &quot;do_populate_sdk_ext&quot;, which is why this is failing for Toaster. Specifically, the file placement now happens in the function &quot;sstate_install()&quot; in &quot;meta/classes/sstate.bbclass&quot;.

Here is what appears to be the pertinent commits:

	git log meta/classes/populate_sdk_ext
	...
	commit e1de69667481749d4e1081210a3a216378d034c9
	Date:   Fri Sep 2 11:22:41 2016 +0100
		populate_sdk_ext: Put populate_sdk_ext under sstate control

	commit 3c3962d27e659c1da153c588948122dae20a9d93
	Date:   Thu Sep 1 11:56:02 2016 +0300
		populate_sdk_base: Put populate_sdk under sstate control
		
The solution appears to be to hook &quot;sstate_install&quot; instead of &quot;do_populate_sdk_ext&quot; (which now only populates the package and not the top-level deploy directory).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72193</commentid>
    <comment_count>3</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-04-08 03:51:15 +0000</bug_when>
    <thetext>*** Bug 10851 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72194</commentid>
    <comment_count>4</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-04-08 03:55:35 +0000</bug_when>
    <thetext>The solution had three parts:

1) Enable the TaskArtifacts event. It had been mostly implemented but not completed.

2) Make a special case for naming the SDK manifest file, because the meta used to create the file is lost from the data_smart environment by the time TaskArtifacts executes.

3) Add a scan_task_artifacts handler to add the SDK files from the manifest to the target.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72360</commentid>
    <comment_count>5</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-04-11 23:54:48 +0000</bug_when>
    <thetext>commit ba1d8e36917f9d048e0a6b1bc3450b492497c63c

This patch provides the first half of the implementation of #10283.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>