Skip to contentSkip to conversation

buildhistory: write the contents of the sysroot

PATCH In review Ross Burton 2 participants 4 messages Jun 27, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 buildhistory: write the contents of the sysroot

Changes to the sysroot as just as interesting during development, so write the file listing for the sysroot to buildhistory too.

---
 meta/classes/buildhistory.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
meta/classes/buildhistory.bbclass +9 -1
index 2e501df24b4..baa7c8e2799 100644
@@ -60,15 +60,23 @@ SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "| buildhistory_emit_outputsigs"
 # When extending build history, derive your class from buildhistory.bbclass
 # and extend this list here with the additional files created by the derived
 # class.
-BUILDHISTORY_PRESERVE = "latest latest_srcrev"
+BUILDHISTORY_PRESERVE = "latest latest_srcrev sysroot"
 
 PATCH_GIT_USER_EMAIL ?= "buildhistory@oe"
 PATCH_GIT_USER_NAME ?= "OpenEmbedded"
 
+buildhistory_emit_sysroot() {
+	mkdir --parents ${BUILDHISTORY_DIR_PACKAGE}
+	buildhistory_list_files ${SYSROOT_DESTDIR} ${BUILDHISTORY_DIR_PACKAGE}/sysroot
+}
+
 #
 # Write out metadata about this package for comparison when writing future packages
 #
 python buildhistory_emit_pkghistory() {
+    if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']:
+        bb.build.exec_func("buildhistory_emit_sysroot", d)
+
     if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
         return 0
 
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 buildhistory: report sysroot changes

Now that the sysroot is written into the build history, write it out.

---
 meta/lib/oe/buildhistory_analysis.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta/lib/oe/buildhistory_analysis.py +10 -1
index 62c7a2e58ea..8af76c6b3a3 100644
@@ -181,7 +181,7 @@ class ChangeRecord:
             diff = difflib.unified_diff(alines, blines, self.fieldname, self.fieldname, lineterm='')
             out += '\n  '.join(list(diff)[2:])
             out += '\n  --'
-        elif self.fieldname in img_monitor_files or '/image-files/' in self.path:
+        elif self.fieldname in img_monitor_files or '/image-files/' in self.path or self.fieldname == "sysroot":
             if self.filechanges or (self.oldvalue and self.newvalue):
                 fieldname = self.fieldname
                 if '/image-files/' in self.path:
@@ -571,6 +571,15 @@ def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep
             elif filename.startswith('latest.'):
                 chg = ChangeRecord(path, filename, d.a_blob.data_stream.read().decode('utf-8'), d.b_blob.data_stream.read().decode('utf-8'), True)
                 changes.append(chg)
+            elif filename == 'sysroot':
+                alines = d.a_blob.data_stream.read().decode('utf-8').splitlines()
+                blines = d.b_blob.data_stream.read().decode('utf-8').splitlines()
+                filechanges = compare_file_lists(alines,blines)
+                if filechanges:
+                    chg = ChangeRecord(path, filename, None, None, True)
+                    chg.filechanges = filechanges
+                    changes.append(chg)
+
         elif path.startswith('images/'):
             filename = os.path.basename(d.a_blob.path)
             if filename in img_monitor_files:
Signature · 1 line
2.11.0
#2 lore raw
In reply to Ross Burton
Quoted 1 line

Changes to the sysroot as just as

small typo in commit message if you need to update this commit again for whatever other reason.

Quoted 55 lines · Ross Burton

Changes to the sysroot as just as interesting during development, so write the
file listing for the sysroot to buildhistory too.

---
 meta/classes/buildhistory.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
meta/classes/buildhistory.bbclass +0 -0
index 2e501df24b4..baa7c8e2799 100644
@@ -60,15 +60,23 @@ SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "|

buildhistory_emit_outputsigs"
# When extending build history, derive your class from
buildhistory.bbclass

 # and extend this list here with the additional files created by the
derived
 # class.
meta/classes/buildhistory.bbclass +4 -1
-BUILDHISTORY_PRESERVE = "latest latest_srcrev"
+BUILDHISTORY_PRESERVE = "latest latest_srcrev sysroot"
 
 PATCH_GIT_USER_EMAIL ?= "buildhistory@oe"
 PATCH_GIT_USER_NAME ?= "OpenEmbedded"
 
+buildhistory_emit_sysroot() {
+       mkdir --parents ${BUILDHISTORY_DIR_PACKAGE}
+       buildhistory_list_files ${SYSROOT_DESTDIR}

${BUILDHISTORY_DIR_PACKAGE}/sysroot

meta/classes/buildhistory.bbclass +2 -0
+}
+
 #
 # Write out metadata about this package for comparison when writing

future packages
#
python buildhistory_emit_pkghistory() {
+ if d.getVar('BB_CURRENTTASK') in ['populate_sysroot',
'populate_sysroot_setscene']:

meta/classes/buildhistory.bbclass +2 -0
+        bb.build.exec_func("buildhistory_emit_sysroot", d)
+
     if not d.getVar('BB_CURRENTTASK') in ['packagedata',

'packagedata_setscene']:
return 0

--
2.11.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw

Well spotted, thanks.

Changed in my branch.
Ross

Quoted 52 lines · Martin Jansa
Quoted 2 lines

Changes to the sysroot as just as

small typo in commit message if you need to update this commit again for whatever other reason.

Quoted 46 lines · Ross Burton

Changes to the sysroot as just as interesting during development, so write the file listing for the sysroot to buildhistory too.

---
 meta/classes/buildhistory.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
meta/classes/buildhistory.bbclass +9 -2
index 2e501df24b4..baa7c8e2799 100644
@@ -60,15 +60,23 @@ SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "| buildhistory_emit_outputsigs"
 # When extending build history, derive your class from buildhistory.bbclass
 # and extend this list here with the additional files created by the derived
 # class.
-BUILDHISTORY_PRESERVE = "latest latest_srcrev"
+BUILDHISTORY_PRESERVE = "latest latest_srcrev sysroot"
 
 PATCH_GIT_USER_EMAIL ?= "buildhistory@oe"
 PATCH_GIT_USER_NAME ?= "OpenEmbedded"
 
+buildhistory_emit_sysroot() {
+       mkdir --parents ${BUILDHISTORY_DIR_PACKAGE}
+       buildhistory_list_files ${SYSROOT_DESTDIR} ${BUILDHISTORY_DIR_PACKAGE}/sysroot
+}
+
 #
 # Write out metadata about this package for comparison when writing future packages
 #
 python buildhistory_emit_pkghistory() {
+    if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']:
+        bb.build.exec_func("buildhistory_emit_sysroot", d)
+
     if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
         return 0
 
--

2.11.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core