poky/bitbake/lib/bb
Richard Purdie 9a25a38ffe bitbake: codeparser: Allow code visitor expressions to be declared in metadata
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 <richard.purdie@linuxfoundation.org>
2024-08-29 21:58:19 +01:00
..
asyncrpc bitbake: asyncrpc: Use client timeout for websocket open timeout 2024-06-04 12:05:20 +01:00
compress bitbake: bitbake: Add copyright headers where missing 2022-08-12 11:49:29 +01:00
fetch2 bitbake: fetch2/npm: allow the '@' character in package names 2024-08-25 15:37:02 +01:00
parse bitbake: BBHandler/ast: Improve addtask handling 2024-08-13 15:47:55 +01:00
pysh bitbake: pyshyacc: allow double COMMA statements 2020-07-12 11:53:00 +01:00
server bitbake: process/server: Fix typo 2024-02-10 15:25:22 +00:00
tests bitbake: build: Ensure addtask before/after tasknames have prefix applied 2024-08-13 15:47:55 +01:00
ui bitbake: ui/knotty: respect NO_COLOR & check for tty; rename print_hyperlink => format_hyperlink 2024-08-23 09:48:48 +01:00
__init__.py bitbake: bitbake: Drop older python version compatibility code 2024-05-31 16:56:25 +01:00
acl.py bitbake: lib/bb: Add xattr and acl libraries 2023-08-24 16:49:38 +01:00
build.py bitbake: build/exec_task: Log str() instead of repr() for exceptions in build 2024-08-15 15:15:10 +01:00
cache_extra.py bitbake: bitbake: Strip old editor directives from file headers 2019-05-04 10:44:10 +01:00
cache.py bitbake: codeparser: Allow code visitor expressions to be declared in metadata 2024-08-29 21:58:19 +01:00
checksum.py bitbake: checksum: Allow spaces in URI filenames 2022-04-14 09:48:33 +01:00
codeparser.py bitbake: codeparser: Allow code visitor expressions to be declared in metadata 2024-08-29 21:58:19 +01:00
command.py bitbake: siggen: Ensure version of siggen is verified 2024-01-05 11:59:08 +00:00
cooker.py bitbake: cookerdata: Separate out data_hash and hook to tinfoil 2024-08-13 15:47:55 +01:00
cookerdata.py bitbake: cookerdata: Separate out data_hash and hook to tinfoil 2024-08-13 15:47:55 +01:00
COW.py bitbake: bitbake: Add copyright headers where missing 2022-08-12 11:49:29 +01:00
daemonize.py bitbake: bitbake: Add copyright headers where missing 2022-08-12 11:49:29 +01:00
data_smart.py bitbake: data_smart: Improve performance for VariableHistory 2024-08-03 11:37:47 +01:00
data.py bitbake: codeparser/data: Ensure module function contents changing is accounted for 2024-07-01 13:53:23 +01:00
event.py bitbake: bitbake: event: Inject empty lines to make code match lineno in filename 2024-01-10 13:55:33 +00:00
exceptions.py bitbake: bitbake: Add copyright headers where missing 2022-08-12 11:49:29 +01:00
main.py bitbake: bitbake: improve descriptions of '-S printdiff' 2024-03-22 16:26:45 +00:00
methodpool.py bitbake: bitbake: Strip old editor directives from file headers 2019-05-04 10:44:10 +01:00
monitordisk.py bitbake: Fix disk space monitoring on cephfs 2023-08-25 07:55:34 +01:00
msg.py bitbake: lib/bb: support NO_COLOR 2024-03-22 16:26:45 +00:00
namedtuple_with_abc.py bitbake: lib: fix most undefined code picked up by pylint 2020-08-25 18:14:53 +01:00
persist_data.py bitbake: persist_data: Handle sqlite error when cachefile path is too long 2023-01-13 17:34:08 +00:00
process.py bitbake: bitbake: Add copyright headers where missing 2022-08-12 11:49:29 +01:00
progress.py bitbake: progress: Fix typo "wherever" 2022-02-20 16:45:25 +00:00
providers.py bitbake: providers: use local variable for packages_dynamic pattern 2022-04-19 14:15:09 +01:00
remotedata.py bitbake: tinfoil: Simplify remote datastore connections 2020-03-24 22:01:03 +00:00
runqueue.py bitbake: runqueue: Avoid save_unitaskhashes 2024-06-07 13:45:43 +01:00
siggen.py bitbake: siggen: catch FileNotFoundError everywhere and ConnectionError also in get_unihashes 2024-06-18 08:45:22 +01:00
taskdata.py bitbake: lib/bb: Replace "abort" usage in task handling 2022-02-21 23:37:26 +00:00
tinfoil.py bitbake: tinfoil: Do not fail when logging is disabled and full config is used 2023-09-26 10:37:17 +01:00
utils.py bitbake: utils: better estimate number of available cpus 2024-03-22 16:26:45 +00:00
xattr.py bitbake: lib/bb: Add xattr and acl libraries 2023-08-24 16:49:38 +01:00