From 3e9cdd878887d0e59754447f313c39d142b71971 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 20 Apr 2020 17:17:39 +0100 Subject: 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 --- meta/classes/staging.bbclass | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'meta/classes/staging.bbclass') 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() { start = None configuredeps = [] + owntaskdeps = [] for dep in taskdepdata: data = taskdepdata[dep] if data[1] == mytaskname and data[0] == pn: start = dep - break + elif data[0] == pn: + owntaskdeps.append(data[1]) if start is None: bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") @@ -427,7 +429,7 @@ python extend_recipe_sysroot() { # Was likely already uninstalled continue potential.append(l) - # We need to ensure not other task needs this dependency. We hold the sysroot + # We need to ensure no other task needs this dependency. We hold the sysroot # lock so we ca search the indexes to check if potential: for i in glob.glob(depdir + "/index.*"): @@ -435,6 +437,11 @@ python extend_recipe_sysroot() { continue with open(i, "r") as f: for l in f: + if l.startswith("TaskDeps:"): + prevtasks = l.split()[1:] + if mytaskname in prevtasks: + # We're a dependency of this task so we can clear items out the sysroot + break l = l.strip() if l in potential: potential.remove(l) @@ -588,6 +595,7 @@ python extend_recipe_sysroot() { os.symlink(manifests[dep], depdir + "/" + c + ".complete") with open(taskindex, "w") as f: + f.write("TaskDeps: " + " ".join(owntaskdeps) + "\n") for l in sorted(installed): f.write(l + "\n") -- cgit v1.2.3-54-g00ecf