[bitbake-devel] [PATCH] build/data: Don't expand python functions before execution [API change]

Christopher Larson kergoth at gmail.com
Tue Feb 2 15:28:25 UTC 2016


On Tuesday, February 2, 2016, Richard Purdie <
richard.purdie at linuxfoundation.org> wrote:

> Right now, if you have some python code like:
>
> X = "a"
>
> def somefunction(d):
>     d.setVar("X", "b")
>     d.setVar("Y", "${X}")
>
> then any sane person would expect that Y = "b" at the end of the
> function. This is not the case, Y = "a".
>
> This is due to the python function being expanded before execution, the
> executed code would read d.setVar("Y", "a"). This understandably
> confuses people, it also makes it near impossible to write ${} in a
> python function without unintended things happening.
>
> I think there is general agreement we should fix this and standardise
> on non-expansion of python functions. We already don't expand anonymous
> python (mostly).
>
> I've checked OE-Core with buildhistory before and after this change and
> there were a small number of issues this exposed which I've sent
> patches for.
>
> I propose we default to not expanding python code and then deal with
> any consequences from that if/as/where identified. This will improve
> new user understanding and usability of the system, it also allows
> several long standing weird expansion issues to be fixed.
>
> Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org
> <javascript:;>>
>

I absolutely support this. It should reduce confusion with no loss of
functionality.

Acked-by: Christopher Larson <kergoth at gmail.com>


-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160202/3290201f/attachment-0002.html>


More information about the bitbake-devel mailing list