[08/13] set default sstate signature handler to OEEquivHash

Message ID 20261002144936.246628-9-felix.moessbauer@siemens.com
State New
Headers show
Series More build time reductions | expand

Commit Message

Felix Moessbauer Oct. 2, 2026, 2:49 p.m. UTC
Using the OE hash equivalence drastically reduces build times on
repeated builds, given that all sstate artifacts are reproducible.

This feature has been extensively tested in Yocto and also is the new
default there. By that, we switch as well.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 RECIPE-API-CHANGELOG.md | 11 +++++++++++
 meta/conf/bitbake.conf  |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)

Patch

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 4711fb72..f606ecaa 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -1239,3 +1239,14 @@  runnable, the variant itself does not need to build to completion. In addition,
 the name and the content of the source package must be derived from `${BPN}`
 alone, never from `${PN}`. If a source package depends on the architecture,
 set `SRCPKG_PROVIDER = "${BPN}"` after `inherit dpkg` (or alike).
+
+### Default sstate signature handler changed to OEEquivHash
+
+The default `BB_SIGNATURE_HANDLER` is now `OEEquivHash` (instead of `OEBasicHash`),
+and `BB_HASHSERVE` defaults to `auto`. Using BitBake's hash equivalence drastically
+reduces build times on repeated builds by reusing sstate artifacts across signature
+changes, provided that the artifacts are reproducible.
+
+To preserve the hash equivalence database across `TMPDIR` cleanups, set the
+`BB_HASHSERVE_DB_DIR` environment variable to a persistent location, ideally
+managed together with the `SSTATE_DIR`.
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index c31719b8..cbe284df 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -98,7 +98,8 @@  REPO_BASE_DIR = "${DEPLOY_DIR}/base-apt/${DISTRO}/apt"
 REPO_BASE_DB_DIR = "${DEPLOY_DIR}/base-apt/${DISTRO}/db"
 
 # Setup our default hash policy
-BB_SIGNATURE_HANDLER ?= "OEBasicHash"
+BB_SIGNATURE_HANDLER ?= "OEEquivHash"
+BB_HASHSERVE ??= "auto"
 BB_HASHEXCLUDE_ISAR ?= "CCACHE_DEBUG LAYERDIR_core SCRIPTSDIR TOPDIR ISAR_BUILD_UUID \
     RUN_PRIVILEGED_CMD UNSHARE_SUBUID_BASE GNUPGHOME"
 BB_HASHEXCLUDE_COMMON ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH BBSERVER DL_DIR \