Bug 10297

Summary: Two suggested notes in the Other Tips section re. removing tmp/ and searching
Product: [Documentation] Reference Reporter: ulfalizer
Component: handbookAssignee: Scott Rifenbark <srifenbark>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning, poky.doc.watcher, poky.watcher, sgw, srifenbark
Version: 2.2   
Target Milestone: 2.2 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: 22 Sept 2016: RESOLVED
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Done (doc changes complete)

Description ulfalizer 2016-09-17 03:22:27 UTC
Hello again,

Here's two suggested notes to add after the existing notes in
'2.3.12. Other Tips'.

1. Removing tmp/ often fixes temporary issues. This hint could be added:

  * Removing [TMPDIR] (usually tmp/, within the
    [Build Directory](http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#build-directory))
    can often fix temporary build issues. Removing TMPDIR is usually a
    relatively cheap operation, because task output will be cached in
    [SSTATE_DIR](http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-SSTATE_DIR)
    (usually sstate-cache/, also in the Build Directory).

    Note that removing TMPDIR might be a workaround rather than a fix. Trying
    to determine the underlying cause of an issue is a good idea.


2. To encourage people to search through existing recipes and classes, I think it
would help if we provided a small helper function. Feel free to leave out the
last part if you think it might lead to unproductive spam. :)

  * Seeing how a feature is used in practice in existing recipes is
    often very helpful. It is recommended that you configure some method that
    always you to quickly search through files.
    
    Using GNU Grep, the shell function below can be used to recursively search
    through common recipe-related files, skipping binary files, .git
    directories, and the build directory (assuming its name starts with
    "build"):

      g() {
          grep -Ir \
               --exclude-dir=.git \
               --exclude-dir='build*' \
               --include='*.bb*' \
               --include='*.inc*' \
               --include='*.conf*' \
               --include='*.py*' \
               "$@"
      }

    Below are some usage examples:

      $ g FOO    # Search recursively for "FOO"
      $ g -i foo # Search recursively for "foo", ignoring case
      $ g -w FOO # Search recursively for "FOO" as a word, ignoring e.g. "FOOBAR"

    If figuring out how some feature works requires a lot of searching, it
    might indicate that the documentation should be extended or improved.
    Consider filing a documentation bug at our
    [Bugzilla](https://bugzilla.yoctoproject.org/) in that case. Note that the
    manuals might not be the right place to document variables that are purely
    internal and have a limited scope (e.g. internal variables used to
    implement a single .bbclass file).


Cheers,
Ulf
Comment 1 Scott Rifenbark 2016-09-21 23:10:16 UTC
Ulf, 

Nice tips... 

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#usingpoky-debugging-others

Thanks, 
Scott
Comment 2 ulfalizer 2016-09-22 05:21:16 UTC
Looks good to me!

Thanks,
Ulf
Comment 3 Scott Rifenbark 2016-09-22 23:10:50 UTC
Setting status to RESOLVED and doc flag to "done."

Scott