Modify buildstats to be merged inside buildhistory
PATCH v2 1/1 Modify buildstats to be merged inside buildhistory
- added buildstats inheritance inside buildhistory
- when buildhisory is used, buildstats will be moved inside the buildhistory directory
--- meta/classes/buildhistory.bbclass | 3 +++ meta/classes/buildstats.bbclass | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
meta/classes/buildhistory.bbclass +3 -0
@@ -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 + # # Write out metadata about this package for comparision when writing future packages #
meta/classes/buildstats.bbclass +1 -1
@@ -1,4 +1,4 @@ -BUILDSTATS_BASE = "${TMPDIR}/buildstats/" +BUILDSTATS_BASE ??= "${TMPDIR}/buildstats/" BNFILE = "${BUILDSTATS_BASE}/.buildname" DEVFILE = "${BUILDSTATS_BASE}/.device"
Signature · 1 line
1.7.9.5
Quoted 2 lines · Corneliu Stoicescu
- added buildstats inheritance inside buildhistory
- when buildhisory is used, buildstats will be moved inside the buildhistory directory
This does not seem to have a Signed-off-by:
Please submit a v2 for review.
Thanks
Sau!
Quoted 33 lines
--- meta/classes/buildhistory.bbclass | 3 +++ meta/classes/buildstats.bbclass | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)meta/classes/buildhistory.bbclass +3
-0@@ -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 + # # Write out metadata about this package for comparision when writing future packages #meta/classes/buildstats.bbclass +1
-1@@ -1,4 +1,4 @@ -BUILDSTATS_BASE = "${TMPDIR}/buildstats/" +BUILDSTATS_BASE ??= "${TMPDIR}/buildstats/" BNFILE = "${BUILDSTATS_BASE}/.buildname" DEVFILE = "${BUILDSTATS_BASE}/.device"
Quoted 12 lines · Corneliu Stoicescu
- added buildstats inheritance inside buildhistory
- when buildhisory is used, buildstats will be moved inside the buildhistory directory--- meta/classes/buildhistory.bbclass | 3 +++ meta/classes/buildstats.bbclass | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)meta/classes/buildhistory.bbclass +0
-0
meta/classes/buildhistory.bbclass BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group" · line 24
Quoted 9 lines
meta/classes/buildhistory.bbclass +3
-0@@ -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.
Cheers,
Richard
Quoted 10 lines
meta/classes/buildhistory.bbclass BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd
Quoted 3 lines
meta/classes/buildhistory.bbclass +0
-0@@ -16,9 +16,12 @@ BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd
/etc/group"meta/classes/buildhistory.bbclass BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd · line 17
Quoted 2 lines
meta/classes/buildhistory.bbclass +0
-0BUILDHISTORY_COMMIT ?= "0" BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory<buildhistory@${DISTRO}>"
Quoted 3 lines
meta/classes/buildhistory.bbclass +1
-0BUILDHISTORY_PUSH_REPO ?= "" +BUILDSTATS_BASE = "${BUILDHISTORY_DIR}/buildstats"
Quoted 9 lines
meta/classes/buildhistory.bbclass BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group" · line 24
Quoted 4 lines
meta/classes/buildhistory.bbclass +2
-0SSTATEPOSTINSTFUNCS += "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@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@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