]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
build/data: Don't expand python functions before execution [API change]
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 2 Feb 2016 14:07:58 +0000 (14:07 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Feb 2016 13:33:48 +0000 (13:33 +0000)
commit8bf33a8e92c0e188fa392030025756196c96fcbb
tree509681b0ba903825f61d0da99970ea2433be0425
parent3f5520b4844a4bdd615046479ba08ed192bdc8cd
build/data: Don't expand python functions before execution [API change]

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@linuxfoundation.org>
lib/bb/build.py
lib/bb/cooker.py
lib/bb/data.py