Re: [OE-core] [RFC PATCH 1/2] classes/buildhistory: record SRC_URI

Mikko Rapeli
2020-10-26T06:43:06Z

On Sun, Oct 18, 2020 at 09:03:56PM -0700, Paul Eggleton wrote:
> From: Paul Eggleton <paul.eggleton@microsoft.com>
>
> It can be useful to record SRC_URI into buildhistory for the purposes of
> tracking exactly which sources got built (we already have SRCREV) as
> well as getting an indication when changes to the SRC_URI relate to
> changes in the output.
>
> Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com>

I have similar patch in our poky trees. Also have patches
to export LICENSE and CVE_PRODUCT to buildhistory. These are used
by some post-build QA check scripts.

Acked-by: Mikko Rapeli <mikko.rapeli@bmw.de>

Cheers,

-Mikko

> ---
> meta/classes/buildhistory.bbclass | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
> index 0f26c3c..7d5e3eb 100644
> --- a/meta/classes/buildhistory.bbclass
> +++ b/meta/classes/buildhistory.bbclass
> @@ -116,6 +116,7 @@ python buildhistory_emit_pkghistory() {
> self.srcrev = ""
> self.layer = ""
> self.config = ""
> + self.src_uri = ""
>
>
> class PackageInfo:
> @@ -258,6 +259,7 @@ python buildhistory_emit_pkghistory() {
> rcpinfo.packages = packages
> rcpinfo.layer = layer
> rcpinfo.config = sortlist(oe.utils.squashspaces(d.getVar('PACKAGECONFIG') or ""))
> + rcpinfo.src_uri = oe.utils.squashspaces(d.getVar('SRC_URI') or "")
> write_recipehistory(rcpinfo, d)
>
> bb.build.exec_func("read_subpackage_metadata", d)
> @@ -368,6 +370,7 @@ def write_recipehistory(rcpinfo, d):
> f.write(u"PACKAGES = %s\n" % rcpinfo.packages)
> f.write(u"LAYER = %s\n" % rcpinfo.layer)
> f.write(u"CONFIG = %s\n" % rcpinfo.config)
> + f.write(u"SRC_URI = %s\n" % rcpinfo.src_uri)
>
> write_latest_srcrev(d, pkghistdir)
>
> --
> 1.8.3.1
>

>
>
>