<?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>3674</bug_id>
          
          <creation_ts>2013-01-04 07:35:40 +0000</creation_ts>
          <short_desc>rebuild core-image-sato failed: not specify the order of do_populate_lic and do_rootfs</short_desc>
          <delta_ts>2013-01-11 10:05:40 +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>core</component>
          <version>1.4</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>1.4 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hongxu Jia">hongxu.jia</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>hongxu.jia</cc>
    
    <cc>kai.kang</cc>
    
    <cc>liang.li2</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</cc>
    
    <cc>zhenfeng.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>28546</commentid>
    <comment_count>0</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-01-04 07:35:40 +0000</bug_when>
    <thetext>*Env
vim conf/local.conf
BB_NUMBER_THREADS = &quot;4&quot;
PARALLEL_MAKE = &quot;-j 4&quot;
PACKAGE_CLASSES ?= &quot;package_deb&quot;

*problem
The first time to build the deb image of core-image-sato is success. But clean
sstate and rebuild image is failed, (bitbake core-image-sato-ccleansstate &amp;&amp;
bitbake core-image-sato), there are some errors in log.do_populate_lic:
&gt;&gt;log&lt;&lt;
...
|DEBUG: Executing shell function sstate_create_package
|shell-init: error retrieving current directory: getcwd: cannot access parent 
 directories: No such file or directory
|chdir: error retrieving current directory: getcwd: cannot access parent 
 directories: No such file or directory
|/home/jiahongxu/yocto/build-20121232-deb2/tmp/work/qemux86-poky-linux/
 core-image-sato/1.0-r0/temp/run.sstate_create_package.3222: line 96: cd:
 /home/jiahongxu/yocto/build-20121232-deb2/tmp/work/qemux86-poky-linux/
 core-image-sato/1.0-r0/core-image-sato-1.0:No such file or directory
|DEBUG: Python function sstate_task_postfunc finished
|ERROR: Function failed: sstate_create_package (see /home/jiahongxu/yocto/
 build-20121232-deb2/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/
 temp/log.do_populate_lic.3222for further information)
...

*analysis
1.Vim run.sstate_create_package.3222: line 96,we know the direct reason of
  the error is the dir doesn&apos;t exist
...
96 cd /home/jiahongxu/yocto/build-20121232-deb2/tmp/work/qemux86-poky-linux/
   core-image-sato/1.0-r0/core-image-sato-1.0
97 sstate_create_package
...

2.Vim log.task_order, we know there are three tasks while running bitbake 
  core-image-sato-ccleansstate &amp;&amp; bitbake core-image-sato
...
  1 do_cleansstate (3164): log.do_cleansstate.3164
  2 do_populate_lic (3222): log.do_populate_lic.3222
  3 do_rootfs (3223): log.do_rootfs.3223
...

3.We use &quot;bitbake -c&quot; to execute three tasks as sequence, everything is ok.
  Especially after executing &quot;do_populate_lic&quot;, the dir exists. And after
  &quot;do_rootfs&quot;, the dir is removed.

*solution
Explicity specify the order of do_populate_lic and do_rootfs. Add task do_rootfs
after do_populate_lic</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28549</commentid>
    <comment_count>1</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-01-04 09:01:32 +0000</bug_when>
    <thetext>The task of do_populate_lic use &quot;bb.build.exec_func&quot; to execute shell function
&quot;sstate_create_package&quot;, and &quot;bb.build.exec_func&quot; use ${B} as default dir to cd
and execute the shell function. At this place, B = &quot;${WORKDIR}/${BPN}-${PV}/&quot;,
and &quot;${WORKDIR}/${BPN}-${PV}/&quot; is removed by task do_rootfs.

When we use more than one bitabke to run tasks, there is a chance that do_rootfs
and do_populate_lic are being executed at the same time. So we should explicity
specify the order of do_populate_lic and do_rootfs to let &quot;${WORKDIR}/${BPN}-
${PV}/&quot;could be correctly used and removed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28620</commentid>
    <comment_count>2</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-01-08 10:02:02 +0000</bug_when>
    <thetext>Patch sent on the mailing list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28652</commentid>
    <comment_count>3</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-01-09 09:07:21 +0000</bug_when>
    <thetext>As Richard suggestion:
Specify dirs in which the shell function &quot;sstate_create_package&quot; and
&quot;sstate_unpack_package&quot; are executed and don&apos;t use ${B} as default dirs
to avoid possible race with task do_rootfs at deb image creation time.

Add the following in sstate.bbclass:
sstate_create_package[dirs] = &quot;${SSTATE_BUILDDIR}&quot;
sstate_unpack_package[dirs] = &quot;${SSTATE_INSTDIR}&quot;


Patch sent on the mailing list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28748</commentid>
    <comment_count>4</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2013-01-11 08:27:02 +0000</bug_when>
    <thetext>no such error when run &quot;bitbake core-image-sato&quot; (PACKAGE_CLASSES ?= &quot;package_deb&quot; in local.conf),then run &quot; bitbake core-image-sato -ccleansstate ; bitbake core-image-sato&quot; on opensuse 12.2 64bit host:

yocto@yocto-OptiPlex-990:/buildarea/tester/build_202&gt; bitbake core-image-sato -ccleansstate
Loading cache: 100% |###########################################| ETA:  00:00:00
Loaded 1118 entries from dependency cache.

Build Configuration:
BB_VERSION        = &quot;1.17.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;SUSE-LINUX-12.2&quot;
TARGET_SYS        = &quot;arm-poky-linux-gnueabi&quot;
MACHINE           = &quot;qemuarm&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;1.3+snapshot-20130111&quot;
TUNE_FEATURES     = &quot;armv5 thumb dsp&quot;
TARGET_FPU        = &quot;soft&quot;
meta              
meta-yocto        
meta-yocto-bsp    = &quot;master:66f4c8a674d9f8db958b13866af4d63ab8cbcd44&quot;

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn&apos;t need to be rerun and all succeeded.
yocto@yocto-OptiPlex-990:/buildarea/tester/build_202&gt; bitbake core-image-sato  
Loading cache: 100% |###########################################| ETA:  00:00:00
Loaded 1118 entries from dependency cache.

Build Configuration:
BB_VERSION        = &quot;1.17.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;SUSE-LINUX-12.2&quot;
TARGET_SYS        = &quot;arm-poky-linux-gnueabi&quot;
MACHINE           = &quot;qemuarm&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;1.3+snapshot-20130111&quot;
TUNE_FEATURES     = &quot;armv5 thumb dsp&quot;
TARGET_FPU        = &quot;soft&quot;
meta              
meta-yocto        
meta-yocto-bsp    = &quot;master:66f4c8a674d9f8db958b13866af4d63ab8cbcd44&quot;

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: /buildarea/poky.ubuntu.new1/poky/LICENSE could not be copied for some reason. It may not exist. WARN for now.
WARNING: /buildarea/poky.ubuntu.new1/poky/meta/COPYING.MIT could not be copied for some reason. It may not exist. WARN for now.
NOTE: Tasks Summary: Attempted 5250 tasks of which 5243 didn&apos;t need to be rerun and all succeeded.

Summary: There were 2 WARNING messages shown.

git info :66f4c8a674d9f8db958b13866af4d63ab8cbcd44&quot;  
git branch : poky/master</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28756</commentid>
    <comment_count>5</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-01-11 09:41:13 +0000</bug_when>
    <thetext>Patch has been merged into your testing branch.
git info :66f4c8a674d9f8db958b13866af4d63ab8cbcd44&quot;  
git branch : poky/master



Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=be78e8190a38c8aff570ed7a3f93a531a296c37d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28758</commentid>
    <comment_count>6</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2013-01-11 10:05:40 +0000</bug_when>
    <thetext>as Comment 4 said.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>