Bug 5384

Summary: bitbake does not expand subshell instruction call in conf/local.conf
Product: [Build System, Metadata & Runtime] BitBake Reporter: Keller Eric <keller.eric>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED NOTABUG QA Contact:
Severity: minor    
Priority: Low CC: poky.bs.watcher, poky.watcher, sgw
Version: 1.5.1   
Target Milestone: 1.6   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
bitbake traceback none

Description Keller Eric 2013-10-24 23:40:41 UTC
Created attachment 1579 [details]
bitbake traceback

using:
grep BB_NUMBER_THREADS conf/local.conf
BB_NUMBER_THREADS ?= "$(grep -i 'model name' /proc/cpuinfo | wc -l)"
PARALLEL_MAKE ?= "-j ${BB_NUMBER_THREADS}"

bitbake does not expand the BB_NUMBER_THREADS variable when setting it.

see attached traceback
Comment 1 Richard Purdie 2013-11-25 16:21:50 UTC
You can't put shell code into a bitbake variable like that. There is no such shell expansion syntax as $(). You could declare a python function:

def get_threads(d):
    import commands
    o = commands.getstatusoutput("grep -i 'model name' /proc/cpuinfo | wc -l")
    return o

BB_NUMBER_THREADS = "${@get_threads(d)}"

or something like that anyway...