diff mbox series

[1/3] lib/oe/buildhistory_analysis: add support for SDKs

Message ID 20251107152730.1774081-1-ross.burton@arm.com
State New
Headers show
Series [1/3] lib/oe/buildhistory_analysis: add support for SDKs | expand

Commit Message

Ross Burton Nov. 7, 2025, 3:27 p.m. UTC
Add support for SDKs to the buildhistory difference analysis, and show
the difference in total size, package list, and file list.

[ YOCTO #16057 ]

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oe/buildhistory_analysis.py | 31 +++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
index 4edad01580c..2c5f9c6b169 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -26,14 +26,14 @@  import bb.tinfoil
 list_fields = ['DEPENDS', 'RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RREPLACES', 'RCONFLICTS', 'FILES', 'FILELIST', 'USER_CLASSES', 'IMAGE_CLASSES', 'IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS', 'PACKAGE_EXCLUDE']
 list_order_fields = ['PACKAGES']
 defaultval_map = {'PKG': 'PKG', 'PKGE': 'PE', 'PKGV': 'PV', 'PKGR': 'PR'}
-numeric_fields = ['PKGSIZE', 'IMAGESIZE']
+numeric_fields = ['PKGSIZE', 'IMAGESIZE', 'SDKSIZE']
 # Fields to monitor
-monitor_fields = ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RREPLACES', 'RCONFLICTS', 'PACKAGES', 'FILELIST', 'PKGSIZE', 'IMAGESIZE', 'PKG']
+monitor_fields = ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RREPLACES', 'RCONFLICTS', 'PACKAGES', 'FILELIST', 'PKGSIZE', 'IMAGESIZE', 'SDKSIZE', 'PKG']
 ver_monitor_fields = ['PKGE', 'PKGV', 'PKGR']
 # Percentage change to alert for numeric fields
 monitor_numeric_threshold = 10
 # Image files to monitor (note that image-info.txt is handled separately)
-img_monitor_files = ['installed-package-names.txt', 'files-in-image.txt']
+img_monitor_files = ['installed-package-names.txt', 'files-in-image.txt', 'files-in-sdk.txt']
 
 colours = {
     'colour_default': '',
@@ -673,6 +673,31 @@  def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep
                 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 path.startswith('sdk/'):
+            filename = os.path.basename(d.a_blob.path)
+            if filename in img_monitor_files:
+                if filename == 'files-in-sdk.txt':
+                    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 filename == 'installed-package-names.txt':
+                    alines = d.a_blob.data_stream.read().decode('utf-8').splitlines()
+                    blines = d.b_blob.data_stream.read().decode('utf-8').splitlines()
+                    filechanges = compare_lists(alines,blines)
+                    if filechanges:
+                        chg = ChangeRecord(path, filename, None, None, True)
+                        chg.filechanges = filechanges
+                        changes.append(chg)
+                else:
+                    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 == 'sdk-info.txt':
+                changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver))
+
     # Look for added preinst/postinst/prerm/postrm
     # (without reporting newly added recipes)
     addedpkgs = []