<?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>8405</bug_id>
          
          <creation_ts>2015-09-28 14:13:52 +0000</creation_ts>
          <short_desc>Automated cascaded cleaning</short_desc>
          <delta_ts>2015-10-01 12:48: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>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Igor Stoppa">igor.stoppa</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54727</commentid>
    <comment_count>0</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2015-09-28 14:13:52 +0000</bug_when>
    <thetext>Scenario
--------

When dealing with multiple recipes having dependency, ex:

A -&gt; B -&gt; C -&gt; D -&gt; ..

one might have to clean all those along the dependency path, ex:

in the previous case I should issue

bitbake -c clean A; bitbake -c clean B; bitbake -c clean C

if it&apos;s desired to rebuild C and all those recipes that use it.



Problem
-------

This can be difficult / complex when using lots of nested/interlinked recipes and classes.

bitbake -g A can help, but it stil lrequires manual work and the outcome can vary, as it&apos;s based on human work.




Proposed solution
-----------------

It would be more effective if it was possible to issue a command like:

bitbake -c clean C A

meaning: clean C and everything that is in the dependency path between A and C</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54788</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-09-29 15:00:35 +0000</bug_when>
    <thetext>Having to explicitly clean sounds like a bug in the recipe, state shouldn&apos;t be preserved between builds.  Possibly you should reduce this problem down to a minimal example and file a concrete bug.

Note that if B depends on A and A is rebuilt then B onwards will all re-execute from do_configure.  If those recipes are well behaved and do a clean before configure then you&apos;ve got the behaviour you want already (for example, autotools.bbclass does out of tree builds and deletes $B before running configure).

Finally you can execute multiple cleans in a single invocation by doing &quot;bitbake A:do_clean B:do_clean C:do_clean&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54801</commentid>
    <comment_count>2</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2015-09-30 06:13:08 +0000</bug_when>
    <thetext>@Ross: I understand and agree with what you are saying.

The difficult part is &quot;you should reduce this problem down to a minimal example&quot;.

Unfortunately it&apos;s not uncommon to find broken recipes, it just happens.

This proposition was an attempt at working around the problem.

Perhaps a better way would have been to ask: if there is any automated way of pinpointing a recipe with broken dependency, without going manually through the .dot file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54805</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-09-30 07:04:02 +0000</bug_when>
    <thetext>We did a lot of work recently with fixing this sort of problem, which is why most recipes will clean before configuring.  Generally it&apos;s the recipe that breaks that needs to be doing the clean if it isn&apos;t already.  If you find a recipe in oe-core that breaks on rebuilds please do file a bug/patch.

Of course, using rm_work will make the problem disappear entirely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54866</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-10-01 12:48:32 +0000</bug_when>
    <thetext>In case its not clear, you can already run &quot;bitbake A B C -c clean&quot;, it will run the do_clean tasks for A, B and C. What it won&apos;t do is run clean for any dependencies, or dependees.

If you wanted to trigger a rebuild of all dependees, you can do &quot;bitbake C -f; bitbake A&quot;, which will then cause anything depending on C to rebuild, including A which you&apos;ve then built.

I can&apos;t really see how we&apos;d add a commandline option which could describe what you&apos;re after, nor have I seen much demand for it from users in general, the -f taint option is probably as close as we can get.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>