documentation/poky-ref-manual/ref-bitbake.xml: Updated BitBake Running a Task

I added more information about how BitBake actually runs a task.
The information has to do with how tightly BB controls the execution
environment of the build tasks to prevent contamination from the
build machine from leaking into the task execution environment.
This tight control actually causes some unexpected behavior during
builds.  For example, when a user exports and BB_ENV_EXTRAWHITE
an environment item such as CCACHE_DIR, the effects of the environment
item never make it to the BB task execution environment.  They only
make it to the data store.  The user actually has to take some extra
steps to export that environment item into the task execution environment.
The added information I put into the "Running a Task" section describes
these extra steps.

Fixes [YOCTO #689]
Reported-by: Wolfgang Denk <wd@denx.de>
(From yocto-docs rev: f75a9d384c0d5ccaefe7ac2195917531b153cf5e)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark 2011-12-14 15:36:47 -08:00 committed by Richard Purdie
parent 43fb63af31
commit 85408dfd36
1 changed files with 43 additions and 1 deletions

View File

@ -260,8 +260,50 @@
<para>
Once all the tasks have been completed BitBake exits.
</para>
</section>
<para>
When running a task, BitBake tightly controls the execution environment
of the build tasks to make sure unwanted contamination from the build machine
cannot influence the build.
Consequently, if you do want something to get passed into the build
task's environment, you must take a few steps:
<orderedlist>
<listitem><para>Tell BitBake to load what you want from the environment
into the data store.
You can do so through the <filename>BB_ENV_WHITELIST</filename>
variable.
For example, assume you want to prevent the build system from
accessing your <filename>$HOME/.ccache</filename> directory.
The following command tells BitBake to load
<filename>CCACHE_DIR</filename> from the environment into the data
store:
<literallayout class='monospaced'>
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE CCACHE_DIR"
</literallayout></para></listitem>
<listitem><para>Tell BitBake to export what you have loaded into the
environment store to the task environment of every running task.
Loading something from the environment into the data store
(previous step) only makes it available in the datastore.
To export it to the task environment of every running task,
use a command similar to the following in your
<filename>local.conf</filename> or distro configuration file:
<literallayout class='monospaced'>
export CCACHE_DIR
</literallayout></para></listitem>
</orderedlist>
</para>
<note>
A side effect of the previous steps is that BitBake records the variable
as a dependency of the build process in things like the shared state
checksums.
If doing so results in unnecessary rebuilds of tasks, you can whitelist the
variable so that the shared state code ignores the dependency when it creates
checksums.
For information on this process, see the <filename>BB_HASHBASE_WHITELIST</filename>
example in <xref linkend='checksums'>Checksums (Signatures)</xref>.
</note>
</section>
<section id='ref-bitbake-commandline'>
<title>BitBake Command Line</title>