<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/bb/codeparser.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-29T20:58:19+00:00</updated>
<entry>
<title>bitbake: codeparser: Allow code visitor expressions to be declared in metadata</title>
<updated>2024-08-29T20:58:19+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2024-08-28T11:54:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=9a25a38ffe4acb374312ea86fdb0587bcc0f5f57'/>
<id>urn:sha1:9a25a38ffe4acb374312ea86fdb0587bcc0f5f57</id>
<content type='text'>
Allow the metadata to define code visitor expressions which mean that
custom dependencies can be handled in function libraries.

An example is the qa.handle_error function in OE which can set something
like:

"""
def handle_error_visitorcode(name, args):
    execs = set()
    contains = {}
    warn = None
    if isinstance(args[0], ast.Constant) and isinstance(args[0].value, str):
        for i in ["ERROR_QA", "WARN_QA"]:
            if i not in contains:
                contains[i] = set()
        contains[i].add(args[0].value)
    else:
        warn = args[0]
        execs.add(name)
    return contains, execs, warn

handle_error.visitorcode = handle_error_visitorcode
"""

Meaning that it can have contains optimisations on ERROR and WARN_QA
instead of hard dependencies.

One drawback to this solution is the parsing order. Functions with
visitorcode need to be defined before anything else references them
or the visitor code will not function for the earlier references.

(Bitbake rev: 5bd0c65c217394cde4c8e382eba6cf7f4b909c97)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: codeparser: Skip non-local functions for module dependencies</title>
<updated>2024-07-01T12:53:23+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2024-06-30T22:12:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=6be592d2a7268ca394445539f6568d1c64fb0bc7'/>
<id>urn:sha1:6be592d2a7268ca394445539f6568d1c64fb0bc7</id>
<content type='text'>
If modules do something like "from glob import glob" then we end up
checksumming the glob code. That leads to bugs as the code can change
between different python versions for example, leading to checksum
instability.

We should ignore functions not from the current file as implemented
by this change.

(Bitbake rev: 1e6f862864539d6f6a0bea3e4479e0dd40ff3091)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: codeparser/data: Ensure module function contents changing is accounted for</title>
<updated>2024-07-01T12:53:23+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2024-06-27T14:13:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0d49931755886d859e2d109eef810f58f98f2cbb'/>
<id>urn:sha1:0d49931755886d859e2d109eef810f58f98f2cbb</id>
<content type='text'>
Currently, if a pylib function changes contents, the taskhash remains
unchanged since we assume the functions have stable output. This is
probably a poor assumption so take the code of the function into account
in the taskhashes. This avoids certain frustrating build failures we've
been seeing in automated testing.

To make this work we have to add an extra entry to the python code parsing
cache so that we can store the hashed function contents for efficiency as
in the python module case, that isn't used as the key to the cache.

The cache version changes since we're adding data to the cache.

(Bitbake rev: b2c3438ebe62793ebabe2c282534893908d520b4)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: codeparser: remove redundant list conversion</title>
<updated>2024-05-21T13:14:41+00:00</updated>
<author>
<name>Antonin Godard</name>
<email>antoningodard@pm.me</email>
</author>
<published>2024-05-14T01:53:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=dd98d156ca543b378ba842817ad1c47461012893'/>
<id>urn:sha1:dd98d156ca543b378ba842817ad1c47461012893</id>
<content type='text'>
(Bitbake rev: 89712949de9476e4674864a8dcd6862fefe92eae)

Signed-off-by: Antonin Godard &lt;antoningodard@pm.me&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: codeparser: support shell substitutions in quotes</title>
<updated>2024-05-21T13:14:41+00:00</updated>
<author>
<name>Antonin Godard</name>
<email>antoningodard@pm.me</email>
</author>
<published>2024-05-14T01:53:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=03742d7cb375c124a0190dac7bcbc53aefa123dc'/>
<id>urn:sha1:03742d7cb375c124a0190dac7bcbc53aefa123dc</id>
<content type='text'>
The current shell substitution mechanism only works without quotes. For
example:

  var1=$(cmd1 ...)

Will work and add `cmd1` to the correspondind `run.do_*` file.

However, although quite common, this syntax is not supported:

  var1="$(cmd1 ...)"

This commit adds this feature by adding a step to process_words() to
check whether we are dealing with quotes first, and by iterating on
what's between them to detect new shell substitution candidates. These
candidates are tested and parsed like before in the next step. The
original `part` being part of the candidates means the syntax
var1=$(cmd1 ...) is still valid.

(Bitbake rev: f56e1a37b2ba1773ed308043d7eb073cc2e6c06e)

Signed-off-by: Antonin Godard &lt;antoningodard@pm.me&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: bitbake/codeparser.py: address ast module deprecations in py 3.12</title>
<updated>2024-01-02T14:41:06+00:00</updated>
<author>
<name>Alexander Kanavin</name>
<email>alex.kanavin@gmail.com</email>
</author>
<published>2023-12-31T10:04:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=39581827102c54359ec22eebc89ff68af4ec8633'/>
<id>urn:sha1:39581827102c54359ec22eebc89ff68af4ec8633</id>
<content type='text'>
Specifically:
/srv/work/alex/poky/bitbake/lib/bb/codeparser.py:279: DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
  if isinstance(node.args[0], ast.Str):
/srv/work/alex/poky/bitbake/lib/bb/codeparser.py:280: DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead
  value = node.args[0].s

(Bitbake rev: de8ba2770d9a1a94af3d084f9540da7e2fae6022)

Signed-off-by: Alexander Kanavin &lt;alex@linutronix.de&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: codeparser: add missing 'import os'</title>
<updated>2023-10-23T10:46:36+00:00</updated>
<author>
<name>Chris Laplante</name>
<email>chris.laplante@agilent.com</email>
</author>
<published>2023-10-20T18:44:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=c4205d2455c4089d42de3750c9d495bb20051abb'/>
<id>urn:sha1:c4205d2455c4089d42de3750c9d495bb20051abb</id>
<content type='text'>
(Bitbake rev: 302969885d37a76edec3aa79181e98f8d7e28021)

Signed-off-by: Chris Laplante &lt;chris.laplante@agilent.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: codeparser: replace deprecated ast.Str and 's'</title>
<updated>2023-10-17T10:41:33+00:00</updated>
<author>
<name>Chris Laplante</name>
<email>chris.laplante@agilent.com</email>
</author>
<published>2023-10-16T18:33:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2460c1b3eca1ad040bada7f842adcba4fb161fad'/>
<id>urn:sha1:2460c1b3eca1ad040bada7f842adcba4fb161fad</id>
<content type='text'>
These have been deprecated since 3.8

(Bitbake rev: 5419a8473d6d4cd1d01537de68ad8d72cf5be0b2)

Signed-off-by: Chris Laplante &lt;chris.laplante@agilent.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: codeparser: Update debug variable reference</title>
<updated>2023-09-22T06:45:47+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-09-21T16:47:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=5614e6b38a55df5df95556853961610c2b6bf329'/>
<id>urn:sha1:5614e6b38a55df5df95556853961610c2b6bf329</id>
<content type='text'>
The code has changed and the debug message didn't work. Fix it. The output
is still incredibly useful.

(Bitbake rev: f1fa4bb3066e2bbaff0b69088ba5c6c6c597b93d)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location</title>
<updated>2023-01-26T21:50:31+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-11-30T22:28:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=557aab215884d10839fa24f797890c99f38e97b2'/>
<id>urn:sha1:557aab215884d10839fa24f797890c99f38e97b2</id>
<content type='text'>
Currently the codeparser cache is set from CACHE, which is typically in
bitbake.conf which means we can't read/write any cache until it is found/read.
We may well have python expressions to parse before that happens.
The net result is suboptimal functioning of the codeparser cache since it will
often be invalidated by data that is never written.

This patch changes the codeparser and filechecksum caches to use BB_CACHE as
their setting and defaults it to ${TOPDIR}/cache.

The patch doesn't change where the "persistent" data such as prserver and
hash-equiavalance resides (PERSISTENT_DIR) or where the metadata parsing
cache resists (still currently CACHE). I've left those for a later patch.

The patch does ensure data parsed by the core datastore parsing calls is
written back since this is now much more useful after this change.

(Bitbake rev: ee89ade5b5a4cf9c53f336d8b800e06fbe436628)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
