1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

bitbake: bitbake: data: Ensure task checksums account for remove data

Currently remove operations are not being accounted for in the task
checksums. This is a fairly serious oversight and needs to be fixed.

To do so, we need internal data from getVarFlag combined with the
expanded variable data so that only "active" remove operators are
accounted for in the task checksum. We can get this from the new
optional removes attribute in the returned parser object.

The code can then use the data on active remove operators to account
for the removals in task checksum but only when the removal is active.

We have to be careful here not to reference any expanded data since this
may for example contain build paths. This means we can only map back
and reference the unsplit (and hence unexpanded) remove string which may
expand to multiple removal values.

[YOCTO #12913]

(Bitbake rev: 57d2ee17ae83a139a37081eb082e6184fa883581)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2018-10-16 17:15:20 +01:00
parent 9248bc1c53
commit f7f5e30667
2 changed files with 29 additions and 8 deletions
+12
View File
@@ -307,6 +307,14 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
return newvalue return newvalue
return value + newvalue return value + newvalue
def handle_remove(value, deps, removes, d):
for r in sorted(removes):
r2 = d.expandWithRefs(r, None)
value += "\n_remove of %s" % r
deps |= r2.references
deps = deps | (keys & r2.execs)
return value
if "vardepvalue" in varflags: if "vardepvalue" in varflags:
value = varflags.get("vardepvalue") value = varflags.get("vardepvalue")
elif varflags.get("func"): elif varflags.get("func"):
@@ -327,6 +335,8 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
deps = deps | parsedvar.references deps = deps | parsedvar.references
deps = deps | (keys & parser.execs) | (keys & parsedvar.execs) deps = deps | (keys & parser.execs) | (keys & parsedvar.execs)
value = handle_contains(value, parsedvar.contains, d) value = handle_contains(value, parsedvar.contains, d)
if hasattr(parsedvar, "removes"):
value = handle_remove(value, deps, parsedvar.removes, d)
if vardeps is None: if vardeps is None:
parser.log.flush() parser.log.flush()
if "prefuncs" in varflags: if "prefuncs" in varflags:
@@ -340,6 +350,8 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
deps |= parser.references deps |= parser.references
deps = deps | (keys & parser.execs) deps = deps | (keys & parser.execs)
value = handle_contains(value, parser.contains, d) value = handle_contains(value, parser.contains, d)
if hasattr(parser, "removes"):
value = handle_remove(value, deps, parser.removes, d)
if "vardepvalueexclude" in varflags: if "vardepvalueexclude" in varflags:
exclude = varflags.get("vardepvalueexclude") exclude = varflags.get("vardepvalueexclude")
+17 -8
View File
@@ -805,7 +805,7 @@ class DataSmart(MutableMapping):
value = parser.value value = parser.value
if value and flag == "_content" and local_var is not None and "_remove" in local_var and not parsing: if value and flag == "_content" and local_var is not None and "_remove" in local_var and not parsing:
removes = [] removes = {}
self.need_overrides() self.need_overrides()
for (r, o) in local_var["_remove"]: for (r, o) in local_var["_remove"]:
match = True match = True
@@ -814,14 +814,23 @@ class DataSmart(MutableMapping):
if not o2 in self.overrides: if not o2 in self.overrides:
match = False match = False
if match: if match:
removes.extend(self.expand(r).split()) removes[r] = self.expand(r).split()
if removes: if removes and parser:
filtered = filter(lambda v: v not in removes, parser.removes = set()
__whitespace_split__.split(value)) val = ""
value = "".join(filtered) for v in __whitespace_split__.split(parser.value):
if parser: skip = False
parser.value = value for r in removes:
if v in removes[r]:
parser.removes.add(r)
skip = True
if skip:
continue
val = val + v
parser.value = val
if expand:
value = parser.value
if parser: if parser:
self.expand_cache[cachename] = parser self.expand_cache[cachename] = parser