Bug 15727

Summary: PERSISTENT_DIR might need some additions regarding hash equivalence server
Product: [Documentation] BitBake User Manual Reporter: Robert Berger <pokylinux>
Component: bitbake-manualAssignee: Antonin Godard <antonin.godard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Low CC: JPEWhacker, randy.macleod
Version: 5.2   
Target Milestone: 5.3 M4   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Robert Berger 2025-01-25 12:15:04 UTC
PERSISTENT_DIR
Specifies the directory BitBake uses to store data that should be preserved between builds. In particular, the data stored is the data that uses BitBake’s persistent data API and the data used by the PR Server and PR Service.[1]

[1] https://docs.yoctoproject.org/bitbake/dev/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-PERSISTENT_DIR

If BB_HASHSERVE is set to auto, BitBake automatically starts its own hash equivalence server locally over a UNIX domain socket on demand.

In this case, in addition to prserv.sqlite3 also bb_unihashes.dat and hashserv.db are stored in PERSISTENT_DIR. So it's not just data for the PR Server and the PR Service, but also for the hash equivalence server.

It might be beneficial to share PERSISTENT_DIR between local builds.

------------

Please review and probably rephrase some things here.
Comment 1 Joshua Watt 2025-01-30 15:38:31 UTC
PERSISTENT_DIR is not intended to be shared between multiple builders in general; otherwise please send a patch to the documents to mention that the hash equivalence data is stored here by default
Comment 2 Robert Berger 2025-01-30 16:01:39 UTC
1)

My point is, that the doc talks only about the PR Server and PR Service. The hash equivalence server's data end up there as well. And this should probably be added to the doc.

As you mention, I could add to the docs, that the hash equivalence data is stored here by default.

2) 

I currently share PERSISTENT_DIR between different builds on the same machine. Maybe I should mention, that I only run one build at a time on the same machine. What would be the potential problem, if PERSISTENT_DIR is shared between multiple local builds?

I could also add something like "PERSISTENT_DIR is not intended to be shared between multiple builders in general", but curious, as I am, I would also like to add some reasons ;)
Comment 3 Randy MacLeod 2025-02-18 21:17:20 UTC
Taking out of NEEDINFO since at least some work can happen to document this variable now.
Comment 4 Robert Berger 2025-04-24 20:09:16 UTC
As far as I can see, the documentation of PERSISTENT_DIR is still the same and I am still confused how it should be used.
Comment 5 Antonin Godard 2025-06-06 07:45:00 UTC
Bulk move of bugs I am assigned to from Milestone 5.2 to 5.3M1.
Comment 7 Antonin Godard 2025-10-23 08:36:53 UTC
With https://git.yoctoproject.org/yocto-docs/commit/?id=0ff0233770b77f9e74f4241dfb555dac2741d8b9 the description of PERSISTENT_DIR should be complete. It is also backed up by recent hash equivalence documentation updates: https://git.yoctoproject.org/yocto-docs/commit/?id=4ff998336efdc507de1311e43bf8f4a6258c610a.

If there are no objections I will close this bug soon.
Comment 8 Antonin Godard 2025-10-31 08:43:51 UTC
Moving to Resolved Fixed as per comment #7.