Re: sharing sstate in bitbake-setup

Richard Purdie <[email protected]>
Newsgroups org.yoctoproject.lists.yocto,org.openembedded.lists.openembedded-core
Message-ID <7cefc9025cec54cc835cd3b065aa653f95a38634.camel@linuxfoundation.org>
On Wed, 2025-11-26 at 17:13 +0100, Alexander Kanavin wrote:
> On Tue, 25 Nov 2025 at 14:54, Alexander Kanavin via
> lists.yoctoproject.org <[email protected]>
> wrote:
> > BB_HASHSERVE_SHARED_DB = "/path/to/common/hashserv.db"
> > 
> > bitbake-setup would put this (and SSTATE_DIR) into site.conf that is
> > symlinked into every build.
> 
> I quickly hacked bitbake's cooker.py to try this out:
> 
> -                dbfile = (self.data.getVar("PERSISTENT_DIR") or
> self.data.getVar("CACHE")) + "/hashserv.db"
> +                dbfile = "/home/alex" + "/hashserv.db"
> 
> 
> And then made two build directories with shared SSTATE_DIR.
> 
> TL;DR: everything ran smoothly and as expected.
> 
> I ran overlapping builds, added no-ops to gnu-config recipe to 'force'
> hash equivalency, and there were no errors or crashes, and sstate was
> reused as expected.
> 
> So I think we should do it like this, subject to 'shared-sstate'
> setting in bitbake-setup, on by default.

PERSISTENT_DIR is *not* designed to be shared between builds. it might
happen to work but is a really bad idea. Personally, I think those
cache directory variables and cache layout need redesigning so we
should probably take the opportunity to do that.

Cheers,

Richard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.