Bug 10131 - Suggested rewriting of '2.3.5. Dependency Graphs'
Summary: Suggested rewriting of '2.3.5. Dependency Graphs'
Status: RESOLVED FIXED
Alias: None
Product: Reference
Classification: Documentation
Component: handbook (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 2.2 M4
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 12 July 2016: RESOLVED
Depends on:
Blocks:
 
Reported: 2016-08-12 09:39 UTC by ulfalizer
Modified: 2016-08-12 21:52 UTC (History)
5 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-12 09:39:11 UTC
Hello,

Nothing currently hints at that the .dot files are easy to read directly in a text editor. The resulting graphs are completely unreadable without pruning and processing, so knowing this can be extremely useful.

I suggest the following changes:

 * Move '2.3.5. Dependency Graphs' to 2.3.3. and rename it to "2.3.3. Viewing Dependencies". This makes the name consistent with the sections above it.

 * Rewrite it as follows:

  Sometimes it can be hard to see why BitBake wants to build other recipes before
  the one you have specified. To generate dependency information for a recipe,
  run the following command:
  
    $ bitbake -g recipename
  
  This command writes the following files in the current directory:
  
    * pn-buildlist: A list of recipes/targets involved in building `recipename`.
      "Involved" here means that at least one task from the recipe would need to
      run when building `recipename` from scratch. Targets that are in
      [ASSUME_PROVIDED] are not listed.
  
    * pn-depends.dot: A graph showing dependencies between build-time targets
      (recipes).
  
    * package-depends.dot: A graph showing (known) dependencies between runtime
      targets.
  
    * task-depends.dot: A graph showing dependencies between tasks.
  
  The graphs are in
  [DOT](https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29)
  format and can be converted to images using e.g. the 'dot' tool from
  [Graphviz](http://www.graphviz.org/).
  
  Note {
  DOT files use a plain text format. The graphs generated by 'bitbake -g' are
  often so large as to be impossible to read without special pruning (e.g. with
  bitbake's -I option) and processing, but the corresponding .dot files are often
  still easy to read and can provide useful information.
  
  As an example, task-depends.dot contains lines like the following:
  
    "libxslt.do_configure" -> "libxml2.do_populate_sysroot"
  
  The above line tells us that libxslt's do_configure task depends on libxml2's
  do_populate_sysroot task (a normal [DEPENDS] dependency between the recipes).
  }
  
  A different way to view dependency information is with the following command:
  
    $ bitbake -g -u depexp recipename
  
  This will pop up a GUI window where build- and runtime dependencies can be
  viewed for the recipes involved in building recipename.


I originally wanted to document exactly what information pn-depends.dot and package-depends.dot contain as well, but to be honest it escapes me (and I got frustrated trying to reverse-engineer it). It's not clear at all what stuff like "virtual:native:" and filled vs. dashed vs. dotted edges means. A much more concrete and detailed description is needed, but that's for another ticket in that case.

Cheers,
Ulf
Comment 1 ulfalizer 2016-08-12 10:03:11 UTC
Nit - could get rid of the "often" below. Two "oftens" looks bad.

  ...but the corresponding .dot files are often still
  easy to read and can provide useful information.

Cheers,
Ulf
Comment 2 Scott Rifenbark 2016-08-12 20:23:02 UTC
Ulf, 

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#usingpoky-viewing-dependencies for the renamed and moved section.

thanks,
Scott
Comment 3 ulfalizer 2016-08-12 20:34:42 UTC
Thanks! Some nits below:

* The problem is usually to figure out why a recipe is built at all, so "dependency information can help you understand recipe build order" might be better as "dependency information can help you understand why a recipe is built".

* There's a missing closing parenthesis here:

  The graphs are in DOT format and can be converted to images (e.g. using
  the "dot" tool from Graphviz.

In addition, "dot" could use code highlighting instead of quotes.

* "Despite the form and size of the files, ..." should be "Despite the form and size of the graphs, ..."

Looks fine other than that.

Cheers,
Ulf
Comment 4 ulfalizer 2016-08-12 21:07:56 UTC
Thought of one more thing. The Note box could be turned into a Notes box and one more note added:

 * For an example of how .dot files can be processed, see the
   scripts/contrib/graph-tool Python script, which finds and displays
   paths between graph nodes.

That script is pretty useful in itself too, so providing an example is a good excuse to mention it. :)

Cheers,
Ulf
Comment 5 Scott Rifenbark 2016-08-12 21:47:03 UTC
Ulf, 

I think I got everything - http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#usingpoky-viewing-dependencies

Scott
Comment 6 ulfalizer 2016-08-12 21:49:22 UTC
Yup - looks like it. I'm fine with it now.

Thanks,
Ulf
Comment 7 Scott Rifenbark 2016-08-12 21:52:20 UTC
Setting to RESOLVED and turning doc flag to "done".

scott