diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-06-30 23:12:50 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-07-01 13:53:23 +0100 |
commit | 6be592d2a7268ca394445539f6568d1c64fb0bc7 (patch) | |
tree | 9be791e685d2888e788dcf7a9014ee8e18abeb34 /bitbake | |
parent | 0d49931755886d859e2d109eef810f58f98f2cbb (diff) | |
download | poky-6be592d2a7268ca394445539f6568d1c64fb0bc7.tar.gz |
bitbake: codeparser: Skip non-local functions for module dependencies
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/codeparser.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index 4c4758ecbe..b25a2133d2 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
@@ -72,6 +72,11 @@ def add_module_functions(fn, functions, namespace): | |||
72 | parser.parse_python(None, filename=fn, lineno=1, fixedhash=fixedhash+f) | 72 | parser.parse_python(None, filename=fn, lineno=1, fixedhash=fixedhash+f) |
73 | #bb.warn("Cached %s" % f) | 73 | #bb.warn("Cached %s" % f) |
74 | except KeyError: | 74 | except KeyError: |
75 | targetfn = inspect.getsourcefile(functions[f]) | ||
76 | if fn != targetfn: | ||
77 | # Skip references to other modules outside this file | ||
78 | #bb.warn("Skipping %s" % name) | ||
79 | continue | ||
75 | lines, lineno = inspect.getsourcelines(functions[f]) | 80 | lines, lineno = inspect.getsourcelines(functions[f]) |
76 | src = "".join(lines) | 81 | src = "".join(lines) |
77 | parser.parse_python(src, filename=fn, lineno=lineno, fixedhash=fixedhash+f) | 82 | parser.parse_python(src, filename=fn, lineno=lineno, fixedhash=fixedhash+f) |