Commit Graph

35 Commits

Author SHA1 Message Date
Patrick Ohly d83e16a99c rm_work.bbclass: introduce do_build_without_rm_work
Some classes, for example populate_sdk_ext.bbclass, must be able to
trigger a full build of a recipe without also triggering
do_rm_work. They cannot depend on do_build anymore, because that would
trigger do_rm_work.

Instead, do_build_without_rm_work can be used. It has the exact same
dependencies as do_build, minus do_rm_work and do_rm_work_all.

This may also be useful in a test build of a recipe where one wants
to preserve the work directory without having to modify configuration
settings:
   bitbake foobar:do_build_without_rm_work

(From OE-Core rev: 04a7b8d6d2e86cc4dd1362c775f5e3ac1eb1d19d)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-31 10:10:29 +01:00
Patrick Ohly 3c8d045d79 rm_work.bbclass: re-enable recursive do_rm_work_all
When rewriting the do_rm_work injection, do_rm_work_all had been
removed because it seemed obsolete, as do_build now always triggers
do_rm_work.

However, do_build does not get triggered for all recipes and thus
do_rm_work was not called for recipes that got built only
partially. For example, zlib depends indirectly on
zlib-native:do_populate_sysroot.  Because of that dependency,
zlib-native got compiled, but do_rm_work was never called for it.

Re-introducing do_rm_work_all fixes that by making do_build depend on
do_rm_work_all, which then recursively depends on do_rm_work of all
dependencies. This has the unintended side-effect that do_rm_work then
also triggers additional work (like do_populate_lic) that normally
doesn't need to be done for a build. This seems like the lesser evil,
compared to an incomplete cleanup because it mostly enables the
lighter tasks after do_populate_sysroot.

The real solution would be to have two kinds of relationships: a weak
ordering relationship ("if A and B are enabled, A must run before B,
but B can also run without A") and hard dependencies ("B cannot run
unless A has run before").

(From OE-Core rev: b3de5d5795767a4b8c331fa5040166e7e410eeec)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Patrick Ohly 90f1ef88d6 rm_work.bbclass: clean up sooner
Having do_rm_work depend on do_build had one major disadvantage:
do_build depends on the do_build of other recipes, to ensure that
runtime dependencies also get built. The effect is that when work on a
recipe is complete and it could get cleaned up, do_rm_work still
doesn't run because it waits for those other recipes, thus leading to
more temporary disk space usage than really needed.

The right solution is to inject do_rm_work before do_build and after
all tasks of the recipe. Achieving that depends on the new bitbake
bb.event.RecipeTaskPreProcess and bb.build.preceedtask().

It can't just run in an anonymous function, because other anonymous
functions that run later may add more tasks. There's still such a
potential conflict when some future RecipeTaskPreProcess event handler
also wants to change task dependencies, but that's not a problem
now. Should it ever occur, the two handlers will have to know about
each other and cooperate to resolve the conflict.

Benchmarking (see "rm_work + pybootchart enhancements" on the OE-core
mailing list) showed that builds with the modified rm_work.bbclass
were both faster (albeit not by much) and required considerably less
disk space (14230MiB instead of 18740MiB for core-image-sato).
Interestingly enough, builds with rm_work.bbclass were also faster
than those without.

(From OE-Core rev: 936179754c8d0f98e1196ddc6796fdfd72c0c3b4)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Patrick Ohly 3ba8917c4d rm_work.bbclass: allow preserving additional content
By default, do_rm_work either skips recipes entirely (when listed in
RM_WORK_EXCLUDE) or removes everything except for temp.

In meta-swupd, virtual image recipes collaborate on producing update
data for the base recipe. Tasks running in the base recipe need some
information from the virtual images.

Those files could be passed via a new shared work directory, but that
scatters data in even more places. It's simpler to use the normal
WORKDIR and teach rm_work.bbclass to not remove the special output
with the new RM_WORK_EXCLUDE_ITEMS.

(From OE-Core rev: 28fbb2dd17033308cc09811fbc4f43e2f6c17f54)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:48 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Ross Burton 7966afa64a rm_work: add do_write_qemuboot_conf to task list
We need to add do_write_qemuboot_conf to the list of tasks to be wiped as
otherwise the second time an image is built it will fail.

[ YOCTO #10758 ]

(From OE-Core rev: 3206f408e908870629eb47afac6249a3c9497a66)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:20 +00:00
Richard Purdie 71c8376116 rm_work: Ensure we don't remove sigbasedata files
We don't remove sigdata files, we also shouldn't remove sigbasedata files
as this hinders debugging.

(From OE-Core rev: 988349f90c8dc5498b1f08f71e99b13e928a0fd0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
Ed Bartosh 1a620968b1 rm_work: don't remove timestamps of image tasks
Excluded removal of do_bootimg, do_bootdirectdisk and do_vmimg
timestamps to prevent unneeded rootfs rebuilds.

[YOCTO #10159]

(From OE-Core rev: f214da502ad7eda27460dc6f06e9cd29a114f2d2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-23 17:44:41 +01:00
Ross Burton 4f8f3f6cb4 classes/rm_work: use the idle I/O scheduler class
As rm_work is just cleanup it shouldn't starve more important tasks such as
do_compile of I/O, so use BB_TASK_IONICE_LEVEL to run the task in the idle
scheduler class.

(From OE-Core rev: 6025a14dbbd09b2805fe2e17ddc24f2a515cb832)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 18:05:22 +01:00
Martin Jansa d9e47a522a rm_work: exclude all kernel recipes
* otherwise kernel is rebuilt every single time and often it fails when
  building external modules

[YOCTO #9352]

(From OE-Core rev: 9d23daf03ece06185224f869e9b7f73789689c2d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-07 15:22:37 +01:00
Richard Purdie 3341f3fbee classes: Fix do_rootfs references
After the separation of do_rootfs, some rootfs references need changing
to image_complete.

(From OE-Core rev: 59a5f596ca29b1eb8283706e3c60fbb39f9c2c23)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:29 +00:00
Jate Sujjavanich efc07c2936 rm_work.bbclass: Exclude do_rootfs stamp removal
This prevents unneeded rootfs rebuilds if the metadata has not changed
while using rm_work.

(From OE-Core rev: 7550b13786caa68a9944cd802eb970acbd17e754)

Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:33 +00:00
Richard Purdie f5f2467e4b kernel/rm_work: Improve interaction
The do_shared_workdir task does leave behind the necessary information in
shared-work after it completes. We don't make this a "full" sstate task
however since that means tarring up and copying what is usually a large
amount of data which would be better extracted straight from the original
SCM.

The issue with rm_work occurs since it removes the do_shared_workdir stamp
meaning subsequent builds will add it back if they need to touch any kernel
modules for example. This ends up triggering a near enough complete kernerl
rebuild since if configure reruns, populate_sysroot has to rerun.

This change promotes the task to have a "setscene" variant but it doesn't use
any of the sstate class lifting to generate the sstate file. The sstate function
will therefore never get called since the sstate object will never exist.

We can add the task to the list of tasks rm_work promotes to a setscene variant
and unwanted rebuilds of the kernel should be avoided.

(From OE-Core rev: 55b4f7fd217f0c65d457c731150340c18fb3fa19)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-15 17:44:59 +01:00
Richard Purdie 2aa210cbc5 rm_work: Fix RM_WORK_EXCLUDE for image/sdk recipes
A previous change meant image/sdk recipes were removed unconditionally
by the class and did not respect RM_WORK_EXCLUDE. This fixes that
problem.

[YOCTO #7114]

(From OE-Core rev: 050de16968fe6efeba5d64761b11512549e9fdc2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-08 09:24:47 +00:00
Richard Purdie 6476f0bf3d rm_work: Speed up rootfs/populate_sdk removal
Commands like bitbake X -c rootfs or bitbake X -c populate_sdk do not
trigger rm_work to clean up the directories afterwards since it
traditionally hooks onto do_build. This change means those two tasks now
clean up after themselves. We use the cleandirs function attribute to
handle this.

[YOCTO #6413]

(From OE-Core rev: 6bf06d80c2ce03dfdedac5ad8cf42ef8e36b0ecb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:01:21 +00:00
Ming Liu b08958bc22 rm_work.bbclass: ignore failure for removing pseudo folder
When building over NFS2/3 server, removal of pseudo folders will fail in
some cases for there are files in it still used by pseudo daemon, thus
cause ".nfsXXXXX" files generated which can't be removed by clients. This
will lead rm_work task fo fail.

These failures could be safely ignored because ".nfsXXXXX" files would be
automatically cleared by NFS server when no clients keep opening them.

[YOCTO #4531]
[ CQID: WIND00412051 ]

(From OE-Core rev: 9742e866f545bc0d04aca697b541ed88f4e1764a)

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 14:14:48 +01:00
Paul Eggleton bdca492741 classes/rm_work: rename RM_WORK_WHITELIST to RM_WORK_EXCLUDE
This really functions as a blacklist, not a whitelist, since we are
listing recipes to exclude. To avoid any possibility of confusion, since
this was a recent addition, rename the variable.

(From OE-Core rev: 4d56de8018d550b3d181d451900cbfb698d64141)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26 21:19:51 +00:00
Chen Qi 83409910dd rm_work.bbclass: inhibit rm_work per recipe
Use RM_WORK_WHITELIST to inhibit rm_work per recipe. In this way,
one can use rm_work for the most of the recipes but still keep the
work area for the recipe(s) one is working on.

As an example, the following settings in local.conf will inhibit
rm_work for icu-native, icu and busybox.
    INHERIT += "rm_work"
    RM_WORK_WHITELIST += "icu-native icu busybox"

If we comment out the RM_WORK_WHITELIST line and do a rebuild, the
working area of these recipes will be cleaned up.

[YOCTO #3675]

(From OE-Core rev: 6c930c3c06f2e698540626c87bd7f7f571df35ef)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18 13:18:21 +00:00
Martin Jansa f090c1523f rm_work: remove package and packages-split dirs
* as described in
  http://git.openembedded.org/openembedded-core/commit/?id=6107ee294afde395e39d084c33e8e94013c625a9

(From OE-Core rev: 4067afcda78d17058f2aa8d7f82173d181e0aae4)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-02 12:56:53 +00:00
Robert P. J. Day 951aa5ea1f Various typoes fixed, all comments or output strings.
Typoes fixed: "enviroment", "editted", "spliting", "scheulder".

(From OE-Core rev: 17e981a857a51b0bec08c929e8539d36d83874b6)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-26 12:13:05 +01:00
Martin Jansa 3b084defa2 rm_work: keep all sigdata files in stamps dir
* this makes fix for [YOCTO #1074] in bitbake 139b8a625818225c358a1b8363518d7ed6913188
  much more usefull for people using rm_work

(From OE-Core rev: 36386f3b8cadf283954f5c6db6ac6ee463c395de)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-27 00:48:12 +01:00
Richard Purdie ec071acf23 rm_work.bbclass: Improve handling of noexec tasks
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-21 12:58:06 +00:00
Richard Purdie 5cac571791 rm_work.bbclass: Fix typo for package task directory preservation
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 12:21:37 +00:00
Richard Purdie 1a559cbcca rm_work: Retain package and package-split directories to be consistent with sstate code
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-03 11:34:04 +00:00
Richard Purdie e8e9f56057 rm_work.bbclass: Update to convert stamps to setscene stamps
We need to manipulate the stamps when removing WORKDIR to indicte that
tasks like compile or install can't just rerun. The most effective method
to do this is to convert the layout to match that which would have been the
case had the system been build from sstate packages.

For example, we'd task stamps like:

xxx-1.4.7-r3.do_compile
xxx-1.4.7-r3.do_configure
xxx-1.4.7-r3.do_fetch
xxx-1.4.7-r3.do_generate_toolchain_file
xxx-1.4.7-r3.do_install
xxx-1.4.7-r3.do_package.emenlow
xxx-1.4.7-r3.do_package_write
xxx-1.4.7-r3.do_package_write_ipk
xxx-1.4.7-r3.do_package_write_rpm
xxx-1.4.7-r3.do_patch
xxx-1.4.7-r3.do_populate_sysroot.emenlow
xxx-1.4.7-r3.do_setscene
xxx-1.4.7-r3.do_unpack

and after rm_work, we'd have stamps of:

xxx-1.4.7-r3.do_package_setscene.emenlow
xxx-1.4.7-r3.do_package_write_ipk_setscene
xxx-1.4.7-r3.do_package_write_rpm_setscene
xxx-1.4.7-r3.do_populate_sysroot_setscene.emenlow

We also need to handle stamps in the form xxx-1.4.7-r3.do_package.MACHINE.TASKHASH
as used by some signature generators.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-27 11:10:57 +00:00
Richard Purdie 67d6814b77 rm_work: With the recent pseudo changes, this no longer makes sense
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-21 00:59:17 +00:00
Richard Purdie 8a391c3d71 rm_work: Set BB_SCHEDULER as done in OE.dev to ensure disk space is freed sooner rather than at the end of the build
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-28 13:54:31 -08:00
Richard Purdie 74e47d42d6 rm_work.bbclass: Handle case where pseudo directory doesn't exist
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-23 00:56:38 +01:00
Richard Purdie 99c0cbd6d6 rm_work: Fix interaction issues with pseudo
This class needs to wipe out the contents of the pseudo database but also
ensure the pseudo directory exists for any subsequent tasks and also ensure
any pseudo server has shut down before removing the database. This patch
does all of these things.

[BUGID #222]

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-12 15:52:07 +01:00
Richard Purdie 2685863618 rm_work.bbclasS: Don't remove the pseudo database as it causes problems with meta-toolchin
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-25 15:27:16 +01:00
Richard Purdie dfa8101ba0 rm_work.bbclass: Update for bitbake 1.8.8
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2633 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-09-01 16:45:43 +00:00
Richard Purdie 720e0b144c classes: Sync various classes with OE for various bugfixes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2407 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-08 20:41:55 +00:00
Ross Burton 56a65b34e8 Fix bashisms
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1281 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-02-21 17:21:43 +00:00
Richard Purdie e09dab0614 classes: Sync with OE - mainly quoting fixes or other minor updates
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@885 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-20 15:19:39 +00:00
Richard Purdie b2f192faab Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-07-21 10:10:31 +00:00