summaryrefslogtreecommitdiffstats
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-04-26 14:00:50 +0100
commit3e9cdd878887d0e59754447f313c39d142b71971 (patch)
treecb561940dcaa9a4116cc535c167af37e342ae5b0
parentf135cb36596d9cc8996277f49b296b9f73b76b73 (diff)
downloadpoky-3e9cdd878887d0e59754447f313c39d142b71971.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: 9d8e6daa866d2f19b2a6324072b984a866715426) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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