<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/bb/data_smart.py, branch styhead-5.1.4</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=styhead-5.1.4</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=styhead-5.1.4'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2024-08-03T10:37:47+00:00</updated>
<entry>
<title>bitbake: data_smart: Improve performance for VariableHistory</title>
<updated>2024-08-03T10:37:47+00:00</updated>
<author>
<name>Robert Yang</name>
<email>liezhi.yang@windriver.com</email>
</author>
<published>2024-07-28T03:39:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=6568b7aac5493d17ceaf8a9e9e553cce46b026f3'/>
<id>urn:sha1:6568b7aac5493d17ceaf8a9e9e553cce46b026f3</id>
<content type='text'>
Fixed:
- BBMULTICONFIG = "qemux86-64 qemuarm64" and more than 70 layers in BBLAYERS
$ bitbake -p -P
Check profile.log.processed, the record() cost more than 20 seconds, it is less
than 1 second when multiconfig is not enabled, and there would be the following
error when more muticonfigs are enabled:

Timeout while waiting for a reply from the bitbake server

Don't change the type of loginfo['detail'] or re-assign it can make record()
back to less than 1 second, this won't affect COW since loginfo is a mutable
type.

The time mainly affected by two factors:
1) The number of enabled layers, nearly 1 second added per layer when the
   number is larger than 50.

2) The global var such as USER_CLASSES, about 1 ~ 2 seconds added per layer
   when the layers number is larger than 50.

(Bitbake rev: 0596aa0d5b0e4ed3db11b5bd560f1d3439963a41)

Signed-off-by: Robert Yang &lt;liezhi.yang@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: directly check for methodpool functions in context lookup</title>
<updated>2023-08-04T10:37:56+00:00</updated>
<author>
<name>Christopher Larson</name>
<email>kergoth@gmail.com</email>
</author>
<published>2022-03-17T22:29:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=7be82bf66524c9c78ddf798131d1cb38489a14c1'/>
<id>urn:sha1:7be82bf66524c9c78ddf798131d1cb38489a14c1</id>
<content type='text'>
We previously checked for the existence of the 'func' flag to determine
if we should avoid looking up in the metadata. This was done to ensure
the user gets the function for 'def' python functions rather than their
string contents. We can sidestep the metadata lookup and check our
function context directly, instead.

(Bitbake rev: 6cac1eac51efa9a54e8457f60ea1ea0e604c50b7)

Signed-off-by: Christopher Larson &lt;kergoth@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: data_smart: check for python builtins directly for context lookup</title>
<updated>2023-08-04T10:37:55+00:00</updated>
<author>
<name>Christopher Larson</name>
<email>kergoth@gmail.com</email>
</author>
<published>2022-03-17T22:29:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8b74f2ca55a08454beee77141dcdfe51e343298a'/>
<id>urn:sha1:8b74f2ca55a08454beee77141dcdfe51e343298a</id>
<content type='text'>
This avoids the need to hardcode a list of python builtins. This also slightly changes behavior, in a case like `${@eval("3")}`, this will ensure we always call the builtin, even if the metadata has an 'eval' variable defined.

(Bitbake rev: 9976ae50677b333d646ca0fd395468bd2301d03f)

Signed-off-by: Christopher Larson &lt;kergoth@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<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>
</feed>
