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

Ross Burton
2025-03-12T13:40:59Z

On 6 Mar 2025, at 14:26, Pedro Ferreira via lists.openembedded.org <pedro.silva.ferreira=criticaltechworks.com@lists.openembedded.org> wrote:
>
> Simple scenario to test it:
> Pre-conditions:
> INHERIT += "buildhistory"
> BUILDHISTORY_RESET = "1"
> BUILDHISTORY_PRESERVE:append = " files-in-package.txt"
>
> Run:
> bitbake -c cleansstate base-passwd && bitbake base-passwd
> Check:
> cat PATH_TO_BUILD_dir/buildhistory/packages/core2-64-poky-linux/base-passwd/base-passwd-dbg/files-in-package.txt
> (File exists and content ok)
> Run:
> rm -rf tmp && bitbake base-passwd (it will use sstate cache)
> Check:
> cat PATH_TO_BUILD_dir/buildhistory/packages/core2-64-poky-linux/base-passwd/base-passwd-dbg/files-in-package.txt
> (File wont exist)
> Cheers,

There’s an even bigger problem with BUILDHISTORY_RESET, where recipes from sstate are just not entering the buildhistory at all…

From a clean buildhistory and build tree, if an entire image can be populated from sstate then there’s just nothing in buildhistory for the packages, as it’s only populated on do_package which won’t actually be re-ran.

Adding files-in-package.txt to preserve feels like a workaround for that problem, am I right? Apart from the fact that it doesn’t actually work when the buildhistory repository is empty from the beginning.

Ross