1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

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>
This commit is contained in:
Richard Purdie
2020-04-20 17:17:39 +01:00
parent 21684e6c83
commit cdde3cfae3
+10 -2
View File
@@ -277,11 +277,13 @@ python extend_recipe_sysroot() {
start = None start = None
configuredeps = [] configuredeps = []
owntaskdeps = []
for dep in taskdepdata: for dep in taskdepdata:
data = taskdepdata[dep] data = taskdepdata[dep]
if data[1] == mytaskname and data[0] == pn: if data[1] == mytaskname and data[0] == pn:
start = dep start = dep
break elif data[0] == pn:
owntaskdeps.append(data[1])
if start is None: if start is None:
bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
@@ -427,7 +429,7 @@ python extend_recipe_sysroot() {
# Was likely already uninstalled # Was likely already uninstalled
continue continue
potential.append(l) 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 # lock so we ca search the indexes to check
if potential: if potential:
for i in glob.glob(depdir + "/index.*"): for i in glob.glob(depdir + "/index.*"):
@@ -435,6 +437,11 @@ python extend_recipe_sysroot() {
continue continue
with open(i, "r") as f: with open(i, "r") as f:
for l in 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() l = l.strip()
if l in potential: if l in potential:
potential.remove(l) potential.remove(l)
@@ -588,6 +595,7 @@ python extend_recipe_sysroot() {
os.symlink(manifests[dep], depdir + "/" + c + ".complete") os.symlink(manifests[dep], depdir + "/" + c + ".complete")
with open(taskindex, "w") as f: with open(taskindex, "w") as f:
f.write("TaskDeps: " + " ".join(owntaskdeps) + "\n")
for l in sorted(installed): for l in sorted(installed):
f.write(l + "\n") f.write(l + "\n")