summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-27 16:55:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-28 23:32:16 +0000
commit1d4c20ecc2833c2c92de8682c772e27853dafc93 (patch)
tree6e4d3a2b6c0de0a6e58ce4aa2a9eecec5ded2672 /meta/classes
parenta4274bcc37cd0984f1aedd1c5a6c5dae8a9e61a2 (diff)
downloadpoky-1d4c20ecc2833c2c92de8682c772e27853dafc93.tar.gz
staging: Allow removal of stale sysroot objects
The main sysroot components of unreachable build targets will be removed by the core code. This currently doesn't trigger a removal in the individual workdirs. This adds in symlinking between the complete stamps and the component sysroot meaning we can detect when someting was removed and hence remove it from the sysroot. This fixes cases where DISTRO_FEATURES like systemd are changed amongst other things and makes builds more robust against configuration changes. If a dependency is rebuild, that is caught by checksum comparision code elsewhere in this function as before. (From OE-Core rev: 7656347c556915dc9acc5a2311ec4e879de6f43d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/staging.bbclass17
1 files changed, 15 insertions, 2 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index 1b618fbc50..cc7767ae3a 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -490,6 +490,18 @@ python extend_recipe_sysroot() {
490 fixme['native'] = [] 490 fixme['native'] = []
491 postinsts = [] 491 postinsts = []
492 multilibs = {} 492 multilibs = {}
493 manifests = {}
494
495 for f in os.listdir(depdir):
496 if not f.endswith(".complete"):
497 continue
498 f = depdir + "/" + f
499 if os.path.islink(f) and not os.path.exists(f):
500 bb.note("%s no longer exists, removing from sysroot" % f)
501 lnk = os.readlink(f.replace(".complete", ""))
502 sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
503 os.unlink(f)
504 os.unlink(f.replace(".complete", ""))
493 505
494 for dep in configuredeps: 506 for dep in configuredeps:
495 c = setscenedeps[dep][0] 507 c = setscenedeps[dep][0]
@@ -547,6 +559,7 @@ python extend_recipe_sysroot() {
547 bb.warn("Manifest %s not found?" % manifest) 559 bb.warn("Manifest %s not found?" % manifest)
548 else: 560 else:
549 with open(manifest, "r") as f, open(taskmanifest, 'w') as m: 561 with open(manifest, "r") as f, open(taskmanifest, 'w') as m:
562 manifests[dep] = manifest
550 for l in f: 563 for l in f:
551 l = l.strip() 564 l = l.strip()
552 if l.endswith("/"): 565 if l.endswith("/"):
@@ -573,9 +586,9 @@ python extend_recipe_sysroot() {
573 for p in postinsts: 586 for p in postinsts:
574 subprocess.check_output(p, shell=True) 587 subprocess.check_output(p, shell=True)
575 588
576 for dep in configuredeps: 589 for dep in manifests:
577 c = setscenedeps[dep][0] 590 c = setscenedeps[dep][0]
578 open(depdir + "/" + c + ".complete", "w").close() 591 os.symlink(manifests[dep], depdir + "/" + c + ".complete")
579 592
580 bb.utils.unlockfile(lock) 593 bb.utils.unlockfile(lock)
581} 594}