<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>4031</bug_id>
          
          <creation_ts>2013-03-15 10:19:56 +0000</creation_ts>
          <short_desc>utils.py: BB_ENV_WHITELIST doesn&apos;t work well</short_desc>
          <delta_ts>2013-04-10 06:12:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.4 M6</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>ning.zhang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>30750</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-03-15 10:19:56 +0000</bug_when>
    <thetext>The BB_ENV_WHITELIST doesn&apos;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 &quot;BB_NUMBER_THREADS =&quot; to &quot;BB_NUMBER_THREADS ?=&quot;

$ bitbake -e | grep &apos;^BB_NUMBER_THREADS =&apos;
 we will notice that BB_NUMBER_THREADS&apos; value doesn&apos;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():
    &quot;&quot;&quot;
    Determine and return the list of whitelisted variables which are approved
    to remain in the envrionment.
    &quot;&quot;&quot;
    approved = []
    if &apos;BB_ENV_WHITELIST&apos; in os.environ:
        approved = os.environ[&apos;BB_ENV_WHITELIST&apos;].split()
    else:
        approved = preserved_envvars()
    if &apos;BB_ENV_EXTRAWHITE&apos; in os.environ:
        approved.extend(os.environ[&apos;BB_ENV_EXTRAWHITE&apos;].split())
    return approved

The &quot;approved&quot; doesn&apos;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 &quot;approved&quot; would fix the problem. I will send a patch sooner.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30883</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-03-20 06:18:11 +0000</bug_when>
    <thetext>Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ee416ad6f4b0209f7ad7d54467e0d7d5e097dd2a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31789</commentid>
    <comment_count>2</comment_count>
    <who name="Ning Zhang">ning.zhang</who>
    <bug_when>2013-04-10 06:12:08 +0000</bug_when>
    <thetext>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 &apos;BB_NUMBER_THREADS = &quot;4&quot;&apos; to &apos;BB_NUMBER_THREADS ?= &quot;&quot;&apos;
4. execute: bitbake -e | grep &apos;^BB_NUMBER_THREADS=&apos;

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 &apos;^BB_NUMBER_THREADS=&apos;
BB_NUMBER_THREADS=&quot;10&quot;
builder@pek-yocto-build1:/buildarea3/zn/20130410$</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>