Bug 10117 - Suggested rewriting to make '3.9.1. Dependencies Internal to the .bb File' less misleading
Summary: Suggested rewriting to make '3.9.1. Dependencies Internal to the .bb File' le...
Status: RESOLVED FIXED
Alias: None
Product: BitBake User Manual
Classification: Documentation
Component: bitbake-manual (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 2.2 M4
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 12 August 2016: IN PROGRESS REVIEW
Depends on:
Blocks:
 
Reported: 2016-08-11 16:58 UTC by ulfalizer
Modified: 2016-08-12 21:50 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfalizer 2016-08-11 16:58:00 UTC
Hello,

I think the note I added to the end of '3.9.1. Dependencies Internal to the .bb File' is a bit misleading in retrospect. The problem is that it implies that the do_build task of a recipe always runs provided any task within it runs, which is false. Just as for other tasks, the do_build task only runs if something depends on it.

As a practical example, if foo.bb has a DEPENDS on bar.bb, then 'bitbake foo' will usually only run tasks up to bar:do_populate_sysroot and not run bar:do_build.

Below is a suggested rewriting that should hopefully be less misleading. It also adds some information and consistently refers to the task with the "do_" prefix. It's just 'addtask' that lets you leave off the "do_".


  ... (Beginning same as before.)

  In this example, the do_printdate task depends on the completion of the
  do_fetch task, and the do_build task depends on the completion of the
  do_printdate task.
  
  Note {
  For a task to run, it must be a direct or indirect dependency of some other
  task that's scheduled to run. For illustration, here are some examples:
  
    * The directive 'addtask mytask before do_configure' causes do_mytask to
      run before do_configure runs. Note that do_mytask will still only run if
      its [input checksum](http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#checksums)
      has changed since the last time it was run. Changes to the input signature
      of do_mytask also indirectly cause do_configure to run.
  
    * The directive 'addtask mytask after do_configure' by itself never
      causes do_mytask to run. do_mytask can still be run manually as
      follows:
  
        $ bitbake recipe -c mytask
  
      Declaring do_mytask as a dependency of some other task that's scheduled
      to run will also cause it to run. Regardless, it will run after
      do_configure.
 

Cheers,
Ulf
Comment 1 ulfalizer 2016-08-11 16:58:36 UTC
That note was added in https://bugzilla.yoctoproject.org/show_bug.cgi?id=9861 by the way.
Comment 2 Scott Rifenbark 2016-08-12 16:21:06 UTC
Hi Ulf, 

See http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#dependencies-internal-to-the-bb-file for the updates and let me know. 

Scott
Comment 3 ulfalizer 2016-08-12 17:48:45 UTC
"Checksums value" sounds a bit weird to me. I think I found a better way to put it too, that avoids potential confusion over "checksum" vs. "input signature" (which are the same thing).

I'd replace

  Be aware that do_mytask still runs only if its checksums value has changed
  since the last time the task was run. Changes to the input signature of
  do_mytask also indirectly cause do_configure to run.

with

  Be aware that do_mytask still only runs if its [input checksum] has changed
  since the last time it was run. Changes to the input checksum of do_mytask
  also indirectly cause do_configure to run.

Cheers,
Ulf
Comment 5 ulfalizer 2016-08-12 21:36:19 UTC
Looks good to me now.

Thanks,
Ulf
Comment 6 Scott Rifenbark 2016-08-12 21:50:20 UTC
Setting the RESOLVED and putting doc flag to "done."

Scott