I am trying to stop poky builds from accessing my $HOME/.ccache directory (which i NFS mounted and thus slower than local disk accesses could be). I set env export CCACHE_DIR to point to the chosen directory, and "ccache -s" confirms that it picks up my new setting. Also, manual runs of ccache show that it works as expected. Then I added CCACHE_DIR to the list of variables in BB_ENV_EXTRAWHITE: $ export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE CCACHE_DIR" I verified (by peeking at BitBaker's /proc/<id>/environ) that this setting gets really used for the build - but BitBaker continues tro access my $HOME/.ccache file.
Try adding "export CCACHE_DIR" to local.conf. You're only added it to bitbake's internal datastore with what you've described so far as far as I can tell.
Confirmed, this works. Thanks a lot! Where can I find such information in the documentation?
We could document CCACHE_DIR in the variables appendix. Is CCACHE_DIR a Poky variable? Also, BB_ENV_EXTRAWHITE is not documented in the Poky Reference Manual.
No response to question "Is CCACHE_DIR a poky variable?" I need more information on this bug.
CCACHE_DIR is not a Poky variable. I'd suggest somewhere in a manual we document the following: """ Bitbake tightly controls the execution environment of the build tasks to ensure that unwanted contamination from the build machine can't influence the build. This means that if you do want something to get passed into the build task's environment there are a few steps. Firstly, you need to tell bitbake to load something from the environment into the data store. This is done by a command like the following to add your variable (CCACHE_DIR in thie example) to BB_ENV_WHITELIST: export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE CCACHE_DIR" You then need to tell bitbake to export this to the task environment of every running task as the above only makes this available in the datastore. You can do this with the following somewhere in the configuration (local.conf, distro config etc.): export CCACHE_DIR The downside of doing this is that bitbake will now record this variable as a dependency of the build process in things like the sstate checksums. If this isn't something that is required, it can be whitelisted as a variable to ignore by adding it to the list of variables in BB_HASHBASE_WHITELIST. """
Updated the "Running a Task" section in the BitBake Appendix of the YP Reference Manual. Previously, this section had a general description of what happens when a task is run and how environment variables are handled. I updated the section to talk specifically about the issue noted in this bug report. I documented the steps the user would need to do to actually move an environment variable's effects from the BB data store into the actual task execution environment. I also included a note at the end of the section warning of the potential downside that could occur during the checksum generation since the variable moved to the task execution environment would now be considered a build dependency. To see the new section look at http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#ref-bitbake-tasklist