All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake: Fix automatic generation of variable dependencies
@ 2021-06-23 15:53 Damian Wrobel
  0 siblings, 0 replies; 2+ messages in thread
From: Damian Wrobel @ 2021-06-23 15:53 UTC (permalink / raw)
  To: bitbake-devel

Automatically generate variable dependencies also for:
    - "bb.utils.contains",
    - "base_contains"
    - "bb.utils.contains_any",
    - "bb.utils.filter".

This is to avoid situation in which some of the variables were
added automatically but not all of them like in the test example below:

RDEPENDS_${PN} += "\
    ${@bb.utils.contains(                                              \
        'BB_UTILS_CONTAINS_DROPBEAR',  '1',   'dropbear',   '', d)}    \
    ${@bb.utils.contains_any(                                          \
        'BB_UTILS_CONTAINS_ANY_EXPAT', ['1'], 'expat',      '', d)}    \
    ${@oe.utils.conditional(                                           \
        'OE_UTILS_CONDITIONAL_ZLIB',   '1',   'zlib',       '', d)}    \
    ${@bb.utils.filter('BB_UTILS_FILTER_WAYLAND_PROTOCOLS', 'xyz', d)} \

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
---
 lib/bb/cache.py      | 2 +-
 lib/bb/codeparser.py | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index 27eb2717..2fe83ef3 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -26,7 +26,7 @@ import re
 
 logger = logging.getLogger("BitBake.Cache")
 
-__cache_version__ = "154"
+__cache_version__ = "155"
 
 def getCacheFile(path, filename, mc, data_hash):
     mcspec = ''
diff --git a/lib/bb/codeparser.py b/lib/bb/codeparser.py
index 0cec452c..e00dc444 100644
--- a/lib/bb/codeparser.py
+++ b/lib/bb/codeparser.py
@@ -122,7 +122,7 @@ class CodeParserCache(MultiProcessCache):
     # so that an existing cache gets invalidated. Additionally you'll need
     # to increment __cache_version__ in cache.py in order to ensure that old
     # recipe caches don't trigger "Taskhash mismatch" errors.
-    CACHE_VERSION = 11
+    CACHE_VERSION = 12
 
     def __init__(self):
         MultiProcessCache.__init__(self)
@@ -225,10 +225,12 @@ class PythonParser():
                     if varname not in self.contains:
                         self.contains[varname] = set()
                     self.contains[varname].add(node.args[1].s)
+                    self.references.add(varname)
                 elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Str):
                     if varname not in self.contains:
                         self.contains[varname] = set()
                     self.contains[varname].update(node.args[1].s.split())
+                    self.references.add(varname)
                 elif name.endswith(self.getvarflags):
                     if isinstance(node.args[1], ast.Str):
                         self.references.add('%s[%s]' % (varname, node.args[1].s))
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] bitbake: Fix automatic generation of variable dependencies
@ 2021-06-24  6:40 Damian Wrobel
  0 siblings, 0 replies; 2+ messages in thread
From: Damian Wrobel @ 2021-06-24  6:40 UTC (permalink / raw)
  To: poky

Automatically generate variable dependencies also for:
    - "bb.utils.contains",
    - "base_contains"
    - "bb.utils.contains_any",
    - "bb.utils.filter".

This is to avoid situation in which some of the variables were
added automatically but not all of them like in the test example below:

RDEPENDS_${PN} += "\
    ${@bb.utils.contains(                                              \
        'BB_UTILS_CONTAINS_DROPBEAR',  '1',   'dropbear',   '', d)}    \
    ${@bb.utils.contains_any(                                          \
        'BB_UTILS_CONTAINS_ANY_EXPAT', ['1'], 'expat',      '', d)}    \
    ${@oe.utils.conditional(                                           \
        'OE_UTILS_CONDITIONAL_ZLIB',   '1',   'zlib',       '', d)}    \
    ${@bb.utils.filter('BB_UTILS_FILTER_WAYLAND_PROTOCOLS', 'xyz', d)} \

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
---
 bitbake/lib/bb/cache.py      | 2 +-
 bitbake/lib/bb/codeparser.py | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 27eb271798..2fe83ef3ac 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -26,7 +26,7 @@ import re
 
 logger = logging.getLogger("BitBake.Cache")
 
-__cache_version__ = "154"
+__cache_version__ = "155"
 
 def getCacheFile(path, filename, mc, data_hash):
     mcspec = ''
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 0cec452c00..e00dc44470 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -122,7 +122,7 @@ class CodeParserCache(MultiProcessCache):
     # so that an existing cache gets invalidated. Additionally you'll need
     # to increment __cache_version__ in cache.py in order to ensure that old
     # recipe caches don't trigger "Taskhash mismatch" errors.
-    CACHE_VERSION = 11
+    CACHE_VERSION = 12
 
     def __init__(self):
         MultiProcessCache.__init__(self)
@@ -225,10 +225,12 @@ class PythonParser():
                     if varname not in self.contains:
                         self.contains[varname] = set()
                     self.contains[varname].add(node.args[1].s)
+                    self.references.add(varname)
                 elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Str):
                     if varname not in self.contains:
                         self.contains[varname] = set()
                     self.contains[varname].update(node.args[1].s.split())
+                    self.references.add(varname)
                 elif name.endswith(self.getvarflags):
                     if isinstance(node.args[1], ast.Str):
                         self.references.add('%s[%s]' % (varname, node.args[1].s))
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-24  6:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 15:53 [PATCH] bitbake: Fix automatic generation of variable dependencies Damian Wrobel
2021-06-24  6:40 Damian Wrobel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.