summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-20 17:17:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-07 13:03:30 +0100
commitcdde3cfae37277c6a36e24e43c8f6f710c878fca (patch)
tree03dc4d0e9a08f61d979f7896c301d5bb7e0150d2 /meta
parent21684e6c836fc3a85b19b44d1a1cd04889711f09 (diff)
downloadpoky-cdde3cfae37277c6a36e24e43c8f6f710c878fca.tar.gz
staging: Fix overlapping file failures
If there are different providers of a file and they are swiched when the recipe isn't machine specific, we can get tracebacks due to the overlapping files. The issue is that the previous provider isn't uninstalled since the system can't tell whether some later task needs them. By tracking which tasks we depend upon, the code can now choose to uninstall more things since a later task can reinstall if/as needed. The code here was to protect against code with two different tasks running in parallel which is still protected agaisnt. [YOCTO #13702] (From OE-Core rev: 86f36e3f93cdb2f5882b72e736a770aa6f46100d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/staging.bbclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index 5dab42745f..5b04f88b2d 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -277,11 +277,13 @@ python extend_recipe_sysroot() {
277 277
278 start = None 278 start = None
279 configuredeps = [] 279 configuredeps = []
280 owntaskdeps = []
280 for dep in taskdepdata: 281 for dep in taskdepdata:
281 data = taskdepdata[dep] 282 data = taskdepdata[dep]
282 if data[1] == mytaskname and data[0] == pn: 283 if data[1] == mytaskname and data[0] == pn:
283 start = dep 284 start = dep
284 break 285 elif data[0] == pn:
286 owntaskdeps.append(data[1])
285 if start is None: 287 if start is None:
286 bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") 288 bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
287 289
@@ -427,7 +429,7 @@ python extend_recipe_sysroot() {
427 # Was likely already uninstalled 429 # Was likely already uninstalled
428 continue 430 continue
429 potential.append(l) 431 potential.append(l)
430 # We need to ensure not other task needs this dependency. We hold the sysroot 432 # We need to ensure no other task needs this dependency. We hold the sysroot
431 # lock so we ca search the indexes to check 433 # lock so we ca search the indexes to check
432 if potential: 434 if potential:
433 for i in glob.glob(depdir + "/index.*"): 435 for i in glob.glob(depdir + "/index.*"):
@@ -435,6 +437,11 @@ python extend_recipe_sysroot() {
435 continue 437 continue
436 with open(i, "r") as f: 438 with open(i, "r") as f:
437 for l in f: 439 for l in f:
440 if l.startswith("TaskDeps:"):
441 prevtasks = l.split()[1:]
442 if mytaskname in prevtasks:
443 # We're a dependency of this task so we can clear items out the sysroot
444 break
438 l = l.strip() 445 l = l.strip()
439 if l in potential: 446 if l in potential:
440 potential.remove(l) 447 potential.remove(l)
@@ -588,6 +595,7 @@ python extend_recipe_sysroot() {
588 os.symlink(manifests[dep], depdir + "/" + c + ".complete") 595 os.symlink(manifests[dep], depdir + "/" + c + ".complete")
589 596
590 with open(taskindex, "w") as f: 597 with open(taskindex, "w") as f:
598 f.write("TaskDeps: " + " ".join(owntaskdeps) + "\n")
591 for l in sorted(installed): 599 for l in sorted(installed):
592 f.write(l + "\n") 600 f.write(l + "\n")
593 601