<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/bb/data_smart.py, branch yocto-4.2.4</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-4.2.4</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-4.2.4'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2023-01-24T21:59:44+00:00</updated>
<entry>
<title>bitbake: data_smart: Small optimisation to _findVar()</title>
<updated>2023-01-24T21:59:44+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-01-21T12:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=ea12b673cfe5253c2c3baf3325718156b82cad1b'/>
<id>urn:sha1:ea12b673cfe5253c2c3baf3325718156b82cad1b</id>
<content type='text'>
Some users of _findVar don't need the override data and even
getVarFlag doesn't need it in some common cases (parsing=True).

Rearrange the code as the current overridedata approach doesn't need
to be in the _findVar code anyway. This removes some search overhead
from a critical path.

(Bitbake rev: fcb64e1138a20eb19560af3fc5d1fa748cc9cf34)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: Small cache reuse optimization</title>
<updated>2022-11-29T10:25:51+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-11-28T23:42:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=43ef392dc2e85c2f298fdb1ee970708c4c2e79f9'/>
<id>urn:sha1:43ef392dc2e85c2f298fdb1ee970708c4c2e79f9</id>
<content type='text'>
Currently the expand cache doesn't work for "parser" return types, which
is the main type used by the build_dependencies() call that we spend most
of the time in when parsing. Tweak the code to cache the unexpanded value
in the expand cache and hence allow reuse of the parser in other fast path
cases for small speed gains.

(Bitbake rev: b4a8e5071dbcba2217b79e83e08b275ffcbc0eef)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: Use regex consistently for override matching</title>
<updated>2022-11-29T10:25:51+00:00</updated>
<author>
<name>张忠山</name>
<email>zzs213@126.com</email>
</author>
<published>2020-09-30T03:11:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=bdc821a4c34464a56d8a934cea23399790288e83'/>
<id>urn:sha1:bdc821a4c34464a56d8a934cea23399790288e83</id>
<content type='text'>
One section of the code is enforcing lowercase overrides, the other
is allowing numeric characters. We should be consistent with one or
the other.

(Bitbake rev: df5b3b841fd8d6a652d643e9ae2bba09d60043e0)

Signed-off-by: 张忠山 &lt;zzs213@126.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: Add debugging for overrides stability issue</title>
<updated>2022-11-27T23:48:15+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-11-24T16:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0536965bd45670b7024c84f30a79cd652fe87a73'/>
<id>urn:sha1:0536965bd45670b7024c84f30a79cd652fe87a73</id>
<content type='text'>
If someone is unfortunate enough to run into override recursion issues
they're hard to debug with the existing message. We can at least show the
values that OVERRIDES takes to show there is some problem and aid debugging.

(Bitbake rev: 43035b75201616e7bfd680d3d15c5c0fc7c04eb6)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data/data_smart/build: Clean up datastore finalize/update_data references</title>
<updated>2022-11-14T16:22:00+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-11-11T14:23:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=d8e9ee8fd53b7620e72b2dfebb2e8d464b737dbb'/>
<id>urn:sha1:d8e9ee8fd53b7620e72b2dfebb2e8d464b737dbb</id>
<content type='text'>
We dropped the update_data calls a while ago. Clean up the code
to match the reality and drop the remaining no-op pieces. Update
the comments to reflect the slowest operations and let the cookie
monster's spirit live on!

(Bitbake rev: 584989ed2b5af4e8799571dece0cf94f995ef14e)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: allow python snippets to include a dictionary</title>
<updated>2022-11-10T14:43:06+00:00</updated>
<author>
<name>Mark Asselstine</name>
<email>mark.asselstine@windriver.com</email>
</author>
<published>2022-11-07T16:46:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=361ae80a31649594a6be2ae7a237206d18291d67'/>
<id>urn:sha1:361ae80a31649594a6be2ae7a237206d18291d67</id>
<content type='text'>
[YOCTO #14917]

Attempting to use a dictionary in a python code snippet for variable
assignment results in an error. For example attempting something such
as

  IDX = "green"
  VAL = "${@{ 'green': 1, 'blue': 2 }[d.getVar('IDX')]}"

produces the error

  expansion of VAL threw ExpansionError: Failure expanding variable
  VAL, expression was ${@{ 'green': 1, 'blue': 2 }[d.getVar('IDX')]}
  which triggered exception SyntaxError: '{' was never closed (Var
  &lt;VAL&gt;, line 1)

The existing __expand_python_regexp__, "\${@.+?}", will match the
first close curly bracket encountered, resulting in incomplete and
un-parsable code, and thus produce the error. We can correct this by
allowing a single depth of nested curly brackets in
__expand_python_regexp__ by using "\${@(?:{.*?}|.)+?}", which will
match up to and including the matching close curly bracket to the
open, '${@', curly bracket, even if there are one or more singly
nested curly brackets present. This change allows the usecase
described above to function.

This change can't be made on its own though. The old regex would, in
an obscure way, handle the case where a python snippet contained an
unexpandable variable. Since the unexpandable variable is in curly
brackets it would cause incomplete/un-parsable python code and thus
remain unparsed. So something like

  VAL = "${@d.getVar('foo') + ${unsetvar}}"

would remain unparsed as the close curly bracket in "${unsetvar}"
would match and terminate the snippet prematurely. This quirk resulted
in the proper handling of python snippets with unexpanded
variables. With the change to __expand_python_regexp__ the full
snippet will match and be parsed, but to match the old/correct
behavior we would not want to parse it until ${unsetvar} can be
expanded. To ensure the old/correct behavior for python snippets with
unexpanded variables remains in place we add a check for unexpanded
variables in the python snippets before running them.

This handling of unparsed variables brings two benefits. The first we
now have an explicit check visible to all for unexpanded variables
instead of a somewhat hidden behavior. The second is that if there are
multiple python snippets the old behavior would run the code for each
but a single snippet with unexpanded variables would mean all snippets
would remain unparsed, meaning more and repeated processing at a later
time.

For example:
  "${@2*2},${@d.getVar('foo') ${unsetvar}}"
old behavior would give:
  "${@2*2},${@d.getVar('foo') ${unsetvar}}"
new behavior will give:
  "4,${@d.getVar('foo') ${unsetvar}}"

The old behavior would calculate '2*2' but toss the result when the
second snippet would fail to parse resulting in future recalculations
(or fetching from cache), while the new behavior avoids this.

(Bitbake rev: 94e49b9b9e409c29eb04603b1305d96ebe661a4b)

Signed-off-by: Mark Asselstine &lt;mark.asselstine@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: Avoid multiple getVarFlag calls</title>
<updated>2022-03-18T13:17:10+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-03-16T13:57:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=b58049b4e70f896ec60f3f35c28e55b15db3039c'/>
<id>urn:sha1:b58049b4e70f896ec60f3f35c28e55b15db3039c</id>
<content type='text'>
We can call getVarFlags() instead of the multiple getVarFlag calls
which is a little more efficient. This reduces the number of overall
function calls so is good but probably isn't much faster (or slower).

(Bitbake rev: 505a4dd34e822bdf902d9b348dbcdf5b2c94e784)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: Skip commonly accessed variables from variable data context lookup</title>
<updated>2022-03-18T13:17:10+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-03-16T13:32:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=c45c8308006833e80ffa7fa84e647cea44148de0'/>
<id>urn:sha1:c45c8308006833e80ffa7fa84e647cea44148de0</id>
<content type='text'>
The code tries to expand missing entities when they're encountered in
python expressions. Looking at traces, these are often things which
would not be in the data store such as "bb".

Optimise to skip the data store queries for things we know will never
be there. The expansion cache usually covers these but skipping
entirely cuts a few million function calls parsing OE-Core.

(Bitbake rev: 1ae712635a2eef3ecbf541e1f7cc2eeb2f3799c9)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: Avoid exceptions for non string data</title>
<updated>2022-02-22T11:38:18+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-02-22T11:36:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=6c23bd5c8113c1a8feddf2171626cb02e421b71d'/>
<id>urn:sha1:6c23bd5c8113c1a8feddf2171626cb02e421b71d</id>
<content type='text'>
  File "scripts/lib/checklayer/__init__.py", line 49, in _get_layer_collections
    ldata.expandVarref('LAYERDIR')
  File "build/bitbake/lib/bb/data_smart.py", line 1007, in expandVarref
    if referrervalue and ref in referrervalue:
TypeError: argument of type 'bool' is not iterable

We inject True values as an internal sentinel to the datastore, fix
this codepath to handle it.

(Bitbake rev: 3b88562d87ac94725c1a683c859c2a6a3287d173)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: lib/bb: fix exit when found renamed variables</title>
<updated>2022-02-21T23:37:26+00:00</updated>
<author>
<name>Marta Rybczynska</name>
<email>rybczynska@gmail.com</email>
</author>
<published>2022-02-21T17:44:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=da4c443ac5ae7024d053f7e224c576f750a90085'/>
<id>urn:sha1:da4c443ac5ae7024d053f7e224c576f750a90085</id>
<content type='text'>
Until now, if a renamed variable was found, bitbake exited
immediately if it was in a class, but continued after an error
message if the variable was in a recipe. This was caused by
cookerdata.py CookerDataBuilder::parseBaseConfiguration checking
a different DataSmart instance than the variable was set in.
To solve the issue, add a special variable and set it when we
find a renamed variable. Check for it in ast.py and bail out
if needed.

(Bitbake rev: d12400600e30549c88dc9e7883dc3d63b1dc1117)

Signed-off-by: Marta Rybczynska &lt;marta.rybczynska@huawei.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
