[v2] package.bbclass: Sort FILES_INFO by key

Submitted by Jacob Kroon on Jan. 8, 2019, 10:13 p.m. | Patch ID: 157638

Details

Message ID 20190108221301.13352-1-jacob.kroon@gmail.com
State New
Headers show

Commit Message

Jacob Kroon Jan. 8, 2019, 10:13 p.m.
Observing depsig.do_package for a package inbetween rebuilds indicated
that FILES_INFO was changing content order randomly. Force it to be
deterministic by sorting with respect to the keys when serializing.

Suggested-by: Joshua Watt <jpewhacker@gmail.com>
Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
---
 meta/classes/package.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 0fe9576b4d..322c4ec77f 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1438,7 +1438,7 @@  fi
             if fstat.st_ino not in seen:
                 seen.add(fstat.st_ino)
                 total_size += fstat.st_size
-        d.setVar('FILES_INFO', json.dumps(files))
+        d.setVar('FILES_INFO', json.dumps(files, sort_keys=True))
 
         subdata_file = pkgdatadir + "/runtime/%s" % pkg
         sf = open(subdata_file, 'w')