Re: [OE-core] [PATCH] buildhistory.bbclass: restore BUILDHISTORY_PRESERVE files

Fabio Berton
2025-06-25T10:26:59Z

Hi Richard,
Thanks for looking into this. I was wondering if there is a way to know whether BUILDHISTORY_PRESERVE, or another variable, is not intended to be part of the end user API?

Regards,

Fabio

On 6/23/25 21:48, Richard Purdie via lists.openembedded.org wrote:
> On Wed, 2025-01-15 at 15:31 +0000, Pedro Ferreira via lists.openembedded.org wrote:
>> From: Pedro Ferreira <Pedro.Silva.Ferreira@criticaltechworks.com>
>>
>> On each build using sstate-cache, buildhistory will move
>> content to a temporary folder named `old`.
>> When buildhistory looks for the main dir, it wont find it
>> and ends up creating it.
>> As a consequence how code is structured wont restore any
>> preserved file.
>>
>> Code block moved to ensure if old dir exists, it will
>> attempt to restore those files marked to preserve.
>>
>> Signed-off-by: Pedro Silva Ferreira <Pedro.Silva.Ferreira@criticaltechworks.com>
>> ---
>>  meta/classes/buildhistory.bbclass | 15 +++++++--------
>>  1 file changed, 7 insertions(+), 8 deletions(-)
>
> I spent a lot of time on Friday looking at this. The BUILDHISTORY_RESET
> code path is horrible to understand and basically just hacked into na
> don top of the rest of the system. BUILDHISTORY_PRESERVE was never
> really intended as a end user API either.
>
> After much consideration, I've sent a patch proposing we remove support
> for BUILDHISTORY_RESET. I think the behaviour would be better coded
> into the CI integration in different cases.
>
> If we do want in tree support for this "reset" functionality, it needs
> to be written in a way where the code can be understood and it needs to
> have test cases. It would also need documentation as these code paths
> are currently undocumented.
>
> As Ross previously mentioned the interaction with an sstate cache is
> also horrible and is another reason I think it is safer for the user to
> do what they want/need CI side rather than in the class code. Sorry it
> has taken as long to work all this out, the code really is hard to
> unravel.
>
> Cheers,
>
> Richard
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#219219): https://lists.openembedded.org/g/openembedded-core/message/219219
> Mute This Topic: https://lists.openembedded.org/mt/110629321/6083838
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [fbberton@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>