Bug 9976

Summary: Suggested addition to 2.3. Debugging Build Failures re. missing build-time dependencies
Product: [Documentation] Reference Reporter: ulfalizer
Component: handbookAssignee: Scott Rifenbark <srifenbark>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Undecided CC: bluelightning, poky.doc.watcher, poky.watcher, srifenbark
Version: 2.2   
Target Milestone: 2.2 M3   
Hardware: x86   
OS: Multiple   
Whiteboard: 19 July 2016: RESOLVED
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Done (doc changes complete)

Description ulfalizer 2016-07-19 13:56:43 UTC
Hello,

I suggest adding the following overview of missing build-time dependencies to 2.3. Debugging Build Failures. It also covers the scripts/wipe-sysroot script, which currently isn't mentioned anywhere in the manuals.

  2.3.3. Checking for missing build-time dependencies
  
  A recipe might build successfully even though some of its build-time
  dependencies are missing from DEPENDS. Here are the two most common ways in
  which that can happen:
  
    1. The build-time dependency just happens to already exist in the staging
       sysroot (STAGING_DIR_HOST) by the time the recipe is built. This happens
       if the build-time dependency is built earlier, while processing other
       recipes.
  
    2. The component built by the recipe conditionally enables functionality
       depending on whether it can find the build-time dependency in the staging
       sysroot. If the build-time dependency is missing, the corresponding
       functionality is disabled. This is known as a <i>floating dependency</i>.
  
  Dealing with the second case is more complex, so we will focus on the first
  case.
  
  The [<code>build-deps</code>](http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#ref-classes-insane)
  QA check checks that every library the component linked against was declared as
  a build-time dependency. If this is not the case, then we must have the
  situation described in (1), and a missing build-time dependency is reported.
  
  Another, more manual, way to check a recipe for missing build-time dependencies
  of the first type is to build it with an empty staging sysroot. An easy way to
  do this is to simply remove TMPDIR (usually ${BUILDDIR}/tmp), as it includes
  the staging sysroots.
  
  Another, faster method to remove the staging sysroot is to use the
  <code>scripts/wipe-sysroot</code> script, which removes just the staging
  sysroots and keeps everything else in TMPDIR. Note that the
  <code>scripts/<code> directory appears PATH after running
  <code>oe-init-build-env</code> or <code>oe-init-build-env-memres</code>,
  meaning 'wipe-sysroot' can be run right away.

Cheers,
Ulf
Comment 1 Scott Rifenbark 2016-07-19 17:09:25 UTC
Hi Ulf, 

Here is the new 2.3.3 section - http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#checking-for-missing-build-time-dependencies. 

Check it out.

Thanks!

Scott
Comment 2 ulfalizer 2016-07-19 17:22:36 UTC
Some feedback below:

  - The comma after "because" looks weird to me.

  - Maybe this would be a bit clearer: "If that is not the case, then
    the first situation described in the previous list exists, and
    <code>build-deps</code> reports a missing build-time dependency."

  - There's a missing opening parenthesis in "${BUILDDIR}/tmp)".

Cheers,
Ulf
Comment 3 Scott Rifenbark 2016-07-19 18:09:44 UTC
Ulf, 

Thanks... 

Change 1 is better as your wrote it.

Change 2 did not need the trailing parenthesis as the "which" clause covers it. 

Scott

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#checking-for-missing-build-time-dependencies
Comment 4 ulfalizer 2016-07-19 18:20:06 UTC
Comma after "because" still feels a bit weird to me, but I'm fine with it.

Thanks,
Ulf
Comment 5 ulfalizer 2016-07-19 18:31:58 UTC
Thought of one more thing that might be nice to add. Could the last part, before the note, be rewritten as follows?

  Another, more manual, way to check a recipe for missing build-time
  dependencies of the first type is to build with an empty staging
  sysroot. This method can also find missing build-time dependencies
  that are not in the form of libraries, which the
  <code>build-deps</build> QA check is unable to.

  An easy way to empty the staging sysroots is to simply remove TMPDIR,
  which is usually ${BUILDDIR}/tmp, as it includes the staging sysroots.
  Another, faster method is to use the scripts/wipe-sysroot script,
  which removes just the staging sysroots and keeps everything else in
  TMPDIR.
Comment 6 Scott Rifenbark 2016-07-19 18:53:36 UTC
Ulf, 

Sorry, I completely ignored that weird comma... it is now removed as it was not supposed to be there. 

The other change is here - http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#checking-for-missing-build-time-dependencies

Let me know, 
Scott
Comment 7 ulfalizer 2016-07-19 18:56:34 UTC
LGTM

Thanks,
Ulf
Comment 8 Scott Rifenbark 2016-07-19 18:58:35 UTC
Closing... 


Scott