Bug 10298 - Suggested DEPENDS update to demystify the implementation and give more examples
Summary: Suggested DEPENDS update to demystify the implementation and give more examples
Status: RESOLVED FIXED
Alias: None
Product: Reference
Classification: Documentation
Component: handbook (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.2 M4
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 26 Sept 2016: RESOLVED
Depends on:
Blocks:
 
Reported: 2016-09-17 04:46 UTC by ulfalizer
Modified: 2016-09-26 16:05 UTC (History)
4 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-09-17 04:46:01 UTC
Hello,

Here's a suggested update to the DEPENDS glossary entry that tries to demystify
the implementation, makes the description similar in structure to the RDEPENDS
glossary entry, and adds another example. It replaces everything before the
notes.

  Lists a recipe's build-time dependencies. These are other recipes whose
  contents (e.g. headers and shared libraries) are needed by the recipe at
  build time.
  
  As an example, consider a recipe foo that contains the following assignment:
  
    DEPENDS = "bar"
  
  The practical effect of the above assignment is that all files installed by
  bar will be available in the appropriate staging sysroot (see the
  [STAGING_DIR*](http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-STAGING_DIR)
  variables) by the
  time foo's [do_configure] task runs. This is implemented by having
  do_configure depend on the [do_populate_sysroot] task of each recipe listed
  in DEPENDS (through a
  [[deptask]](https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#variable-flags)
  declaration in [base.bbclass]).
  
  Note that it seldom is necessary to reference e.g. STAGING_DIR_HOST
  explicitly. The standard classes and build-related variables are configured
  to automatically use the appropriate staging sysroots.

  As another example, DEPENDS can also be used to add utilities that run on the
  build machine during the build. For example, a recipe that makes use of a
  code generator built by the recipe 'codegen' might have the following:

    DEPENDS = "codegen-native"

  See [native.bbclass] and [EXTRANATIVEPATH].


Cheers,
Ulf
Comment 1 Scott Rifenbark 2016-09-22 16:09:36 UTC
Hi Ulf, 

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-DEPENDS for the updates. 

Thanks, 
Scott
Comment 2 ulfalizer 2016-09-22 16:52:25 UTC
Hello,

* I think the second sentence would be a bit easier to understand (especially
  to many non-native speakers) without the "on":

    These are other recipes whose contents (e.g. headers and shared libraries)
    are needed by the recipe at build time.

* "(i.e. STAGING_DIR* variables)" ought to be "(i.e. STAGING_DIR* variable)" (singular)

* Maybe a comma before "through a [deptask] declaration in the base class" would give some breathing room. :)

Thanks,
Ulf
Comment 3 ulfalizer 2016-09-22 17:26:05 UTC
Hmm... I guess plural works too for

  (i.e. STAGING_DIR* variables)

, since some of the variables could be the same. It seems a bit cryptic though. 

How about the following?

  (given by the STAGING_DIR* variables)

Cheers,
Ulf
Comment 4 Scott Rifenbark 2016-09-22 23:17:33 UTC
Ulf, 

I am assuming this is what you were suggesting (http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-DEPENDS).  I took it out of the () construct and let it flow with the sentence. 

Thanks, 
Scott
Comment 5 ulfalizer 2016-09-23 09:02:26 UTC
(In reply to comment #4)
> Ulf, 
> 
> I am assuming this is what you were suggesting
> (http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> DEPENDS).  I took it out of the () construct and let it flow with the
> sentence. 
> 
> Thanks, 
> Scott

Looks good.


How about writing

  Lists a recipe's build-time dependencies. These are dependencies on other
  recipes whose...

instead of

  Lists a recipe's build-time dependencies. These dependencies are on other
  recipes whose... 

?

For some reason the first version makes my brain think there's an extra indirection there when I read it quickly.


Maybe a comma could be added to

 This mechanism is implemented by having do_configure depend on the
 do_populate_sysroot task of each recipe listed in DEPENDS through a
 [deptask]declaration in the base class.

as well, making it

 This mechanism is implemented by having do_configure depend on the
 do_populate_sysroot task of each recipe listed in DEPENDS, through a
 [deptask]declaration in the base class.


Cheers,
Ulf
Comment 6 Scott Rifenbark 2016-09-23 16:01:41 UTC
Ulf, 

That is cool.. changes in.  See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-DEPENDS.

Thanks, 
Scott
Comment 7 ulfalizer 2016-09-23 16:55:43 UTC
(In reply to comment #6)
> Ulf, 
> 
> That is cool.. changes in.  See
> http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-DEPENDS.
> 
> Thanks, 
> Scott

I'm fine with it now. ty!

Cheers,
Ulf
Comment 8 Scott Rifenbark 2016-09-23 18:27:54 UTC
Thanks, 

Setting to RESOLVED and putting the doc flag to "done."

Scott
Comment 9 ulfalizer 2016-09-23 18:49:40 UTC
Sorry... saw one more small nit. Could close right away afterwards whether you
agree or not. I'm a bit extra OCD when it comes to variables that are likely
to be looked up a ton. :)

I'd add two more commas and rephrase slightly, to turn 

  The practical effect of the previous assignment is that all files installed
  by bar will be available in the appropriate staging sysroot given by the
  STAGING_DIR* variables by the time the do_configure task for foo runs.

into

  The practical effect of the previous assignment is that all files installed
  by bar will be available in the appropriate staging sysroot, given by the
  STAGING_DIR* variables, by the time foo's do_configure task runs.

Cheers,
Ulf
Comment 10 Scott Rifenbark 2016-09-26 16:05:11 UTC
Ok - Changed it.  Left the last structure as was so I could avoid "foo's" since I format "foo".  See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-DEPENDS

Setting to RESOLVED again.

Scott