summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-09-05 10:56:18 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-18 11:07:29 +0100
commit10af6d86b3effc523cfa0ec49741c5b02ee2cf86 (patch)
tree64974ae0b7f5fbfaa5647618bf401b98b1d93228 /meta/classes/sstate.bbclass
parent4842db00b7aaac96f7bbdfbea5d8bcdb2ebac81b (diff)
downloadpoky-10af6d86b3effc523cfa0ec49741c5b02ee2cf86.tar.gz
devtool: rework source extraction so that dependencies are handled
Since it was first implemented, devtool's source extraction (as used by the devtool modify, extract and upgrade subcommands) ignored other recipe dependencies - so for example if you ran devtool modify on a recipe that fetches from svn or is compressed using xz then it would fail if those dependencies hadn't been built first. Now that we can execute tasks in the normal way (i.e. tinfoil.build_targets()) then we can rework it to use that. This is slightly tricky in that the source extraction needs to insert some logic in between tasks; luckily we can use a helper class that conditionally adds prefuncs to make that possible. Some side-effects / aspects of this change worth noting: * Operations are a little slower because we have to go through the task dependency graph generation and other startup processing. There's not really any way to avoid this though. * devtool extract didn't used to require a workspace, now it does because it needs to create a temporary bbappend for the recipe. (As with other commands the workspace be created on the fly if it doesn't already exist.) * I want any existing sysroot files and stamps to be left alone during extraction since we are running the tasks off to the side, and especially devtool extract should be able to be used without touching these. However, this was hampered by the automatic removal process in sstate.bbclass triggered by bb.event.ReachableStamps when the task signatures change, thus I had to introduce a way to disable this removal on a per-recipe basis (we still want it to function for any dependencies that we aren't working on). To implement this I elected to use a file written to tmp/sstate-control which gets deleted automatically after reading so that there's less chance of stale files affecting future sessions. I could have used a variable but this would have needed to be whitelisted and I'd have to have poked its value in using the setVariable command. Fixes [YOCTO #11198]. (From OE-Core rev: 830dbd66992cbb9e731b48d56fddf8f220349666) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 6af0d388bc..2a54993d1d 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -1015,6 +1015,11 @@ python sstate_eventhandler2() {
1015 d = e.data 1015 d = e.data
1016 stamps = e.stamps.values() 1016 stamps = e.stamps.values()
1017 removeworkdir = (d.getVar("SSTATE_PRUNE_OBSOLETEWORKDIR", False) == "1") 1017 removeworkdir = (d.getVar("SSTATE_PRUNE_OBSOLETEWORKDIR", False) == "1")
1018 preservestampfile = d.expand('${SSTATE_MANIFESTS}/preserve-stamps')
1019 preservestamps = []
1020 if os.path.exists(preservestampfile):
1021 with open(preservestampfile, 'r') as f:
1022 preservestamps = f.readlines()
1018 seen = [] 1023 seen = []
1019 for a in d.getVar("SSTATE_ARCHS").split(): 1024 for a in d.getVar("SSTATE_ARCHS").split():
1020 toremove = [] 1025 toremove = []
@@ -1025,7 +1030,7 @@ python sstate_eventhandler2() {
1025 lines = f.readlines() 1030 lines = f.readlines()
1026 for l in lines: 1031 for l in lines:
1027 (stamp, manifest, workdir) = l.split() 1032 (stamp, manifest, workdir) = l.split()
1028 if stamp not in stamps: 1033 if stamp not in stamps and stamp not in preservestamps:
1029 toremove.append(l) 1034 toremove.append(l)
1030 if stamp not in seen: 1035 if stamp not in seen:
1031 bb.debug(2, "Stamp %s is not reachable, removing related manifests" % stamp) 1036 bb.debug(2, "Stamp %s is not reachable, removing related manifests" % stamp)
@@ -1047,4 +1052,6 @@ python sstate_eventhandler2() {
1047 with open(i, "w") as f: 1052 with open(i, "w") as f:
1048 for l in lines: 1053 for l in lines:
1049 f.write(l) 1054 f.write(l)
1055 if preservestamps:
1056 os.remove(preservestampfile)
1050} 1057}