Search code examples
hashyoctobitbakeopenembedded

How are checksums (hash) generated in yocto for the sstate cache?


I'm trying to get more insight into how the sstate cache works for yocto/bitbake. I understand that many dependent hashes, and things like timestamp are used to make a checksum (hash? I see both in the documentation...). I would like to know what are the specific steps taken to create the hash that is used in the sstate. I haven't had much luck finding any details in the docs, so if anyone knows, or cares to link relevant docs, I would be grateful.


Solution

  • To know what exactly makes it to the sstate-cache, you can run bitbake-dumpsig on your recipe (+ task) you want to have a look at or pass directly the sigdata file of your recipe task to it. This will print everything that is used for the sstate-cache of this task.

    It's a great tool when you want to understand why a recipe is not being rebuilt. For when a recipe is a being rebuilt without you wanting to, have a look at bitbake-diffsigs which will output the differences between the two sigdata, highlighting what triggered a rebuild.

    For more info on sstate-cache, I can recommend reading "Sstate-cache magic" slides from Yocto Project Summit 2019: https://wiki.yoctoproject.org/wiki/images/1/18/Yocto_Summit_Lyon_Day2_2019.pdf