[yocto] Expansion of variables inside do_package_prepend task

Iván Castell icastell at nayarsystems.com
Thu Feb 22 08:11:32 PST 2018


2018-02-21 17:17 GMT+01:00 Joshua Watt <jpewhacker at gmail.com>:

> On Wed, 2018-02-21 at 16:50 +0100, Iván Castell wrote:
>
> Hello forum.
>
> I have a question regarding the expansion of variables in a recipe.
> Suppose I have a recipe with this "do_install" task defined:
>
>     do_install() {
>         BBB = ${WORKDIR}
>     }
>
> Variable BBB expands to the proper working directory.
>
>     $ bitbake -e <myrecipe> | grep BBB
>     BBB = /path/to/working/directory
>
>
> However, suppose now I have a recipe with this "do_package_prepend" task
> defined:
>
>     do_package_prepend() {
>         AAA = ${WORKDIR}
>     }
>
> Variable AAA doesn't expand to the expected working directory. In fact, it
> generates an error:
>
>     $ bitbake -e <myrecipe> | grep AAA
>     AAA = ${WORKDIR}
>           ^
>     SyntaxError: invalid syntax
>
>
> do_package is a python function, so you prepend code must also be python.
> You can do:
>
> AAA = d.getVar('WORKDIR')
>
>

Im sorry for asking an obvious question, but documentation is not very
clear. I wrongly assumed that each recipe was executed by the same
interpreter, and seems I was wrong. Then each task is executed by a
different interpreter. This has sense... Thank you very much for the
clarification and for your time! :-)



>
>
> It seems the expansion of variables is not working inside the
> do_package_prepend task.
> What is going wrong with that?
>
> Thank you in advance! :-)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180222/7d78f8ea/attachment.html>


More information about the yocto mailing list