[bitbake-devel] [PATCH 2/3] lib/bb/command.py: ensure setVariable only sets values as strings

Chris Larson clarson at kergoth.com
Tue Sep 11 22:57:24 UTC 2012


On Tue, Sep 11, 2012 at 9:52 AM, Paul Eggleton
<paul.eggleton at linux.intel.com> wrote:
> This is the interface Hob uses to set variable values in many instances,
> and at the moment it is possible that some of the values it passes are
> not strings. If a non-string value gets into the datastore it can
> trigger exceptions during parsing when we attempt to expand the variable
> and substitute in the non-string value.
>
> This fixes using the meta-ti layer within Hob - it currently has a
> reference to BB_NUMBER_THREADS within a shell function and since this
> is a variable that Hob was setting from its configuration as an integer,
> due to the above this was triggering an ExpansionError.

This is probably a good change, but I think that failing expansion due
to a non-string value is a bad behavior in bitbake. I think it should
call str() on it as appropriate, as that's the most idiomatic
solution: Don't check if something is a string, don't require only
strings, but call str() to get your string
-- 
Christopher Larson




More information about the bitbake-devel mailing list