<?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>10256</bug_id>
          
          <creation_ts>2016-09-12 07:01:50 +0000</creation_ts>
          <short_desc>execute empty tasks?</short_desc>
          <delta_ts>2016-09-15 12:49: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>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</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>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>joshuagloe</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</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>66027</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2016-09-12 07:01:50 +0000</bug_when>
    <thetext>Tasks can have side effects besides executing their content. For example, recently do_rootfs was changed so that it creates ${IMGDEPLOYDIR}, the directory which all following image-related tasks write into:

do_rootfs[cleandirs] += &quot;${S} ${IMGDEPLOYDIR}&quot;

meta-swupd has a special image creation mode where do_rootfs is set to empty with e.data.setVar(&quot;do_rootfs&quot;, &quot;&quot;) in a virtual recipe and the final rootfs gets created in do_image.

Setting do_rootfs to empty had the effect that it was skipped *completely*, including the creation of ${IMGDEPLOYDIR}, which broke creating of such images. 

This might be intentional, but at first glance it looks like a somewhat too eager optimization: IMHO an empty task with side effects is valid and those side effects should be applied.

There&apos;s a patch for meta-swupd which works around that (by setting do_rootfs to &quot;pass&quot; instead of &quot;&quot;), so fixing this is not urgent. Closing as &quot;works-as-intended&quot; would also be okay.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66032</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-09-12 11:55:28 +0000</bug_when>
    <thetext>This can be explained if you look at http://git.yoctoproject.org/cgit.cgi/poky/tree/bitbake/lib/bb/build.py#n188 which is the start of the exec_func() which does:

   body = d.getVar(func, False)
    if not body:
        if body is None:
            logger.warning(&quot;Function %s doesn&apos;t exist&quot;, func)
        return


I suspect this could be moved after the directory handling pieces to avoid the effect you describe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66200</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-09-15 12:49:46 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=53b1fa2d3e1244c46a705d9a40ca0dbee92eab98</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>