[yocto] bitbake: DataSmart.expandWithRefs causing exception when handed "${@...}"
Richard Purdie
richard.purdie at linuxfoundation.org
Tue Jan 15 05:38:54 PST 2019
On Sun, 2019-01-13 at 22:53 +0100, Ulf Samuelsson wrote:
> I am trying to add a new image class "SWU" in "sumo" for a "software
> update image".
> As a result:
> do_sdk_depends[depends] = '${@get_ext_sdk_depends(d)} meta-extsdk-
> toolchain:do_populate_sysroot'
>
> When data_smart.py works on this, it will call
>
> DataSmart.expandWithRefs(self, s, varname)
> s = '${@get_ext_sdk_depends(d)} meta-extsdk-
> toolchain:do_populate_sysroot'
> varname = 'do_sdk_depends[depends]'
>
> I will get an exception in this statement:
>
> while s.find('${') != -1:
> olds = s
> try:
> s = __expand_var_regexp__.sub(varparse.var_sub, s)
>
> The definition of __expand_var_regexp__ is:
> __expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}")
>
> That is, it is looking for the string "${<X>}"
> but <X> may not contains anything in [{}@\n\t :]
>
> since the "variable" in "s" is actually a call to
> get_ext_sdk_depends,
> and thus contains a '@' character it is not matched.
>
> The build aborts with an exception.
>
> I am not sure, if '${@get_ext_sdk_depends(d)}' should be expanded
> before
> DataSmart,expandWithRefs, or if expandWithRefs needs to be extended
> to handle the case where the variable is a "call".
>
> This is blocking us from upgrading from pyro to sumo.
>
> Any ideas on a solution?
Can you firstly say what the error is you're seeing. Your attempt to
understand it is good but I'm not sure which error you see?
Secondly, is there a way someone else could reproduce this bug?
The fragment you quote looks correct. If you have variable and function
names conflicting that would be a problem though as they're all in the
same namespace. I'm unclear whether that is a problem here or not
though based on the available information.
Cheers,
Richard
More information about the yocto
mailing list