| Summary: | utils.py: BB_ENV_WHITELIST doesn't work well | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] BitBake | Reporter: | Robert Yang <liezhi.yang> |
| Component: | bitbake | Assignee: | Robert Yang <liezhi.yang> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | ning.zhang, poky.bs.watcher, poky.watcher, richard.purdie, sgw |
| Version: | 1.4 | ||
| Target Milestone: | 1.4 M6 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
Merged into master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ee416ad6f4b0209f7ad7d54467e0d7d5e097dd2a Verified env:
poky: bdca49274173153b1b0a72887de6321b4756b684
branch: 1.4_M5
Verified steps:
1. setup poky env.
2. input below cli:
export BB_ENV_WHITELIST
export BB_NUMBER_THREADS=10
3. modify conf/local.conf, modify 'BB_NUMBER_THREADS = "4"' to 'BB_NUMBER_THREADS ?= ""'
4. execute: bitbake -e | grep '^BB_NUMBER_THREADS='
log:
builder@pek-yocto-build1:/buildarea3/zn/20130410$ export BB_ENV_WHITELIST
builder@pek-yocto-build1:/buildarea3/zn/20130410$ export BB_NUMBER_THREADS=10
builder@pek-yocto-build1:/buildarea3/zn/20130410$ echo $BB_ENV_WHITELIST
builder@pek-yocto-build1:/buildarea3/zn/20130410$
builder@pek-yocto-build1:/buildarea3/zn/20130410$ echo $BB_NUMBER_THREADS
10
builder@pek-yocto-build1:/buildarea3/zn/20130410$ bitbake -e | grep '^BB_NUMBER_THREADS='
BB_NUMBER_THREADS="10"
builder@pek-yocto-build1:/buildarea3/zn/20130410$
|
The BB_ENV_WHITELIST doesn't work well and flushes BB_ENV_EXTRAWHITE, here is an example: $ export BB_ENV_WHITELIST $ export BB_NUMBER_THREADS=10 (or other value) Edit conf/local.conf, change "BB_NUMBER_THREADS =" to "BB_NUMBER_THREADS ?=" $ bitbake -e | grep '^BB_NUMBER_THREADS =' we will notice that BB_NUMBER_THREADS' value doesn't change, though BB_NUMBER_THREADS in both BB_ENV_WHITELIST and BB_ENV_EXTRAWHITE. This is because in bitbake/lib/bb/utils.py: def approved_variables(): """ Determine and return the list of whitelisted variables which are approved to remain in the envrionment. """ approved = [] if 'BB_ENV_WHITELIST' in os.environ: approved = os.environ['BB_ENV_WHITELIST'].split() else: approved = preserved_envvars() if 'BB_ENV_EXTRAWHITE' in os.environ: approved.extend(os.environ['BB_ENV_EXTRAWHITE'].split()) return approved The "approved" doesn't include BB_ENV_WHITELIST or BB_ENV_EXTRAWHITE when BB_ENV_WHITELIST is set (they are from preserved_envvars()), so the BB_ENV_WHITELIST and BB_ENV_EXTRAWHITE will removed from the env, and when the approved_variables () function is called again by cooker.py, their value will be None, the vars inside them will be removed from the env. Add BB_ENV_WHITELIST and BB_ENV_EXTRAWHITE to the "approved" would fix the problem. I will send a patch sooner.