[yocto] When is a task rerun?

Paul Eggleton paul.eggleton at linux.intel.com
Tue Nov 22 16:59:33 PST 2016


Hi Xiaohui,

On Tue, 22 Nov 2016 13:25:10 Xiaohui Liu wrote:
> Under what condition will a task be rerun? My understanding is that each
> task has a signature/checksum stored somewhere in tmp/. If the checksum
> changes, bitbake will look for shared state cache in SSTATE_DIR and then in
> SSTATE_MIRRORS. If no match is found, the task is run. Is my understanding
> right? Plus, where is the checksum stored in tmp/?

Mostly correct. Basically, the checksums are calculated at various points on
the fly based on the inputs to the task - i.e. the task function itself, plus
the signatures of dependencies (variables and functions). When a task actually
runs to completion a stamp file is written into tmp/stamps using the checksum
as part of the name. If some inputs change then the checksum changes and the
stamp no longer matches, thus if you call for that task (either directly or as
a dependency of another task) it will re-run.

The sstate cache is for certain selected tasks (those added to SSTATE_TASKS)
which produce some output that can be practically cached. At the start of the
build the SSTATE_DIR (and SSTATE_MIRRORS, if set) will be checked for any
sstate packages matching the current signatures of the tasks to be run, and if
available the packages will be unpacked instead of running the actual task.

This section of the reference manual may be helpful:

  http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#shared-state-cache

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list