An Overview of the Hash Equivalence & PR Services
2021-12-01 , Room A

This talk will give an overview of the Yocto Project's Hash Equivalence Service
(hashserv) and PR Service (prserv). The use cases for these tools will be
explored and a demo of each will be given. The new features added to these
services since the initial dunfell release in April 2020 will then be discussed,
highlighting the read-only modes and the support for connecting to an upstream
service. The new features will be demonstrated and the new use cases which these
features enable will be presented. Finally, possible future developments will be
discussed.

This talk will be appropriate for attendees familiar with bitbake but with no
prior knowledge of these services. It will also be useful to those with
experience using these services who are unfamiliar with the new features added
since the dunfell release.


hashserv

When bitbake looks at the inputs for a build task (the recipe, inherited
classes, relevant variables set by conf files and the inputs of other relevant
build tasks), a hash of the input data is generated. This is the basis of the
Shared State (sstate) caching provided by bitbake - if in a future build the
hash of the input data for a build task is the same, the previously generated
sstate can be reused instead of re-running the build task. This allows for
significant time savings in subsequent builds once the sstate cache is
populated.

The Hash Equivalence Service (hashserv) is a standalone service developed within
the bitbake project which can further improve sstate re-use. It maintains a
database of input hashes for build tasks and the hashes of their output data.
Traditionally, if the input hash for a build task changes then all dependent
tasks need to be re-executed even if the output data from the first task is
identical. However with hashserv enabled, bitbake can detect the case where
output data from a task is identical to a previous execution and it can mark the
two different input hashes as equivalent. This allows dependent tasks to be
skipped where sstate data is available for the previous input hash, potentially
giving significant improvements in sstate re-use and corresponding reductions in
build time.

prserv

The PR Service (prserv) is a standalone service developed within the bitbake
project which maintains a database of input hashes for build tasks and a
corresponding package revision (PR) value. This allows bitbake to ensure that
the package revision increments each time a recipe is rebuilt with different
input data. This in turn ensures that on-device package upgrades work as
expected when a package is rebuilt

See also: Slides (699.8 KB)

Paul Barker has been an active member of the OpenEmbedded & Yocto Project community since 2013. He has contributed to the project in many ways, including maintaining opkg in 2013-2015. More recent work has focused on Board Support Packages for several single board computers and core components such as the archiver.

As a Principal Software Engineer at SanCloud Ltd (UK), Paul is responsible for maintaining the Yocto Project BSP for SanCloud hardware, developing bespoke solutions for customers and representing SanCloud within the Automotive Grade Linux community. Paul previously worked as an Embedded Linux consultant with Konsulko (USA/Global) and Beta Five Ltd (UK) and before that he was responsible for the development and maintenance of Linux support at CommAgility Ltd, a manufacturer of telecomms test equipment.

Paul is a regular speaker at Yocto Project developer day and summit events, often speaking about license compliance tooling and best practices. He has also spoken at Linaro Virtual Connect 2020, Embedded Linux Conference 2019 and other conferences. Prior to working in Embedded Linux Paul was a research student studying underwater acoustics & underwater noise monitoring and presented research at several academic conferences.

This speaker also appears in: