aboutsummaryrefslogtreecommitdiffstats
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:31:17 +0000
commit7656347c556915dc9acc5a2311ec4e879de6f43d (patch)
tree6b1aa7a04514e535cbbc54fa3b1a0495f09f9c10 /meta/classes
parent1cb245a99762e21a170b6a9beabb07e558424946 (diff)
downloadopenembedded-core-7656347c556915dc9acc5a2311ec4e879de6f43d.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. 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() {
fixme['native'] = []
postinsts = []
multilibs = {}
+ manifests = {}
+
+ for f in os.listdir(depdir):
+ if not f.endswith(".complete"):
+ continue
+ f = depdir + "/" + f
+ if os.path.islink(f) and not os.path.exists(f):
+ bb.note("%s no longer exists, removing from sysroot" % f)
+ lnk = os.readlink(f.replace(".complete", ""))
+ sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+ os.unlink(f)
+ os.unlink(f.replace(".complete", ""))
for dep in configuredeps:
c = setscenedeps[dep][0]
@@ -547,6 +559,7 @@ python extend_recipe_sysroot() {
bb.warn("Manifest %s not found?" % manifest)
else:
with open(manifest, "r") as f, open(taskmanifest, 'w') as m:
+ manifests[dep] = manifest
for l in f:
l = l.strip()
if l.endswith("/"):
@@ -573,9 +586,9 @@ python extend_recipe_sysroot() {
for p in postinsts:
subprocess.check_output(p, shell=True)
- for dep in configuredeps:
+ for dep in manifests:
c = setscenedeps[dep][0]
- open(depdir + "/" + c + ".complete", "w").close()
+ os.symlink(manifests[dep], depdir + "/" + c + ".complete")
bb.utils.unlockfile(lock)
}