<?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>12365</bug_id>
          
          <creation_ts>2017-11-20 06:02:37 +0000</creation_ts>
          <short_desc>glibc-initial do_fetch failed if rm_work is enabled</short_desc>
          <delta_ts>2017-12-21 15:28:32 +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>configuration</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></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mingli Yu">mingli.yu</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>randy.macleod</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>78283</commentid>
    <comment_count>0</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2017-11-20 06:02:37 +0000</bug_when>
    <thetext>Git rev: master/a17f3ec910366e9e7551fa24fbc07929b9584341

Steps:
1. Download the poky source and set the environment
2. Add INHERIT += &quot;rm_work&quot; in conf/local.conf
3. Run &quot;bitbake glibc-initial:do_fetch glibc-initial:do_rm_work&quot;

It sometimes failed as do_rm_work is a floating task when add the logic &quot;deltask do_build&quot; for glibc-initial in below commit. 

http://cgit.openembedded.org/openembedded-core/commit/?id=04c053d42ab05f77b2d1ca93a0fabae44073d57e
=====================================================================
author	Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;	2017-04-05 17:27:20 +0100
committer	Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;	2017-04-08 22:48:05 +0100
commit	04c053d42ab05f77b2d1ca93a0fabae44073d57e (patch)
tree	58227aa83a6f568947415101969bc61cd14768b0
parent	ef16288f3e1e801e5c763ed49fad8eb0c885183e (diff)
download	openembedded-core-04c053d42ab05f77b2d1ca93a0fabae44073d57e.zip
openembedded-core-04c053d42ab05f77b2d1ca93a0fabae44073d57e.tar.gz
openembedded-core-04c053d42ab05f77b2d1ca93a0fabae44073d57e.tar.bz2
glibc/gcc/libgcc-initial: Delete do_build tasks for -initial
We&apos;ve had a lot of users running into RSS issues where -initial recipes
were being installed into sysroots alongside their counterparts and
causing overlapping files issues.

In general this was through do_build dependencies. Such dependencies are
bad in general and I&apos;d encourage people to compare the taskgraphs with
using a more specific dependency like do_populate_sysroot, do_image_complete
or do_deploy as often the more specific dependency will result in a much
cleaner build.
Regardless, we don&apos;t want -initial dependencies getting in the way like
this and there are cases a do_build dependency could make sense.

Deleting the do_build task in these cases makes sense since this is not
a build &quot;endpoint&quot; we&apos;d ever want a user to use, its a behind the scenes
piece of bootstrappping.

Unfortunately to make this work, we need a newer bitbake version which
has a bitbake bug fixed.

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
=====================================================================

Previously, do_rm_work depends on the dependencies which do_build depends on as below logic in meta/classes/rm_work.bbclass
=====================================================================
# Determine what do_build depends upon, without including do_build
    # itself or our own special do_rm_work_all.
    deps = set(bb.build.preceedtask(&apos;do_build&apos;, True, d)) 
    deps.difference_update((&apos;do_build&apos;, &apos;do_rm_work_all&apos;))

    if pn in excludes:
        d.delVarFlag(&apos;rm_work_rootfs&apos;, &apos;cleandirs&apos;)
        d.delVarFlag(&apos;rm_work_populatesdk&apos;, &apos;cleandirs&apos;)
    else:
        # Inject do_rm_work into the tasks of the current recipe such that do_build
        # depends on it and that it runs after all other tasks that block do_build,
        # i.e. after all work on the current recipe is done. The reason for taking
        # this approach instead of making do_rm_work depend on do_build is that
        # do_build inherits additional runtime dependencies on
        # other recipes and thus will typically run much later than completion of
        # work in the recipe itself.
        # In practice, addtask() here merely updates the dependencies.
        bb.build.addtask(&apos;do_rm_work&apos;, &apos;do_build&apos;, &apos; &apos;.join(deps), d)
=====================================================================

When delete do_build task, the dependencies for do_rm_work miss, and do_rm_work becomes a floating task. And it can result in a race condition between do_fetch and do_rm_work.

The error message as below:
NOTE: recipe glibc-initial-2.26-r0: task do_rm_work: Started
NOTE: recipe glibc-initial-2.26-r0: task do_fetch: Started
ERROR: glibc-initial-2.26-r0 do_fetch: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_python_func() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:extend_recipe_sysroot(d)
     0003:
File: &apos;/buildarea/build1/layers/oe-core/meta/classes/staging.bbclass&apos;, lineno: 410, function: extend_recipe_sysroot     0406:    manifests = {}
     0407:    # All files that we&apos;re going to be installing, to find conflicts.
     0408:    fileset = {}
     0409:
 *** 0410:    for f in os.listdir(depdir):
     0411:        if not f.endswith(&quot;.complete&quot;):
     0412:            continue
     0413:        f = depdir + &quot;/&quot; + f
     0414:        if os.path.islink(f) and not os.path.exists(f):
Exception: FileNotFoundError: [Errno 2] No such file or directory: &apos;/buildarea/build1/build/tmp-glibc/work/i586-oe-linux/glibc-initial/2.26-r0/recipe-sysroot-native/installeddeps&apos;

ERROR: glibc-initial-2.26-r0 do_fetch: Function failed: extend_recipe_sysroot
NOTE: recipe glibc-initial-2.26-r0: task do_rm_work: Succeeded
ERROR: Logfile of failure stored in: /buildarea/build1/build/tmp-glibc/work/i586-oe-linux/glibc-initial/2.26-r0/temp/log.do_fetch.3330
NOTE: recipe glibc-initial-2.26-r0: task do_fetch: Failed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78789</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-12-21 15:28:32 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=19b61c8cc62bd9c5b0205e94e397699c72203cd4</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>