path: root/meta/classes/rm_work_and_downloads.bbclass
diff options
authorPatrick Ohly <>2017-01-13 14:52:32 (GMT)
committerRichard Purdie <>2017-01-20 11:53:48 (GMT)
commitce84432d983dde8f5616727712ac7231e20c4d1b (patch)
tree1ab80fc8a9c5d0773ad00f8e0f4995175fc4bd5a /meta/classes/rm_work_and_downloads.bbclass
parent3ba8917c4d890a1fdd3ffb250fe3ef73557542f5 (diff)
rm_work_and_downloads.bbclass: more aggressively minimize disk usage
rm_work.bbclass never deletes downloaded files, even if they are not going to be needed again during the build. rm_work_and_downloads.bbclass is more aggressive in minimizing the used disk space during a build, but has other disadvantages: - sources required by different recipes need to be fetched once per recipe, not once per build - incremental builds do not work reliably because sources get removed without ensuring that sources gets fetched again That makes rm_work_and_downloads.bbclass useful for one-time builds in a constrained environment (like a CI system), but not for general use. (From OE-Core rev: ca23a07fc6677720508197f2b44573bfd6b52f28) Signed-off-by: Patrick Ohly <> Signed-off-by: Ross Burton <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'meta/classes/rm_work_and_downloads.bbclass')
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/classes/rm_work_and_downloads.bbclass b/meta/classes/rm_work_and_downloads.bbclass
new file mode 100644
index 0000000..7c00bea
--- /dev/null
+++ b/meta/classes/rm_work_and_downloads.bbclass
@@ -0,0 +1,33 @@
1# Author: Patrick Ohly <>
2# Copyright: Copyright (C) 2015 Intel Corporation
4# This file is licensed under the MIT license, see COPYING.MIT in
5# this source distribution for the terms.
7# This class is used like rm_work:
8# INHERIT += "rm_work_and_downloads"
10# In addition to removing local build directories of a recipe, it also
11# removes the downloaded source. This is achieved by making the DL_DIR
12# recipe-specific. While reducing disk usage, it increases network usage (for
13# example, compiling the same source for target and host implies downloading
14# the source twice).
16# Because the "do_fetch" task does not get re-run after removing the downloaded
17# sources, this class is also not suitable for incremental builds.
19# Where it works well is in well-connected build environments with limited
20# disk space (like TravisCI).
22inherit rm_work
24# This would ensure that the existing do_rm_work() removes the downloads,
25# but does not work because some recipes have a circular dependency between
26# WORKDIR and DL_DIR (via ${SRCPV}?).
27# DL_DIR = "${WORKDIR}/downloads"
29# Instead go up one level and remove ourself.
31do_rm_work_append () {
32 rm -rf ${DL_DIR}