[OE-core] [PATCH V2] Modify buildstats to be merged inside buildhistory

Stoicescu, CorneliuX corneliux.stoicescu at intel.com
Thu Jan 9 10:46:07 UTC 2014


> > --- a/meta/classes/buildhistory.bbclass
> > +++ b/meta/classes/buildhistory.bbclass
> > @@ -16,9 +16,12 @@ BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd
> /etc/group"
> >  BUILDHISTORY_COMMIT ?= "0"
> >  BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory
> <buildhistory@${DISTRO}>"
> >  BUILDHISTORY_PUSH_REPO ?= ""
> > +BUILDSTATS_BASE = "${BUILDHISTORY_DIR}/buildstats"
> >
> >  SSTATEPOSTINSTFUNCS += "buildhistory_emit_pkghistory"
> >
> > +inherit buildstats
> > +
> 
> I don't think we need this inherit line. The user can still decide whether to
> include it or not, if it is included, it can be under buildhistory control. So it
> should be safe simply to remove it.
> 

Removing this inherit and using the manual suggested steps to activate buildhistory in local.conf:
"
INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1"
"

Will result in buildhistory being inherited before buildstats:
"
cornel at NODE1:~/SSD/poky/build$ bitbake -e | grep 'INHERIT='
INHERIT=" buildhistory poky-sanity package_rpm buildstats image-mklibs image-prelink debian devshell sstate license sanity"
"

This will cause part of the build_stats file(which is written at the end of the build) to be left out of the commits when git is used for buildhistory:
"
cornel at NODE1:~/SSD/poky/build/buildhistory$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   buildstats/core-image-minimal-qemux86-64/201401091123/build_stats
#
no changes added to commit (use "git add" and/or "git commit -a")
"

An easy way to avoid this is to activate buildhistory by adding it after buildstats in USER_CLASSES in local.conf:
"
USER_CLASSES ?= "buildstats image-mklibs image-prelink buildhistory"
"
Or
"
USER_CLASSES += "buildhistory"
"

So in order to make this work, we either change the suggested way to enable buildhistory or find a workaround in code.

Regards,
Corneliu



More information about the Openembedded-core mailing list