Friday, March 16, 2012

Post do_package tasks and rm_work

Recently I ran into an issue surrounding a task that we needed to have run after the do_package task because some of its side effects muddied the ${D} directory with files we didn't want to be in our ipk package. We created a task do_create_foo that did the work we needed and set it to run after do_package. To our surprise, the stamp for the task was never created and the task tried to run every a recipe that depended on this one ran. This was especially bad since we use the rm_work class to save disk space, so when do_create_foo was run again, the ${D} was often missing entirely.

Some very long digging later, we discovered that the rm_work class was actually removing the stamp because it wasn't in its hard coded list or in the SSTATETASKS list. Since we didn't want to mess with making the task into an sstate task, we pulled a copy of rm_work.bbclass into our layer and added *do_create_foo* to the case statement in do_rm_work. Your mileage may vary, but hopefully this helps anyone out there with the case of the missing stamp!